Some updates

This commit is contained in:
binarymaster 2014-12-10 01:00:20 +03:00
parent 4054ef493b
commit 31cce7a873
5 changed files with 171 additions and 151 deletions

View File

@ -39,7 +39,7 @@ INI_FILE::INI_FILE(wchar_t *FilePath)
}
FileRaw = new char[FileSize];
Status = (bool)ReadFile(hFile, FileRaw, FileSize, &NumberOfBytesRead, NULL);
Status = ReadFile(hFile, FileRaw, FileSize, &NumberOfBytesRead, NULL);
if (!Status)
{
return;
@ -371,6 +371,7 @@ bool INI_FILE::GetVariableInSection(char *SectionName, char *VariableName, INI_V
DWORD ValueLen = strlen(Variable.VariableValue);
if ((ValueLen % 2) != 0) return false;
// for security reasons not more than 16 bytes
if (ValueLen > 32) ValueLen = 32; // 32 hex digits

View File

@ -87,6 +87,7 @@ public:
INI_FILE(wchar_t*);
~INI_FILE();
// char block
bool SectionExists(char *SectionName);
bool VariableExists(char *SectionName, char *VariableName);
bool GetVariableInSection(char *SectionName, char *VariableName, INI_VAR_STRING *Variable);
@ -95,6 +96,15 @@ public:
bool GetVariableInSection(char *SectionName, char *VariableName, INI_VAR_BYTEARRAY *Variable);
bool GetSectionVariablesList(char *SectionName, INI_SECTION_VARLIST *VariablesList);
// wchar_t tramps
bool SectionExists(wchar_t *SectionName);
bool VariableExists(wchar_t *SectionName, wchar_t *VariableName);
bool GetVariableInSection(wchar_t *SectionName, wchar_t *VariableName, INI_VAR_STRING *Variable);
bool GetVariableInSection(wchar_t *SectionName, wchar_t *VariableName, INI_VAR_DWORD *Variable);
bool GetVariableInSection(wchar_t *SectionName, wchar_t *VariableName, bool *Variable);
bool GetVariableInSection(wchar_t *SectionName, wchar_t *VariableName, INI_VAR_BYTEARRAY *Variable);
bool GetSectionVariablesList(wchar_t *SectionName, INI_SECTION_VARLIST *VariablesList);
private:
DWORD FileSize; // Ini file size
char *FileRaw; // Ini file raw dump

View File

@ -56,7 +56,7 @@ FARJMP Old_SLGetWindowsInformationDWORD, Stub_SLGetWindowsInformationDWORD;
SLGETWINDOWSINFORMATIONDWORD _SLGetWindowsInformationDWORD;
INI_FILE *IniFile;
wchar_t LogFile[256] = {0x00};
wchar_t LogFile[256] = L"\\rdpwrap.txt";
HMODULE hTermSrv;
HMODULE hSLC;
PLATFORM_DWORD TermSrvBase;
@ -519,7 +519,7 @@ void Hook()
return;
}
INI_VAR_STRING LogFileVar;
/*INI_VAR_STRING LogFileVar;
if(!(IniFile->GetVariableInSection("Main", "LogFile", &LogFileVar)))
{
@ -533,7 +533,7 @@ void Hook()
}
}
}
else memcpy((void*)LogFile, LogFileVar.Value, strlen(LogFileVar.Value));
else memcpy((void*)LogFile, LogFileVar.Value, strlen(LogFileVar.Value));*/
char *Log;
SIZE_T bw;
@ -680,6 +680,7 @@ void Hook()
INI_VAR_STRING PatchName;
INI_VAR_BYTEARRAY Patch;
Sect = new char[1024];
memset(Sect, 0x00, 1024);
wsprintfA(Sect, "%d.%d.%d.%d", FV.wVersion.Major, FV.wVersion.Minor, FV.Release, FV.Build);
if (IniFile->SectionExists(Sect))

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
@ -27,26 +27,26 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v110</PlatformToolset>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v110</PlatformToolset>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v110</PlatformToolset>
<PlatformToolset>v120</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v110</PlatformToolset>
<PlatformToolset>v120</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
@ -160,6 +160,7 @@
<Text Include="ReadMe.txt" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="IniFile.h" />
<ClInclude Include="stdafx.h" />
<ClInclude Include="targetver.h" />
</ItemGroup>
@ -178,6 +179,7 @@
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
</PrecompiledHeader>
</ClCompile>
<ClCompile Include="IniFile.cpp" />
<ClCompile Include="RDPWrap.cpp" />
<ClCompile Include="stdafx.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>

View File

@ -24,6 +24,9 @@
<ClInclude Include="targetver.h">
<Filter>Заголовочные файлы</Filter>
</ClInclude>
<ClInclude Include="IniFile.h">
<Filter>Заголовочные файлы</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="stdafx.cpp">
@ -35,6 +38,9 @@
<ClCompile Include="dllmain.cpp">
<Filter>Файлы исходного кода</Filter>
</ClCompile>
<ClCompile Include="IniFile.cpp">
<Filter>Файлы исходного кода</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="Export.def">