Hack a compiled .exe to run in Windowed mode?

Blitz3D Forums/Blitz3D Programming/Hack a compiled .exe to run in Windowed mode?

Chispon(Posted 2014) [#1]
I made a simple game a long time a go, it runs at 320x200 in fullscreen mode.
The problem is that newer Windows versions don't even run fullscreen programs at that resolution and I get the Error: "Unable to set graphics mode" :/

I found a tutorial on http://socoder.net/index.php?snippet=20426

It says that the byte sequence that Blitz3D uses to create the initial default Windows is: 6A 01 53 53 68 2C 01 00 00 68 90 01 00 00

6A 01 is Window mode and 6A 00 is full screen.

But what is the sequence that it uses when you set a new graphics mode using the "Graphics" command?

Thanks in advance for your help!


xlsior(Posted 2014) [#2]
I'd say: create a very simple "hello0 world" style program, compile it.
Change resolutions: compile it.

Do a comparison on the two .exe's:

e.g. in windows there's a commandline file comparison tool called fc.exe

fc.exe /b file1.exe file2.exe
The output will show the different HEX values between the two files, and the (hex) offset from the start of the file.


xlsior(Posted 2014) [#3]
Oh, and a caveat: Note that if your original program was compiled with an older version of B3D, there's the possibility that the headers may have changed as well, and the offset may no longer be the same.

Not necessarily so, but just bringing up the possibility.
In that case, you may be able to download the older B3D client of that era and attempt to find the offset IT is using with the test mentioned in my previous post.


Chispon(Posted 2014) [#4]
Ok, I'll try that, thanks for your help @xlsior :D


Chispon(Posted 2014) [#5]
I managed to change it, even the resolution!. It's so nice to resurrect my old little game :D

Thanks a lot sir!


xlsior(Posted 2014) [#6]
Congrats!