Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix function signature inconsistency #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions FunctionTest/FunctionTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ DWORD HashFunctionName(LPSTR name) {
return hash;
}

extern "C" ULONG_PTR LoadDLL(ULONG_PTR uiLibraryAddress, DWORD dwFunctionHash, LPVOID lpUserData, DWORD nUserdataLen, DWORD flags);
extern "C" ULONG_PTR LoadDLL(PBYTE pbModule, DWORD dwFunctionHash, LPVOID lpUserData, DWORD dwUserdataLen, PVOID pvShellcodeBase, DWORD dwFlags);

int main()
{
Expand All @@ -107,9 +107,10 @@ int main()
}

LoadDLL(
(ULONG_PTR)buffer,
(PBYTE)buffer,
HashFunctionName("SayGoodbye"),
NULL, 0,
nullptr,
SRDI_CLEARHEADER | SRDI_CLEARMEMORY // | SRDI_OBFUSCATEIMPORTS | (3 << 16)
);

Expand Down
4 changes: 2 additions & 2 deletions Native/Loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ BOOL ConvertToShellcode(LPVOID inBytes, DWORD length, DWORD userFunction, LPVOID
bootstrap[i++] = 0x89;
bootstrap[i++] = 0x4C;
bootstrap[i++] = 0x24;
bootstrap[i++] = 5 * 8;
bootstrap[i++] = 4 * 8;

// add rcx, <Offset of the DLL>
bootstrap[i++] = 0x48;
Expand All @@ -199,7 +199,7 @@ BOOL ConvertToShellcode(LPVOID inBytes, DWORD length, DWORD userFunction, LPVOID
bootstrap[i++] = 0xC7;
bootstrap[i++] = 0x44;
bootstrap[i++] = 0x24;
bootstrap[i++] = 4 * 8;
bootstrap[i++] = 5 * 8;
MoveMemory(bootstrap + i, &flags, sizeof(flags));
i += sizeof(flags);

Expand Down