Skip to content

Commit 717ca09

Browse files
committed
Revert last commit.
1 parent 141ebe2 commit 717ca09

15 files changed

+66
-42
lines changed

NativeCore/Windows/CloseRemoteProcess.cpp

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

33
#include "NativeCore.hpp"
44

5-
extern "C" void RC_CallConv CloseRemoteProcess(RC_Pointer handle)
5+
void RC_CallConv CloseRemoteProcess(RC_Pointer handle)
66
{
77
CloseHandle(handle);
88
}

NativeCore/Windows/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 RC_CallConv ControlRemoteProcess(RC_Pointer handle, ControlRemoteProcessAction action)
6+
void RC_CallConv ControlRemoteProcess(RC_Pointer handle, ControlRemoteProcessAction action)
77
{
88
if (action == ControlRemoteProcessAction::Suspend || action == ControlRemoteProcessAction::Resume)
99
{

NativeCore/Windows/Debugger.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
#include "NativeCore.hpp"
55

6-
extern "C" bool RC_CallConv AttachDebuggerToProcess(RC_Pointer id)
6+
bool RC_CallConv AttachDebuggerToProcess(RC_Pointer id)
77
{
88
if (!DebugActiveProcess(static_cast<DWORD>(reinterpret_cast<size_t>(id))))
99
{
@@ -15,12 +15,12 @@ extern "C" bool RC_CallConv AttachDebuggerToProcess(RC_Pointer id)
1515
return true;
1616
}
1717

18-
extern "C" void RC_CallConv DetachDebuggerFromProcess(RC_Pointer id)
18+
void RC_CallConv DetachDebuggerFromProcess(RC_Pointer id)
1919
{
2020
DebugActiveProcessStop(static_cast<DWORD>(reinterpret_cast<size_t>(id)));
2121
}
2222

23-
extern "C" bool RC_CallConv AwaitDebugEvent(DebugEvent* evt, int timeoutInMilliseconds)
23+
bool RC_CallConv AwaitDebugEvent(DebugEvent* evt, int timeoutInMilliseconds)
2424
{
2525
DEBUG_EVENT _evt = { };
2626
if (!WaitForDebugEvent(&_evt, timeoutInMilliseconds))
@@ -127,7 +127,7 @@ extern "C" bool RC_CallConv AwaitDebugEvent(DebugEvent* evt, int timeoutInMillis
127127
return result;
128128
}
129129

130-
extern "C" void RC_CallConv HandleDebugEvent(DebugEvent* evt)
130+
void RC_CallConv HandleDebugEvent(DebugEvent* evt)
131131
{
132132
DWORD continueStatus = 0;
133133
switch (evt->ContinueStatus)
@@ -143,7 +143,7 @@ extern "C" void RC_CallConv HandleDebugEvent(DebugEvent* evt)
143143
ContinueDebugEvent(static_cast<DWORD>(reinterpret_cast<size_t>(evt->ProcessId)), static_cast<DWORD>(reinterpret_cast<size_t>(evt->ThreadId)), continueStatus);
144144
}
145145

146-
extern "C" bool RC_CallConv SetHardwareBreakpoint(RC_Pointer id, RC_Pointer address, HardwareBreakpointRegister reg, HardwareBreakpointTrigger type, HardwareBreakpointSize size, bool set)
146+
bool RC_CallConv SetHardwareBreakpoint(RC_Pointer id, RC_Pointer address, HardwareBreakpointRegister reg, HardwareBreakpointTrigger type, HardwareBreakpointSize size, bool set)
147147
{
148148
if (reg == HardwareBreakpointRegister::InvalidRegister)
149149
{
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 RC_CallConv DisassembleCode(RC_Pointer address, RC_Size length, RC_Pointer virtualAddress, bool determineStaticInstructionBytes, InstructionData* instruction)
3+
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/Windows/EnumerateProcesses.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Platform GetProcessPlatform(HANDLE process)
4444
return Platform::Unknown;
4545
}
4646

47-
extern "C" void RC_CallConv EnumerateProcesses(EnumerateProcessCallback callbackProcess)
47+
void RC_CallConv EnumerateProcesses(EnumerateProcessCallback callbackProcess)
4848
{
4949
if (callbackProcess == nullptr)
5050
{

NativeCore/Windows/EnumerateRemoteSectionsAndModules.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,7 @@
55

66
#include "NativeCore.hpp"
77

8-
bool CompareAddress(const EnumerateRemoteSectionData& lhs, const LPVOID& rhs)
9-
{
10-
return lhs.BaseAddress < rhs;
11-
}
12-
13-
extern "C" void RC_CallConv EnumerateRemoteSectionsAndModules(RC_Pointer process, EnumerateRemoteSectionsCallback callbackSection, EnumerateRemoteModulesCallback callbackModule)
8+
void RC_CallConv EnumerateRemoteSectionsAndModules(RC_Pointer process, EnumerateRemoteSectionsCallback callbackSection, EnumerateRemoteModulesCallback callbackModule)
149
{
1510
if (callbackSection == nullptr && callbackModule == nullptr)
1611
{
@@ -81,7 +76,10 @@ extern "C" void RC_CallConv EnumerateRemoteSectionsAndModules(RC_Pointer process
8176

8277
if (callbackSection != nullptr)
8378
{
84-
const auto it = std::lower_bound(std::begin(sections), std::end(sections), static_cast<LPVOID>(me32.modBaseAddr), CompareAddress);
79+
auto it = std::lower_bound(std::begin(sections), std::end(sections), static_cast<LPVOID>(me32.modBaseAddr), [&sections](const auto& lhs, const LPVOID& rhs)
80+
{
81+
return lhs.BaseAddress < rhs;
82+
});
8583

8684
IMAGE_DOS_HEADER DosHdr = {};
8785
IMAGE_NT_HEADERS NtHdr = {};

NativeCore/Windows/Input.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ class DirectInput
120120
std::vector<Keys> currentState;
121121
};
122122

123-
extern "C" RC_Pointer RC_CallConv InitializeInput()
123+
RC_Pointer RC_CallConv InitializeInput()
124124
{
125125
auto input = new DirectInput();
126126
if (!input->Initialize())
@@ -132,12 +132,12 @@ extern "C" RC_Pointer RC_CallConv InitializeInput()
132132
return static_cast<RC_Pointer>(input);
133133
}
134134

135-
extern "C" bool RC_CallConv GetPressedKeys(RC_Pointer handle, Keys* keys[], int* count)
135+
bool RC_CallConv GetPressedKeys(RC_Pointer handle, Keys* keys[], int* count)
136136
{
137137
return static_cast<DirectInput*>(handle)->ReadKeyboardState(keys, count);
138138
}
139139

140-
extern "C" void RC_CallConv ReleaseInput(RC_Pointer handle)
140+
void RC_CallConv ReleaseInput(RC_Pointer handle)
141141
{
142142
delete static_cast<DirectInput*>(handle);
143143
}

NativeCore/Windows/IsProcessValid.cpp

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

33
#include "NativeCore.hpp"
44

5-
extern "C" bool RC_CallConv IsProcessValid(RC_Pointer handle)
5+
bool RC_CallConv IsProcessValid(RC_Pointer handle)
66
{
77
if (!handle || handle == INVALID_HANDLE_VALUE)
88
{

NativeCore/Windows/NativeCore.hpp

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,24 @@
33
#include "../ReClassNET_Plugin.hpp"
44
#include "../Shared/Keys.hpp"
55

6-
extern "C"
7-
{
8-
void RC_CallConv EnumerateProcesses(EnumerateProcessCallback callbackProcess);
9-
void RC_CallConv EnumerateRemoteSectionsAndModules(RC_Pointer handle, EnumerateRemoteSectionsCallback callbackSection, EnumerateRemoteModulesCallback callbackModule);
6+
void RC_CallConv EnumerateProcesses(EnumerateProcessCallback callbackProcess);
7+
void RC_CallConv EnumerateRemoteSectionsAndModules(RC_Pointer handle, EnumerateRemoteSectionsCallback callbackSection, EnumerateRemoteModulesCallback callbackModule);
108

11-
RC_Pointer RC_CallConv OpenRemoteProcess(RC_Pointer id, ProcessAccess desiredAccess);
12-
bool RC_CallConv IsProcessValid(RC_Pointer handle);
13-
void RC_CallConv CloseRemoteProcess(RC_Pointer handle);
9+
RC_Pointer RC_CallConv OpenRemoteProcess(RC_Pointer id, ProcessAccess desiredAccess);
10+
bool RC_CallConv IsProcessValid(RC_Pointer handle);
11+
void RC_CallConv CloseRemoteProcess(RC_Pointer handle);
1412

15-
bool RC_CallConv ReadRemoteMemory(RC_Pointer handle, RC_Pointer address, RC_Pointer buffer, int offset, int size);
16-
bool RC_CallConv WriteRemoteMemory(RC_Pointer handle, RC_Pointer address, RC_Pointer buffer, int offset, int size);
13+
bool RC_CallConv ReadRemoteMemory(RC_Pointer handle, RC_Pointer address, RC_Pointer buffer, int offset, int size);
14+
bool RC_CallConv WriteRemoteMemory(RC_Pointer handle, RC_Pointer address, RC_Pointer buffer, int offset, int size);
1715

18-
void RC_CallConv ControlRemoteProcess(RC_Pointer handle, ControlRemoteProcessAction action);
16+
void RC_CallConv ControlRemoteProcess(RC_Pointer handle, ControlRemoteProcessAction action);
1917

20-
bool RC_CallConv AttachDebuggerToProcess(RC_Pointer id);
21-
void RC_CallConv DetachDebuggerFromProcess(RC_Pointer id);
22-
bool RC_CallConv AwaitDebugEvent(DebugEvent* evt, int timeoutInMilliseconds);
23-
void RC_CallConv HandleDebugEvent(DebugEvent* evt);
24-
bool RC_CallConv SetHardwareBreakpoint(RC_Pointer id, RC_Pointer address, HardwareBreakpointRegister reg, HardwareBreakpointTrigger type, HardwareBreakpointSize size, bool set);
18+
bool RC_CallConv AttachDebuggerToProcess(RC_Pointer id);
19+
void RC_CallConv DetachDebuggerFromProcess(RC_Pointer id);
20+
bool RC_CallConv AwaitDebugEvent(DebugEvent* evt, int timeoutInMilliseconds);
21+
void RC_CallConv HandleDebugEvent(DebugEvent* evt);
22+
bool RC_CallConv SetHardwareBreakpoint(RC_Pointer id, RC_Pointer address, HardwareBreakpointRegister reg, HardwareBreakpointTrigger type, HardwareBreakpointSize size, bool set);
2523

26-
RC_Pointer RC_CallConv InitializeInput();
27-
bool RC_CallConv GetPressedKeys(RC_Pointer handle, Keys* state[], int* count);
28-
void RC_CallConv ReleaseInput(RC_Pointer handle);
29-
}
24+
RC_Pointer RC_CallConv InitializeInput();
25+
bool RC_CallConv GetPressedKeys(RC_Pointer handle, Keys* state[], int* count);
26+
void RC_CallConv ReleaseInput(RC_Pointer handle);

NativeCore/Windows/NativeCore.vcxproj

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@
108108
<Link>
109109
<SubSystem>Windows</SubSystem>
110110
<GenerateDebugInformation>true</GenerateDebugInformation>
111+
<ModuleDefinitionFile>exports.def</ModuleDefinitionFile>
111112
<AdditionalDependencies>dinput8.lib;dxguid.lib;%(AdditionalDependencies)</AdditionalDependencies>
112113
</Link>
113114
</ItemDefinitionGroup>
@@ -122,6 +123,7 @@
122123
<Link>
123124
<SubSystem>Windows</SubSystem>
124125
<GenerateDebugInformation>true</GenerateDebugInformation>
126+
<ModuleDefinitionFile>exports.def</ModuleDefinitionFile>
125127
<AdditionalDependencies>dinput8.lib;dxguid.lib;%(AdditionalDependencies)</AdditionalDependencies>
126128
</Link>
127129
</ItemDefinitionGroup>
@@ -140,6 +142,7 @@
140142
<EnableCOMDATFolding>true</EnableCOMDATFolding>
141143
<OptimizeReferences>true</OptimizeReferences>
142144
<GenerateDebugInformation>true</GenerateDebugInformation>
145+
<ModuleDefinitionFile>exports.def</ModuleDefinitionFile>
143146
<AdditionalDependencies>dinput8.lib;dxguid.lib;%(AdditionalDependencies)</AdditionalDependencies>
144147
</Link>
145148
</ItemDefinitionGroup>
@@ -158,6 +161,7 @@
158161
<EnableCOMDATFolding>true</EnableCOMDATFolding>
159162
<OptimizeReferences>true</OptimizeReferences>
160163
<GenerateDebugInformation>true</GenerateDebugInformation>
164+
<ModuleDefinitionFile>exports.def</ModuleDefinitionFile>
161165
<AdditionalDependencies>dinput8.lib;dxguid.lib;%(AdditionalDependencies)</AdditionalDependencies>
162166
</Link>
163167
</ItemDefinitionGroup>
@@ -184,6 +188,9 @@
184188
<ClCompile Include="ReadRemoteMemory.cpp" />
185189
<ClCompile Include="WriteRemoteMemory.cpp" />
186190
</ItemGroup>
191+
<ItemGroup>
192+
<None Include="exports.def" />
193+
</ItemGroup>
187194
<ItemGroup>
188195
<ClInclude Include="..\ReClassNET_Plugin.hpp" />
189196
<ClInclude Include="NativeCore.hpp" />

0 commit comments

Comments
 (0)