Created
September 3, 2014 12:41
-
-
Save alessandrogario/82e01e29cf8de9301416 to your computer and use it in GitHub Desktop.
Simple IDC script for IDA Pro that prevents the game (XCOM: Terror from the Deep) from going fullscren
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// XCOM-TFtD_DisableFullscreen.idc | |
// Simple IDC script for IDA Pro that prevents the game (XCOM: Terror from the Deep) from going fullscren | |
#include <idc.idc> | |
static main() | |
{ | |
auto IDirectDraw7_SetCooperativeLevel = 0x0046587E; | |
if (!RunTo(IDirectDraw7_SetCooperativeLevel)) | |
return 1; | |
if (GetDebuggerEvent(WFNE_SUSP, -1) <= 0) | |
return 1; | |
auto screen_flags_ptr = GetRegValue("ESP"); | |
screen_flags_ptr = screen_flags_ptr + 0x08; | |
auto screen_flags = DbgDword(screen_flags_ptr); | |
if (screen_flags != 0x51) // (DDSCL_FULLSCREEN | DDSCL_EXCLUSIVE | DDSCL_ALLOWMODEX) | |
return 1; | |
PatchDbgByte(screen_flags_ptr, 0x08); // (DDSCL_NORMAL) | |
GetDebuggerEvent(WFNE_CONT, 0); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment