Skip to content

Commit dd5c06d

Browse files
committed
Switch ruptura_main from stdcall to cdecl.
We don't use CreateRemoteThread to invoke it directly, so using cdecl simplifies finding the symbol for 32-bit (no stdcall name mangling). Part of #5.
1 parent 5d17e92 commit dd5c06d

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/injection/AssemblyInjector.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ async Task InjectModuleAsync(string modulePath, nuint parameterArea, MemoryMappe
254254

255255
asm.push(__dword_ptr[esp + 4]);
256256
asm.call(eax);
257+
asm.add(esp, 4);
257258
asm.jmp(done);
258259

259260
asm.Label(ref failure);

src/module/main.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ typedef struct
1111
uint32_t main_thread_id;
1212
} ruptura_parameters;
1313

14-
__declspec(dllexport) uint32_t __stdcall ruptura_main(ruptura_parameters *nonnull parameters);
14+
__declspec(dllexport) uint32_t ruptura_main(ruptura_parameters *nonnull parameters);

0 commit comments

Comments
 (0)