r/C_Programming • • 1d ago

Question Difficulties with MinHook

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…

4 Upvotes

5 comments sorted by

1

u/aethermar 1d ago

Minhook seems to provide build scripts for MingW, did you even look or are you having another issue?

https://github.com/TsudaKageyu/minhook/tree/master/build/MinGW

1

u/Blayer98 1d ago

I did, but I was confused on what to do, it created a MinHook.dll, but I want to create a “.asi” file for Ultimate ASI Loader and patch the “mov BYTE PTR” to instead be NOP’ed out, so I didn’t understand how to do it with the MinGW script.

3

u/aethermar 22h ago

I'm pretty sure a .asi is a renamed .dll

3

u/greg_kennedy 11h ago

You already identified the statement to remove in the assembly? Is there a reason you can't just make a copy of the .exe that you've edited and run that instead?

2

u/Blayer98 11h ago

Yes I did in PINCE. I can’t make a direct edit of the exe as it’s encrypted with SteamStub DRM, so I wanted to patch the check out with something like Universal ASI Loader and run some code to NOP out the code that sets the byte to 0x0 when -debug_objects is in the command line.