diff --git a/Debug/BrowserPluginExtender.dll b/Debug/BrowserPluginExtender.dll index 16263e2..c2555fc 100644 Binary files a/Debug/BrowserPluginExtender.dll and b/Debug/BrowserPluginExtender.dll differ diff --git a/Debug/BrowserPluginExtender.ilk b/Debug/BrowserPluginExtender.ilk index 6a38850..c8cf075 100644 Binary files a/Debug/BrowserPluginExtender.ilk and b/Debug/BrowserPluginExtender.ilk differ diff --git a/Debug/BrowserPluginExtender.pdb b/Debug/BrowserPluginExtender.pdb index a9a9f48..bb5f2ae 100644 Binary files a/Debug/BrowserPluginExtender.pdb and b/Debug/BrowserPluginExtender.pdb differ diff --git a/Extender/BrowserPluginExtender.aps b/Extender/BrowserPluginExtender.aps index 7cffe91..e2e14ae 100644 Binary files a/Extender/BrowserPluginExtender.aps and b/Extender/BrowserPluginExtender.aps differ diff --git a/Extender/BrowserPluginExtender.rc b/Extender/BrowserPluginExtender.rc index 538daa8..fb5e89b 100644 Binary files a/Extender/BrowserPluginExtender.rc and b/Extender/BrowserPluginExtender.rc differ diff --git a/Extender/Debug/BrowserP.320D85F1.tlog/link.read.1.tlog b/Extender/Debug/BrowserP.320D85F1.tlog/link.read.1.tlog index 3199682..9215488 100644 Binary files a/Extender/Debug/BrowserP.320D85F1.tlog/link.read.1.tlog and b/Extender/Debug/BrowserP.320D85F1.tlog/link.read.1.tlog differ diff --git a/Extender/Debug/BrowserPluginExtender.res b/Extender/Debug/BrowserPluginExtender.res index 3a6f7b1..a41a260 100644 Binary files a/Extender/Debug/BrowserPluginExtender.res and b/Extender/Debug/BrowserPluginExtender.res differ diff --git a/Extender/Debug/Extender.log b/Extender/Debug/Extender.log index 0de64d0..beaa52e 100644 --- a/Extender/Debug/Extender.log +++ b/Extender/Debug/Extender.log @@ -1,10 +1,7 @@ C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Platforms\Win32\PlatformToolsets\v141_xp\Toolset.targets(39,5): warning MSB8051: Support for targeting Windows XP is deprecated and will not be present in future releases of Visual Studio. Please see https://go.microsoft.com/fwlink/?linkid=2023588 for more information. Extender.cpp -c:\users\anthony\documents\visual studio 2017\projects\browserpluginextender\extender\shared.h(31): warning C4133: '-': incompatible types - from 'void *' to 'char *' main.cpp -c:\users\anthony\documents\visual studio 2017\projects\browserpluginextender\extender\shared.h(31): warning C4133: '-': incompatible types - from 'void *' to 'char *' shared.cpp -c:\users\anthony\documents\visual studio 2017\projects\browserpluginextender\extender\shared.h(31): warning C4133: '-': incompatible types - from 'void *' to 'char *' c:\program files (x86)\microsoft sdks\windows\v7.1a\include\dbghelp.h(1540): warning C4091: 'typedef ': ignored on left of '' when no variable is declared c:\program files (x86)\microsoft sdks\windows\v7.1a\include\dbghelp.h(3056): warning C4091: 'typedef ': ignored on left of '' when no variable is declared Generating Code... diff --git a/Extender/Debug/main.obj b/Extender/Debug/main.obj index eca5e0c..58f9fb6 100644 Binary files a/Extender/Debug/main.obj and b/Extender/Debug/main.obj differ diff --git a/Extender/Debug/vc141.idb b/Extender/Debug/vc141.idb index 9731488..a3a6f94 100644 Binary files a/Extender/Debug/vc141.idb and b/Extender/Debug/vc141.idb differ diff --git a/Extender/Debug/vc141.pdb b/Extender/Debug/vc141.pdb index 5fe7fe5..5082479 100644 Binary files a/Extender/Debug/vc141.pdb and b/Extender/Debug/vc141.pdb differ diff --git a/Extender/Extender.cpp b/Extender/Extender.cpp index 272339f..8eea398 100644 --- a/Extender/Extender.cpp +++ b/Extender/Extender.cpp @@ -85,8 +85,6 @@ bool testCode(HMODULE moduleHandle, RELATIVE_VIRTUAL_ADDRESS codeRelativeVirtual bool result = memoryEqual(codePointer, testedCode, codeVirtualSize); - codePointer = NULL; - if (!protectCode(moduleHandle, codeVirtualAddress, codeVirtualSize, oldProtect)) { showLastError("Failed to Protect Code"); return false; @@ -127,7 +125,6 @@ bool extendCode(HMODULE moduleHandle, RELATIVE_VIRTUAL_ADDRESS codeRelativeVirtu *(VIRTUAL_ADDRESS*)(codePointer + 1) = (VIRTUAL_ADDRESS)extendedCode - codeVirtualAddress - CODE_VIRTUAL_SIZE; *codePointer = call ? INSTRUCTIONS_CALL : INSTRUCTIONS_JMP; - codePointer = NULL; if (!protectCode(moduleHandle, codeVirtualAddress, CODE_VIRTUAL_SIZE, oldProtect)) { showLastError("Failed to Protect Code"); @@ -167,7 +164,6 @@ bool extendCode(HMODULE moduleHandle, RELATIVE_VIRTUAL_ADDRESS codeRelativeVirtu const CODE1 INSTRUCTIONS_NOP = 0x90; *codePointer = INSTRUCTIONS_NOP; - codePointer = NULL; if (!protectCode(moduleHandle, codeVirtualAddress, CODE_VIRTUAL_SIZE, oldProtect)) { showLastError("Failed to Protect Code"); diff --git a/Extender/Release/BrowserPluginExtender.res b/Extender/Release/BrowserPluginExtender.res index 3a6f7b1..a41a260 100644 Binary files a/Extender/Release/BrowserPluginExtender.res and b/Extender/Release/BrowserPluginExtender.res differ diff --git a/Extender/Release/Extender.log b/Extender/Release/Extender.log index 53ee2be..e903ab8 100644 --- a/Extender/Release/Extender.log +++ b/Extender/Release/Extender.log @@ -1,10 +1,7 @@ C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Platforms\Win32\PlatformToolsets\v141_xp\Toolset.targets(39,5): warning MSB8051: Support for targeting Windows XP is deprecated and will not be present in future releases of Visual Studio. Please see https://go.microsoft.com/fwlink/?linkid=2023588 for more information. Extender.cpp -c:\users\anthony\documents\visual studio 2017\projects\browserpluginextender\extender\shared.h(31): warning C4133: '-': incompatible types - from 'void *' to 'char *' main.cpp -c:\users\anthony\documents\visual studio 2017\projects\browserpluginextender\extender\shared.h(31): warning C4133: '-': incompatible types - from 'void *' to 'char *' shared.cpp -c:\users\anthony\documents\visual studio 2017\projects\browserpluginextender\extender\shared.h(31): warning C4133: '-': incompatible types - from 'void *' to 'char *' c:\program files (x86)\microsoft sdks\windows\v7.1a\include\dbghelp.h(1540): warning C4091: 'typedef ': ignored on left of '' when no variable is declared c:\program files (x86)\microsoft sdks\windows\v7.1a\include\dbghelp.h(3056): warning C4091: 'typedef ': ignored on left of '' when no variable is declared Creating library C:\Users\Anthony\Documents\Visual Studio 2017\Projects\BrowserPluginExtender\Release\BrowserPluginExtender.lib and object C:\Users\Anthony\Documents\Visual Studio 2017\Projects\BrowserPluginExtender\Release\BrowserPluginExtender.exp diff --git a/Extender/Release/main.obj b/Extender/Release/main.obj index a7d930d..eb102a0 100644 Binary files a/Extender/Release/main.obj and b/Extender/Release/main.obj differ diff --git a/Extender/Release/vc141.pdb b/Extender/Release/vc141.pdb index 56be0e2..1a77167 100644 Binary files a/Extender/Release/vc141.pdb and b/Extender/Release/vc141.pdb differ diff --git a/Extender/shared.cpp b/Extender/shared.cpp index 77809f9..fb39c7b 100644 --- a/Extender/shared.cpp +++ b/Extender/shared.cpp @@ -39,19 +39,19 @@ bool testSectionAddress(HMODULE moduleHandle, VIRTUAL_ADDRESS virtualAddress, VI if (imageDOSHeaderPointer->e_magic != IMAGE_DOS_SIGNATURE) { showLastError("e_magic must be IMAGE_DOS_SIGNATURE"); - goto error; + return false; } PIMAGE_NT_HEADERS imageNTHeadersPointer = ImageNtHeader(imageDOSHeaderPointer); if (!imageNTHeadersPointer) { showLastError("imageNTHeadersPointer must not be NULL"); - goto error; + return false; } if (imageNTHeadersPointer->Signature != IMAGE_NT_SIGNATURE) { showLastError("Signature must be IMAGE_NT_SIGNATURE"); - goto error2; + return false; } PIMAGE_SECTION_HEADER imageSectionHeaderPointer = (PIMAGE_SECTION_HEADER)(imageNTHeadersPointer + 1); @@ -64,20 +64,12 @@ bool testSectionAddress(HMODULE moduleHandle, VIRTUAL_ADDRESS virtualAddress, VI VIRTUAL_ADDRESS moduleVirtualAddress = (VIRTUAL_ADDRESS)moduleHandle; for (WORD i = 0; i < imageNTHeadersPointer->FileHeader.NumberOfSections; i++) { - if (virtualAddress >= moduleVirtualAddress + imageSectionHeaderPointer->VirtualAddress && virtualAddress + virtualSize <= moduleVirtualAddress + imageSectionHeaderPointer->VirtualAddress + imageSectionHeaderPointer->Misc.VirtualSize) { - imageSectionHeaderPointer = NULL; - imageNTHeadersPointer = NULL; - imageDOSHeaderPointer = NULL; + if (virtualAddress >= moduleVirtualAddress + imageSectionHeaderPointer->VirtualAddress + && virtualAddress + virtualSize <= moduleVirtualAddress + imageSectionHeaderPointer->VirtualAddress + imageSectionHeaderPointer->Misc.VirtualSize) { return true; } imageSectionHeaderPointer++; } - - imageSectionHeaderPointer = NULL; - error2: - imageNTHeadersPointer = NULL; - error: - imageDOSHeaderPointer = NULL; return false; } \ No newline at end of file diff --git a/Extender/shared.h b/Extender/shared.h index 1f21060..603fa8a 100644 --- a/Extender/shared.h +++ b/Extender/shared.h @@ -24,6 +24,8 @@ inline bool memoryEqual(const void* buffer, const void* buffer2, size_t bufferSi } inline bool memoryShift(size_t bufferSize, void* buffer, size_t sourceSize, void* source, size_t shift, bool direction) { + #pragma warning(push) + #pragma warning(disable : 4133) if (source < buffer || (char*)source + sourceSize > (char*)buffer + bufferSize) { return false; } @@ -41,6 +43,7 @@ inline bool memoryShift(size_t bufferSize, void* buffer, size_t sourceSize, void return false; } return !memmove_s(destination, destinationSize, source, sourceSize); + #pragma warning(pop) } bool showLastError(LPCSTR errorMessage); diff --git a/Release/BrowserPluginExtender.dll b/Release/BrowserPluginExtender.dll index f9c8983..e0d1ef9 100644 Binary files a/Release/BrowserPluginExtender.dll and b/Release/BrowserPluginExtender.dll differ diff --git a/Release/BrowserPluginExtender.iobj b/Release/BrowserPluginExtender.iobj index 7d15964..5a46155 100644 Binary files a/Release/BrowserPluginExtender.iobj and b/Release/BrowserPluginExtender.iobj differ diff --git a/Release/BrowserPluginExtender.ipdb b/Release/BrowserPluginExtender.ipdb index 7062488..4523ff2 100644 Binary files a/Release/BrowserPluginExtender.ipdb and b/Release/BrowserPluginExtender.ipdb differ diff --git a/Release/BrowserPluginExtender.pdb b/Release/BrowserPluginExtender.pdb index 8fc6526..3c111b1 100644 Binary files a/Release/BrowserPluginExtender.pdb and b/Release/BrowserPluginExtender.pdb differ