Hacking Custom Resolutions into the D3 Linux Binary Fun
Posted: Mon Feb 25, 2008 10:42 pm
I've hacked in custom resolutions into the D3 Linux binary, since it doesn't seem to support custom resolutions via command line options like the windows binary does. (It does seem to support weird stuff like the Rock'n'Ride chair? WTF? Has anyone ever looked at this?)
The general strategy was to assume that the screen resolution values were stored close to each other in the binary. So I wrote a quicky C program to output offsets of binary values given a file to search and a binary value given as hexadecimal input. I searched for values like 960, 1200, and so on. I outputted these results to files. Then I wrote another quicky C program to take in two files with lists of numbers, take the differences of the numbers between the two lists, sort them, and then print the results. In any case, the results aren't anything that a bit of insight wouldn't have discovered either:
(The following is for the fully-patched dynamically linked executable.)
Resolutions start at byte 2564288 up until byte 2564320. The resolution dimensions are stored as 16-bit little-endian ints:
offset 0x0: 512
offset 0x2: 384
offset 0x4: 640
offset 0x6: 480
. . .
offset 0x1c: 1600
offset 0x1e: 1200
I modified 1280x960 to be 1280x800:
Additional hack value for modifying the resolution's menu text: these strings start at byte 2491748 and are null-separated.
Of course, open-sourcing D3 would have been so much easier. ^_^
The general strategy was to assume that the screen resolution values were stored close to each other in the binary. So I wrote a quicky C program to output offsets of binary values given a file to search and a binary value given as hexadecimal input. I searched for values like 960, 1200, and so on. I outputted these results to files. Then I wrote another quicky C program to take in two files with lists of numbers, take the differences of the numbers between the two lists, sort them, and then print the results. In any case, the results aren't anything that a bit of insight wouldn't have discovered either:
(The following is for the fully-patched dynamically linked executable.)
Resolutions start at byte 2564288 up until byte 2564320. The resolution dimensions are stored as 16-bit little-endian ints:
offset 0x0: 512
offset 0x2: 384
offset 0x4: 640
offset 0x6: 480
. . .
offset 0x1c: 1600
offset 0x1e: 1200
I modified 1280x960 to be 1280x800:
Additional hack value for modifying the resolution's menu text: these strings start at byte 2491748 and are null-separated.
Of course, open-sourcing D3 would have been so much easier. ^_^