My code:
// -------- INCLUDE ----------------
#include <Windows.h>
#include <windowsx.h>
#include <d3dx9.h>
#include <stdio.h>
IDirect3DDevice9* device = *(IDirect3DDevice9**)0xC97C28; // DirectX Device
IDirect3DTexture9* pTexture; //
bool DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved)
{
if(fdwReason == DLL_PROCESS_ATTACH)
{
if(D3DXCreateTextureFromFile(device, L"tex.png", &pTexture) != D3D_OK)
{
printf("Fail!");
return 0;
}
printf("Abc!");
}
return TRUE;
}
Log:
Abc!
I don't know why the crash occurs.
Earlier this code to run!
And today I see crash.
I greet and please for help.