mirror of
https://github.com/rapid7/metasploit-payloads
synced 2025-02-16 00:24:29 +01:00
fix DEP issue with meterp, fixes #48
git-svn-id: file:///home/svn/framework3/trunk@4703 4d416f70-5f16-0410-b530-b9f4589650da
This commit is contained in:
parent
4d294dd6cb
commit
b82a1a0422
Binary file not shown.
@ -541,15 +541,20 @@ void map_file(SHELLCODE_CTX *ctx)
|
||||
HMODULE libloader_load_library(LPCSTR name, PUCHAR buffer, DWORD bufferLength)
|
||||
{
|
||||
LPCSTR shortName = name, slash = NULL;
|
||||
SHELLCODE_CTX lctx;
|
||||
SHELLCODE_CTX *lctx;
|
||||
HMODULE mod = NULL;
|
||||
|
||||
lctx = (SHELLCODE_CTX *)VirtualAlloc(NULL, sizeof(SHELLCODE_CTX), MEM_COMMIT, PAGE_EXECUTE_READWRITE);
|
||||
|
||||
if (!lctx)
|
||||
return NULL;
|
||||
|
||||
if ((slash = strrchr(name, '\\')))
|
||||
shortName = slash+1;
|
||||
|
||||
memset(&lctx, 0, sizeof(lctx));
|
||||
memset(lctx, 0, sizeof(lctx));
|
||||
|
||||
ctx = &lctx;
|
||||
ctx = lctx;
|
||||
|
||||
install_hooks(ctx);
|
||||
|
||||
@ -573,6 +578,8 @@ HMODULE libloader_load_library(LPCSTR name, PUCHAR buffer, DWORD bufferLength)
|
||||
|
||||
remove_hooks(ctx);
|
||||
|
||||
VirtualFree(lctx, sizeof(SHELLCODE_CTX), MEM_RELEASE);
|
||||
|
||||
ctx = NULL;
|
||||
|
||||
return mod;
|
||||
|
@ -182,6 +182,7 @@
|
||||
AdditionalLibraryDirectories="..\common\Release"
|
||||
GenerateManifest="false"
|
||||
ModuleDefinitionFile="..\..\source\server\metsrv.def"
|
||||
GenerateDebugInformation="false"
|
||||
GenerateMapFile="true"
|
||||
MapFileName=".\Release/metsrv.map"
|
||||
ImportLibrary=".\Release/metsrv.lib"
|
||||
|
Loading…
Reference in New Issue
Block a user