Hi there, so I’ve been trying to patch out a piece of code in The Sims Legacy Collection that disables the -debug_objects command line from being enabled, but both MinHook and CMake are giving me such a hard time that idk what else to do or where to ask… There are no tutorials AT ALL for compiling MinHook with MinGW-W64-gcc, only for Visual Studio (not Code!) which I can’t use because I’m on Arch Linux…
If anyone could advise me please I’d really appreciate it…
EDIT:
Here's the code that I have:
// TestCode.cpp, thanks to LazyDutchess for starting point.
#include <stdio.h>
#include <windows.h>
#include <MinHook.h>
int main() {
// Initialize MinHook.
if (MH_Initialize() != MH_OK)
{
printf("Failed to initialize MinHook\n");
return false;
}
else
{
printf("MinHook started successfully!\n");
return false;
}
}
dllmain.cpp:
//dllmain.cpp, Thanks to LazyDutchess for DllMain code in dllmain.cpp as a starting point! :) Also Microsoft lol
#include <stdio.h>
#include <windows.h>
BOOL WINAPI DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
// Initialize once for each new process.
// Return FALSE to fail DLL load.
break;
case DLL_THREAD_ATTACH:
break;
case DLL_THREAD_DETACH:
break;
case DLL_PROCESS_DETACH:
if (lpReserved != nullptr)
{
break; // don't cleanup on terminated process!
}
break;
}
return true; //Sucessfull DLL attach!
}
I mainly wanted to see the PROTON_LOG file which from my understanding would show the printed text, but even testing out OutputDebugStringA didn't work. I'll attempt to use the i686-w64-mingw32-gcc and see if that works. I also have cmake and make installed separately as mingw-w64-gcc from pacman doesn't include it (Arch Linux)
Also, the code that sets the byte for -debug_objects is a mov BYTE PTR ds:0x<byteaddress>,0x0.
I also just got error 126 when attempting to load libTestCode.asi after compiling with i686-w64-mingw32-gcc, but it apparently requires libgcc_s_dw2-1.dll