Skip to content

Commit d56f7ec

Browse files
committed
Added RC_CallConv.
1 parent d9c73d6 commit d56f7ec

24 files changed

+61
-59
lines changed

NativeCore/ReClassNET_Plugin.hpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@
1010
// OS Specific
1111

1212
#ifdef __linux__
13-
#define __stdcall __attribute__((__stdcall__))
13+
#define RC_CallConv
14+
#elif _WIN32
15+
#define RC_CallConv __stdcall
16+
#else
17+
static_assert(false, "Missing RC_CallConv specification");
1418
#endif
1519

1620
// Types
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "NativeCore.hpp"
22

3-
extern "C" void CloseRemoteProcess(RC_Pointer handle)
3+
extern "C" void RC_CallConv CloseRemoteProcess(RC_Pointer handle)
44
{
55

66
}

NativeCore/Unix/ControlRemoteProcess.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
#include "NativeCore.hpp"
55

6-
extern "C" void ControlRemoteProcess(RC_Pointer handle, ControlRemoteProcessAction action)
6+
extern "C" void RC_CallConv ControlRemoteProcess(RC_Pointer handle, ControlRemoteProcessAction action)
77
{
88
int signal = SIGKILL;
99
if (action == ControlRemoteProcessAction::Suspend)

NativeCore/Unix/Debugger.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ pid_t waitpid_timeout(int* status, int timeoutInMilliseconds, bool& timedOut)
5151
return waitpid_timeout(-1, status, 0, timeoutInMilliseconds, timedOut);
5252
}
5353

54-
extern "C" bool AttachDebuggerToProcess(RC_Pointer id)
54+
extern "C" bool RC_CallConv AttachDebuggerToProcess(RC_Pointer id)
5555
{
5656
//TODO: Attach to all threads.
5757

@@ -64,14 +64,14 @@ extern "C" bool AttachDebuggerToProcess(RC_Pointer id)
6464
return false;
6565
}
6666

67-
extern "C" void DetachDebuggerFromProcess(RC_Pointer id)
67+
extern "C" void RC_CallConv DetachDebuggerFromProcess(RC_Pointer id)
6868
{
6969
//TODO: Detach to all threads.
7070

7171
ptrace(PTRACE_DETACH, static_cast<pid_t>(reinterpret_cast<intptr_t>(id)), nullptr, nullptr);
7272
}
7373

74-
extern "C" bool AwaitDebugEvent(DebugEvent* evt, int timeoutInMilliseconds)
74+
extern "C" bool RC_CallConv AwaitDebugEvent(DebugEvent* evt, int timeoutInMilliseconds)
7575
{
7676
int status;
7777
bool timedOut;
@@ -169,7 +169,7 @@ extern "C" bool AwaitDebugEvent(DebugEvent* evt, int timeoutInMilliseconds)
169169
return result;
170170
}
171171

172-
extern "C" void HandleDebugEvent(DebugEvent* evt)
172+
extern "C" void RC_CallConv HandleDebugEvent(DebugEvent* evt)
173173
{
174174
auto tid = static_cast<pid_t>(reinterpret_cast<intptr_t>(evt->ThreadId));
175175

@@ -196,7 +196,7 @@ extern "C" void HandleDebugEvent(DebugEvent* evt)
196196
}
197197
}
198198

199-
extern "C" bool SetHardwareBreakpoint(RC_Pointer id, RC_Pointer address, HardwareBreakpointRegister reg, HardwareBreakpointTrigger type, HardwareBreakpointSize size, bool set)
199+
extern "C" bool RC_CallConv SetHardwareBreakpoint(RC_Pointer id, RC_Pointer address, HardwareBreakpointRegister reg, HardwareBreakpointTrigger type, HardwareBreakpointSize size, bool set)
200200
{
201201
if (reg == HardwareBreakpointRegister::InvalidRegister)
202202
{
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "../Shared/DistormHelper.hpp"
22

3-
extern "C" bool DisassembleCode(RC_Pointer address, RC_Size length, RC_Pointer virtualAddress, bool determineStaticInstructionBytes, InstructionData* instruction)
3+
extern "C" bool RC_CallConv DisassembleCode(RC_Pointer address, RC_Size length, RC_Pointer virtualAddress, bool determineStaticInstructionBytes, InstructionData* instruction)
44
{
55
return DisassembleCodeImpl(address, length, virtualAddress, determineStaticInstructionBytes, instruction);
66
}

NativeCore/Unix/EnumerateProcesses.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Platform GetProcessPlatform(const std::string& auxvPath)
7979
return platform;
8080
}
8181

82-
extern "C" void EnumerateProcesses(EnumerateProcessCallback callbackProcess)
82+
extern "C" void RC_CallConv EnumerateProcesses(EnumerateProcessCallback callbackProcess)
8383
{
8484
if (callbackProcess == nullptr)
8585
{

NativeCore/Unix/EnumerateRemoteSectionsAndModules.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ std::istream& operator >> (std::istream& s, SectionProtection& protection)
3636
return s;
3737
}
3838

39-
extern "C" void EnumerateRemoteSectionsAndModules(RC_Pointer handle, EnumerateRemoteSectionsCallback callbackSection, EnumerateRemoteModulesCallback callbackModule)
39+
extern "C" void RC_CallConv EnumerateRemoteSectionsAndModules(RC_Pointer handle, EnumerateRemoteSectionsCallback callbackSection, EnumerateRemoteModulesCallback callbackModule)
4040
{
4141
if (callbackSection == nullptr && callbackModule == nullptr)
4242
{

NativeCore/Unix/Input.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
#include "NativeCore.hpp"
22
#include "../Shared/Keys.hpp"
33

4-
void ReleaseInput();
5-
6-
RC_Pointer InitializeInput()
4+
RC_Pointer RC_CallConv InitializeInput()
75
{
86
return nullptr;
97
}
108

11-
bool GetPressedKeys(RC_Pointer handle, Keys* state[], int* count)
9+
bool RC_CallConv GetPressedKeys(RC_Pointer handle, Keys* state[], int* count)
1210
{
1311
return false;
1412
}
1513

16-
void ReleaseInput(RC_Pointer handle)
14+
void RC_CallConv ReleaseInput(RC_Pointer handle)
1715
{
1816

1917
}

NativeCore/Unix/IsProcessValid.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
#include "NativeCore.hpp"
55

6-
extern "C" bool IsProcessValid(RC_Pointer handle)
6+
extern "C" bool RC_CallConv IsProcessValid(RC_Pointer handle)
77
{
88
return kill(static_cast<pid_t>(reinterpret_cast<intptr_t>(handle)), 0) == 0;
99
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "NativeCore.hpp"
22

3-
extern "C" RC_Pointer OpenRemoteProcess(RC_Pointer id, ProcessAccess desiredAccess)
3+
extern "C" RC_Pointer RC_CallConv OpenRemoteProcess(RC_Pointer id, ProcessAccess desiredAccess)
44
{
55
return id;
66
}

0 commit comments

Comments
 (0)