Skip to content

Commit

Permalink
Switch ruptura_main from stdcall to cdecl.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
alexrp committed Jul 6, 2022
1 parent 5d17e92 commit dd5c06d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/injection/AssemblyInjector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ async Task InjectModuleAsync(string modulePath, nuint parameterArea, MemoryMappe
asm.push(__dword_ptr[esp + 4]);
asm.call(eax);
asm.add(esp, 4);
asm.jmp(done);
asm.Label(ref failure);
Expand Down
2 changes: 1 addition & 1 deletion src/module/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ typedef struct
uint32_t main_thread_id;
} ruptura_parameters;

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

0 comments on commit dd5c06d

Please sign in to comment.