Go Back   Steam Users' Forums > Steam Game Discussions > Q - S > Saints Row 2

Reply
 
Thread Tools Display Modes
Old 07-31-2013, 05:58 PM   #1
KiteX3
 
Join Date: Aug 2008
Reputation: 57
Posts: 420
Changing SR2 Resolution Manually with a Hex Editor

Apparently the currently preferred method of setting the resolution in SR2 to an unsupported resolution (like 1366x768) involves running obscure closed-source code written by some guy on the internet; since that's no good for a malware-wary Linux geek like myself, I did my homework and found that it can also be done manually by modifying the values in the binary file located at

C:\Users\[yournamehere]\AppData\Local\THQ\Saints Row 2\settings.dat

using a hex editor. I did it using Cygwin (because even if I have to use Windows for gaming, an OS without a proper Unix-style command line is worthless) with the utilities "hexdump", "od", and "hexedit".

If you want to do the same (at your own risk), here is what worked for me:

First, cd to the appropriate directory and run
Code:
od -i settings.dat
The output will be the data in the file, interpreted as integers; two of the numbers listed should correspond to your current resolution. In my case, the output was:
Code:
0000000           5          56           3  1065353216
0000020  1065353216  1065353216  1065353216           0
0000040           0  1056964608    16777216  1056964608
0000060  1056964608  1056964608           0         640
0000100         480           2    16780801         802
0000120           2   659101480  1033873888   577703054
0000140  1568321575 -1435367010 -1307626150   425713639
0000160 -1117887508  1036399197 -1188529679  -650314281
0000200   292964773   601427089  -451887645  1153138858
0000220 -1996010066   638653227  -825688277  1322977294
0000240   405426850 -1902575008   414625522  1956385266
0000260  1310131445   285780680   -66327815  2019041945
0000300 -1444472511  1138243155 -1626214270   237602453
0000320  1837494375   634982190  1609586294  2051474573
0000340  -757402339  1942027042  2136811401  -791132931
0000360  -540039682  -464903885  1072585473   393496412
0000400  1096411613  1674993685  1494361122  -677933953
0000420  1342346017  1372748159 -2122912032  -925212295
0000440  -504637000  1491531137  -452747231   739604232
0000460  1887979015 -1198745442 -2100179959 -1232114913
0000500  -641025670 -2083222824   320034753 -1593536150
0000520   880817626
0000524
Notice the "640" at the end of the row labeled 0000060 and the "480" at the start of the row labeled 000100? That's the current resolution, and what we need to change. Open up settings.dat in hexedit using the command:
Code:
hexedit settings.dat
You'll be bombarded with an wall of numbers:
Code:
00000000   05 00 00 00  38 00 00 00  03 00 00 00  00 00 80 3F  ....8..........?
00000010   00 00 80 3F  00 00 80 3F  00 00 80 3F  00 00 00 00  ...?...?...?....
00000020   00 00 00 00  00 00 00 3F  00 00 00 01  00 00 00 3F  .......?.......?
00000030   00 00 00 3F  00 00 00 3F  00 00 00 00  80 02 00 00  ...?...?....V...
00000040   E0 01 00 00  02 00 00 00  01 0E 00 01  22 03 00 00  ............"...
00000050   02 00 00 00  28 17 49 27  E0 A9 9F 3D  8E 0C 6F 22  ....(.I'...=..o"
00000060   27 B0 7A 5D  9E 09 72 AA  5A 35 0F B2  E7 DF 5F 19  '.z]..r.Z5...._.
00000070   EC 63 5E BD  5D 32 C6 3D  F1 79 28 B9  D7 FD 3C D9  .c^.]2.=.y(...<.
00000080   A5 49 76 11  91 0C D9 23  E3 BD 10 E5  AA 80 BB 44  .Iv....#.......D
00000090   AE 4D 07 89  2B 13 11 26  2B FF C8 CE  0E 08 DB 4E  .M..+..&+......N
000000A0   A2 52 2A 18  60 02 99 8E  F2 AE B6 18  F2 11 9C 74  .R*.`..........t
000000B0   F5 04 17 4E  C8 AA 08 11  F9 EA 0B FC  99 22 58 78  ...N........."Xx
000000C0   41 19 E7 A9  53 36 D8 43  82 F0 11 9F  95 86 29 0E  A...S6.C......).
000000D0   67 F0 85 6D  2E 0F D9 25  76 56 F0 5F  8D 04 47 7A  g..m...%vV._..Gz
000000E0   1D F5 DA D2  22 FB C0 73  89 27 5D 7F  FD 44 D8 D0  ...."..s.']..D..
000000F0   FE A5 CF DF  33 21 4A E4  01 5B EE 3F  5C 47 74 17  ....3!J..[.?\Gt.
00000100   DD E9 59 41  15 60 D6 63  22 24 12 59  7F 8C 97 D7  ..YA.`.c"$.Y....
00000110   21 93 02 50  7F 79 D2 51  E0 EE 76 81  79 61 DA C8  !..P.y.Q..v.ya..
00000120   B8 D9 EB E1  81 F5 E6 58  21 A0 03 E5  08 77 15 2C  .......X!....w.,
00000130   07 46 88 70  9E 98 8C B8  09 CC D1 82  1F 6B 8F B6  .F.p.........k..
00000140   7A B9 CA D9  D8 8A D4 83  C1 57 13 13  6A 91 04 A1  z........W..j...
00000150   DA 35 80 34                                         .5.4
In that wall, locate the resolution numbers; the leftmost column contains the number (in hexidecimal) of the first hexidecimal value-pair in that row, which corresponds to the octal row numbering of the od command; or you can just resize the Cygwin window until hexedit starts up with four columns (shut it down without saving with the keyboard shortcut Ctrl+C), spatially matching up to the four-column output of your od command. Once you've found it, you can verify that you're editing the right values using math:

80 02 00 00 = 8*16^1 + 0*16^0 + 0*16^3 + 2*16^2 + 0*16^5 + ... = 640
E0 01 00 00 = 14*16^1 + 0*16^0 + 0*16^3 + 1*16^2 + 0*16^5 + ... = 480

Once you're sufficiently convinced you're not editing something you shouldn't, change those values to whatever it is to match the resolution you want, and then hit Ctrl+X to save and quit. In my case:

1366 = 5*16^1 + 6*16^0 + 0*16^3 + 5*16^2 + 0*16^5 + ... = 56 05 00 00
768 = 0*16^1 + 0*16^0 + 0*16^3 + 3*16^2 + 0*16^5 + ... = 00 03 00 00

And as such my edited settings.dat looks like this in hexedit:
Code:
00000000   05 00 00 00  38 00 00 00  03 00 00 00  00 00 80 3F  ....8..........?
00000010   00 00 80 3F  00 00 80 3F  00 00 80 3F  00 00 00 00  ...?...?...?....
00000020   00 00 00 00  00 00 00 3F  00 00 00 01  00 00 00 3F  .......?.......?
00000030   00 00 00 3F  00 00 00 3F  00 00 00 00  56 05 00 00  ...?...?....V...
00000040   00 03 00 00  02 00 00 00  01 0E 00 01  22 03 00 00  ............"...
00000050   02 00 00 00  28 17 49 27  E0 A9 9F 3D  8E 0C 6F 22  ....(.I'...=..o"
00000060   27 B0 7A 5D  9E 09 72 AA  5A 35 0F B2  E7 DF 5F 19  '.z]..r.Z5...._.
00000070   EC 63 5E BD  5D 32 C6 3D  F1 79 28 B9  D7 FD 3C D9  .c^.]2.=.y(...<.
00000080   A5 49 76 11  91 0C D9 23  E3 BD 10 E5  AA 80 BB 44  .Iv....#.......D
00000090   AE 4D 07 89  2B 13 11 26  2B FF C8 CE  0E 08 DB 4E  .M..+..&+......N
000000A0   A2 52 2A 18  60 02 99 8E  F2 AE B6 18  F2 11 9C 74  .R*.`..........t
000000B0   F5 04 17 4E  C8 AA 08 11  F9 EA 0B FC  99 22 58 78  ...N........."Xx
000000C0   41 19 E7 A9  53 36 D8 43  82 F0 11 9F  95 86 29 0E  A...S6.C......).
000000D0   67 F0 85 6D  2E 0F D9 25  76 56 F0 5F  8D 04 47 7A  g..m...%vV._..Gz
000000E0   1D F5 DA D2  22 FB C0 73  89 27 5D 7F  FD 44 D8 D0  ...."..s.']..D..
000000F0   FE A5 CF DF  33 21 4A E4  01 5B EE 3F  5C 47 74 17  ....3!J..[.?\Gt.
00000100   DD E9 59 41  15 60 D6 63  22 24 12 59  7F 8C 97 D7  ..YA.`.c"$.Y....
00000110   21 93 02 50  7F 79 D2 51  E0 EE 76 81  79 61 DA C8  !..P.y.Q..v.ya..
00000120   B8 D9 EB E1  81 F5 E6 58  21 A0 03 E5  08 77 15 2C  .......X!....w.,
00000130   07 46 88 70  9E 98 8C B8  09 CC D1 82  1F 6B 8F B6  .F.p.........k..
00000140   7A B9 CA D9  D8 8A D4 83  C1 57 13 13  6A 91 04 A1  z........W..j...
00000150   DA 35 80 34                                         .5.4
And when I run od -i settings.dat again, I get:
Code:
0000000           5          56           3  1065353216
0000020  1065353216  1065353216  1065353216           0
0000040           0  1056964608    16777216  1056964608
0000060  1056964608  1056964608           0        1366
0000100         768           2    16780801         802
0000120           2   659101480  1033873888   577703054
0000140  1568321575 -1435367010 -1307626150   425713639
0000160 -1117887508  1036399197 -1188529679  -650314281
0000200   292964773   601427089  -451887645  1153138858
0000220 -1996010066   638653227  -825688277  1322977294
0000240   405426850 -1902575008   414625522  1956385266
0000260  1310131445   285780680   -66327815  2019041945
0000300 -1444472511  1138243155 -1626214270   237602453
0000320  1837494375   634982190  1609586294  2051474573
0000340  -757402339  1942027042  2136811401  -791132931
0000360  -540039682  -464903885  1072585473   393496412
0000400  1096411613  1674993685  1494361122  -677933953
0000420  1342346017  1372748159 -2122912032  -925212295
0000440  -504637000  1491531137  -452747231   739604232
0000460  1887979015 -1198745442 -2100179959 -1232114913
0000500  -641025670 -2083222824   320034753 -1593536150
0000520   880817626
0000524
And then that should set your game's resolution to whatever arbitrary values you wanted.
KiteX3 is offline  
Reply With Quote
Old 07-05-2014, 04:23 AM   #2
Zidders
 
Join Date: Feb 2009
Reputation: 89
Posts: 141
This is very cool though I feel it's important to mention that Rick (Gibbed), the fellow who made the resolution fix is a well known, and much respected modder in the SR modding scene. He's not just 'some guy on the internet'.
Zidders is offline   Reply With Quote
Old 02-24-2015, 08:06 AM   #3
Minimaul
 
 
 
Join Date: Dec 2010
Reputation: 1
Posts: 8
Although this is a really old post, I'd also like to point out that the source code is actually available too: http://svn.gib.me/public/saintsrow2/...w2.Resolution/
Minimaul is offline   Reply With Quote
Reply

Go Back   Steam Users' Forums > Steam Game Discussions > Q - S > Saints Row 2


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -7. The time now is 12:05 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Site Content Copyright Valve Corporation 1998-2015, All Rights Reserved.