Skip to content

Commit

Permalink
update to Extender 1.5.5
Browse files Browse the repository at this point in the history
  • Loading branch information
tomysshadow committed Aug 2, 2023
1 parent 547dfcf commit 6e1094e
Show file tree
Hide file tree
Showing 22 changed files with 8 additions and 23 deletions.
Binary file modified Debug/BrowserPluginExtender.dll
Binary file not shown.
Binary file modified Debug/BrowserPluginExtender.ilk
Binary file not shown.
Binary file modified Debug/BrowserPluginExtender.pdb
Binary file not shown.
Binary file modified Extender/BrowserPluginExtender.aps
Binary file not shown.
Binary file modified Extender/BrowserPluginExtender.rc
Binary file not shown.
Binary file modified Extender/Debug/BrowserP.320D85F1.tlog/link.read.1.tlog
Binary file not shown.
Binary file modified Extender/Debug/BrowserPluginExtender.res
Binary file not shown.
3 changes: 0 additions & 3 deletions Extender/Debug/Extender.log
Original file line number Diff line number Diff line change
@@ -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 '<unnamed-enum-hdBase>' 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 '<unnamed-enum-sfImage>' when no variable is declared
Generating Code...
Expand Down
Binary file modified Extender/Debug/main.obj
Binary file not shown.
Binary file modified Extender/Debug/vc141.idb
Binary file not shown.
Binary file modified Extender/Debug/vc141.pdb
Binary file not shown.
4 changes: 0 additions & 4 deletions Extender/Extender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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");
Expand Down
Binary file modified Extender/Release/BrowserPluginExtender.res
Binary file not shown.
3 changes: 0 additions & 3 deletions Extender/Release/Extender.log
Original file line number Diff line number Diff line change
@@ -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 '<unnamed-enum-hdBase>' 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 '<unnamed-enum-sfImage>' 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
Expand Down
Binary file modified Extender/Release/main.obj
Binary file not shown.
Binary file modified Extender/Release/vc141.pdb
Binary file not shown.
18 changes: 5 additions & 13 deletions Extender/shared.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
}
3 changes: 3 additions & 0 deletions Extender/shared.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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);
Expand Down
Binary file modified Release/BrowserPluginExtender.dll
Binary file not shown.
Binary file modified Release/BrowserPluginExtender.iobj
Binary file not shown.
Binary file modified Release/BrowserPluginExtender.ipdb
Binary file not shown.
Binary file modified Release/BrowserPluginExtender.pdb
Binary file not shown.

0 comments on commit 6e1094e

Please sign in to comment.