Qhimm.com Forums
Miscellaneous Forums => Scripting and Reverse Engineering => Topic started by: DLPB_ on 2011-05-28 06:36:46
-
Apparently the tabs in dialogue are created from the space value. A normal tab is 4 spaces (E1 function), and a selection tab is 10 spaces (E0 function).
I have tried to locate in the executable the whereabouts of the code that decides whether it is 4 or 10 spaces etc. I need to be able to change this so I can directly affect tab spacing.
Anyone have any idea where it is? There has to be a place in code that looks up the data in window.bin for the space value and then does the math on it. Ive tried tracing what accesses the space value but came up with nothing.
Any ideas?
-
Can't be sure, because I can't run FF7, but it should be:
Here for E0:
00631CF4 /> 0FBF55 08 MOVSX EDX,WORD PTR SS:[EBP+8] ; // E0
(…)
00631D25 |. 83F8 0A |CMP EAX,0A
And here for E1:
00631C5A /> 0FBF45 08 MOVSX EAX,WORD PTR SS:[EBP+8] ; // E1
(…)
00631C8B |. 83F9 04 |CMP ECX,4
-
I will check that out. Thanks a lot man!
edit:
Yup. That's the one! Many thanks. Seems I used the wrong area to find the code which accesses e0. I should have been looking at the area around 05a31700.
1 further question:
Do you have any idea why the code for E0 is duplicated? This same code seems to appear in 2 different areas. The dialogue cursor position does too. Possibly 2 different areas for the options depending on particular dialogue boxes? I am not sure.
In the executable at
0011fae9
and 00231127
I couldn't find the dupe in memory though? Hmm
The dialogue cursor is at 0063137B with dupe data at 0076967b
-
Ok, so:
0011fae9 + 0x400C00 = 0x5206E9
00231127 + 0x400C00 = 0x631D27
The second address is the spacing for E0 we already know, and the first one holds this line:
005206E7 |. 83F8 0A |CMP EAX,0A ; // 0x50
No doubt, that loop executes 10 times, but there is a comparison before the loop - something is compared with 0x50. How did you connect it to E0?
As for the cursor - the second address fits with the worldmap part of the ff7.exe (before the chocobo stuff) - you might want to check that.
-
I see... so the second part is probably the world map dialogue boxes, like when you dismount from Chocobo (assuming that they left that in... I can't remember if they removed options on the world map from final game).
That makes sense. As for the first part... I checked the code before and after the 0a, and it all seemed to match. Coincidence... possibly.. but it was a lot of identical code.
You seem to have a good grasp of the exe, can I take it you have some documentation somewhere which would help us all? Like which parts of the exe are used for certain areas of the game?
-
Documentation... No, not really... I used to have some, but it was all on paper. As for the parts in the exe - compiled code follows the original structure of the source code. If you make a list of every string referenced in the exe (most debuggers offer that) and look at texts like "Entering FRAME_INITIALIZE SWIRL", you'll get a good look at how it was put together.
-
i see ;) Well you have been a great help. Thanks a lot! I was looking for something like space address multiplied by 0a
Never thought it was a loop...
-
Sure, no problem. Good luck reversing ;)
-
Spaced characters (opcode FEE9) any idea where this is used in the exe...? I did a little digging, perhaps I missed it. This creates large spaces between characters in dialogue.
-
Depends on what exactly you're after, but... here: 0x006328D3.
-
Yeah I looked at this code... but I thought there would be something simple to adjust the length of the spacing between the letters (make spacing smaller).
Any ideas?
Or is it gonna take a little coding 8)
Failing being able to change the space size, eliminating the spaces altogether would help.
-
Ah, look at 0x006E731B then. If the lowest bit of 0x0DC3CD4 is set, extra spacing occurs.
-
Cheers! Setting xor to 0 should fix that but also from there it was possible to find 6e7b07, which seems to be the spacing value.
Cheers again!
This is how it is looking now. I also sorted out the useless original spacing issue with loveless.
(http://img804.imageshack.us/img804/6341/newh.png)