Closed TaxMachine closed 2 months ago
Hello! Your issue happens because you try to make a call to a library which is not loaded by default. To solve this issue, you can do this, and it will work just fine.
#include <stdio.h>
#include <windows.h>
#include "obfusheader.h"
int main() {
printf("Playing sound...\n");
LoadLibraryA("winmm.dll");
CALL_EXPORT("winmm.dll", "PlaySoundA", decltype(&PlaySoundA), "meow.wav", 0, SND_FILENAME | SND_SYNC);
(void)getchar();
return 0;
}
Note that GetProcAdress used for CALL_EXPORT doesn't load the libraries you want to use, it just gets their handle if they're already loaded, so you have to load them manually. You can hide LoadLibraryA call aswell by doing
CALL_EXPORT("kernel32.dll", "LoadLibraryA", decltype(&LoadLibraryA), OBF("winmm.dll"));
it dies at the first obviously and I get this exception from my debugger
Exception: Exception 0xc0000005 encountered at address 0x000000: User-mode data execution prevention (DEP) violation at location 0x00000000
Compiler: MSVC in Debug mode Settings