- Joined
- May 29, 2007
- Messages
- 2,167
- Reaction score
- 899
UPDATE: A full working example has been release inside the release section, you can find it here.
This snippet code is used to spoof DSETUP.DLL. Keep in mind that you've to rename your original DSETUP.DLL to stfl32.dll. The code for hooking the sockets is not included. You can find this on Google.
This snippet code is used to spoof DSETUP.DLL. Keep in mind that you've to rename your original DSETUP.DLL to stfl32.dll. The code for hooking the sockets is not included. You can find this on Google.
Code:
#include <Windows.h>
void* p[16 * 4];
// DirectXDeviceDriverSetupA
extern "C" __declspec(naked, dllexport) void __cdecl DirectXDeviceDriverSetupA()
{
__asm
{
JMP p[0 * 4];
}
}
// DirectXDeviceDriverSetupW
extern "C" __declspec(naked, dllexport) void __cdecl DirectXDeviceDriverSetupW()
{
__asm
{
JMP p[1 * 4];
}
}
// DirectXLoadString
extern "C" __declspec(naked, dllexport) void __cdecl DirectXLoadString()
{
__asm
{
JMP p[2 * 4];
}
}
// DirectXRegisterApplicationA
extern "C" __declspec(naked, dllexport) void __cdecl DirectXRegisterApplicationA()
{
__asm
{
JMP p[3 * 4];
}
}
// DirectXRegisterApplicationW
extern "C" __declspec(naked, dllexport) void __cdecl DirectXRegisterApplicationW()
{
__asm
{
JMP p[4 * 4];
}
}
// DirectXSetupA
extern "C" __declspec(naked, dllexport) void __cdecl DirectXSetupA()
{
__asm
{
JMP p[5 * 4];
}
}
// DirectXSetupCallback
extern "C" __declspec(naked, dllexport) void __cdecl DirectXSetupCallback()
{
__asm
{
JMP p[6 * 4];
}
}
// DirectXSetupGetFileVersion
extern "C" __declspec(naked, dllexport) void __cdecl DirectXSetupGetFileVersion()
{
__asm
{
JMP p[7 * 4];
}
}
// DirectXSetupGetVersion
extern "C" __declspec(naked, dllexport) void __cdecl DirectXSetupGetVersion()
{
__asm
{
JMP p[8 * 4];
}
}
// DirectXSetupIsEng
extern "C" __declspec(naked, dllexport) void __cdecl DirectXSetupIsEng()
{
__asm
{
JMP p[9 * 4];
}
}
// DirectXSetupIsJapan
extern "C" __declspec(naked, dllexport) void __cdecl DirectXSetupIsJapan()
{
__asm
{
JMP p[10 * 4];
}
}
// DirectXSetupIsJapanNec
extern "C" __declspec(naked, dllexport) void __cdecl DirectXSetupIsJapanNec()
{
__asm
{
JMP p[11 * 4];
}
}
// DirectXSetupSetCallback
extern "C" __declspec(naked, dllexport) void __cdecl DirectXSetupSetCallback()
{
__asm
{
JMP p[12 * 4];
}
}
// DirectXSetupShowEULA
extern "C" __declspec(naked, dllexport) void __cdecl DirectXSetupShowEULA()
{
__asm
{
JMP p[13 * 4];
}
}
// DirectXSetupW
extern "C" __declspec(naked, dllexport) void __cdecl DirectXSetupW()
{
__asm
{
JMP p[14 * 4];
}
}
// DirectXUnRegisterApplication
extern "C" __declspec(naked, dllexport) void __cdecl DirectXUnRegisterApplication()
{
__asm
{
JMP p[15 * 4];
}
}
void InitializeSpoofing()
{
// Spoof processes from the original DSETUP
HINSTANCE hDll = LoadLibraryA("stfl32.dll"); // stfl32.dll - Original DSETUP (Needed)
if (hDll == NULL)
{
MessageBox(0, "Couldn't load DirectX dependencies.", 0, 0);
ExitProcess(0);
}
p[0] = GetProcAddress(hDll, "DirectXDeviceDriverSetupA");
p[1] = GetProcAddress(hDll, "DirectXDeviceDriverSetupW");
p[2] = GetProcAddress(hDll, "DirectXLoadString");
p[3] = GetProcAddress(hDll, "DirectXRegisterApplicationA");
p[4] = GetProcAddress(hDll, "DirectXRegisterApplicationW");
p[5] = GetProcAddress(hDll, "DirectXSetupA");
p[6] = GetProcAddress(hDll, "DirectXSetupCallback");
p[7] = GetProcAddress(hDll, "DirectXSetupGetFileVersion");
p[8] = GetProcAddress(hDll, "DirectXSetupGetVersion");
p[9] = GetProcAddress(hDll, "DirectXSetupIsEng");
p[10] = GetProcAddress(hDll, "DirectXSetupIsJapan");
p[11] = GetProcAddress(hDll, "DirectXSetupIsJapanNec");
p[12] = GetProcAddress(hDll, "DirectXSetupSetCallback");
p[13] = GetProcAddress(hDll, "DirectXSetupShowEULA");
p[14] = GetProcAddress(hDll, "DirectXSetupW");
p[15] = GetProcAddress(hDll, "DirectXUnRegisterApplication");
}
Last edited: