Page 1 of 2
Modifications to prince.exe (hex editing)
Posted: July 25th, 2012, 8:20 pm
by poirot
I'm reopening this thread so we can post new hacks.
I'm starting with level 1 events. I have to check if they are already implemented in princehack.xml.
Level 1 events:
Code: Select all
07e2:4b2d a3 98 4c mov [4c98],ax
07e2:4b30 a3 f2 5f mov [5ff2],ax
07e2:4b33 83 3e 9e 0f 01 cmp word ptr [0f9e],0001 <-- level where the kid starts crouching
07e2:4b38 75 22 jne 4b5c
Search for: a3 .. .. a3 .. .. 83 3e .. ..
01 75 22
(offsets are p0:0x4c2d, u0:0x62dd, p3:0x50b5, u3:0x57f5, p4:0x4b71, u4:0x5ca1)
and replace
01 for level where the kid starts crouching
Code: Select all
07e2:61cb 83 3e aa 4c 00 cmp word ptr [4caa],0000
07e2:61d0 74 30 je 6202
07e2:61d2 83 3e 9e 0f 01 cmp word ptr [0f9e],0001 <-- level where the kid music is played after loading
07e2:61d7 75 29 jne 6202
07e2:61d9 9a 99 72 79 0c call 0c79:7299
Search for: 83 3e .. .. .. 74 .. 83 3e .. ..
01 75
(offsets are p0:0x62cb, u0:0x797b, p3:0x675f, u3:0x6e9f, p4:0x621b, u4:0x734b)
and replace
01 for level where the kid music is played after loading
---------------------
xml hacks are:
Code: Select all
<hack name="Hack name here">
<offset file="p0" value="0x62cb"/>
<offset file="u0" value="0x797b"/>
<offset file="p3" value="0x675f"/>
<offset file="u3" value="0x6e9f"/>
<offset file="p4" value="0x621b"/>
<offset file="u4" value="0x734b"/>
<check codes="83 3e .. .. .. 74 .. 83 3e .. .."/>
<read default="01" name="level where the kid music is played after loading" type=""/>
</hack>
<hack name="Hack name here">
<offset file="p0" value="0x4c2d"/>
<offset file="u0" value="0x62dd"/>
<offset file="p3" value="0x50b5"/>
<offset file="u3" value="0x57f5"/>
<offset file="p4" value="0x4b71"/>
<offset file="u4" value="0x5ca1"/>
<check codes="a3 .. .. a3 .. .. 83 3e .. .."/>
<read default="01" name="level where the kid starts crouching" type=""/>
</hack>
I'll take a look at the sword level too. Btw, I'm using a development version of CusAsm 2.0 that I'll put online asap.
Re: Modifications to prince.exe (hex editing)
Posted: July 26th, 2012, 10:24 am
by David
We already have a topic with the same title:
viewtopic.php?f=73&t=661
Having the sword at the beginning of the level:
Code: Select all
00004B25:i837E0601 cmp (w) [bp+06],+01
00004B29:i7405 je file:00004B30
00004B2B:iB80100 mov ax,0001
00004B2E:iEB02 jmps file:00004B32
00004B30:i2BC0 sub ax,ax
00004B32:iA3A234 mov [+34A2],ax
[bp+06] stores (temporarily) the number of the current level.
[+34A2] stores whether the prince has the sword (0=no, 1=yes)
search: 83 7E 06 01 74 05
change: This can be changed in many ways.
If you want that the prince has the sword on all levels except one, change 01 to the number of that level.
If you want that the prince never has the sword, change 74 to EB. (je->jmp)
If you want that the prince always has the sword, change 74 05 to 90 90. (je->nop)
If you want that the prince has the sword on level XX and all levels after that, change 01 to XX and 74 to 7C. (je->jl)
offsets:
u0: 0x61D5, u3: 0x56E5, u4: 0x5B91, p0: 0x4B25, p3: 0x4FA5, p4: 0x4A61
Also, I have been making a disassembly using
IDA, and I thought I could upload it. It could be used to search hacks easier.
Re: Modifications to prince.exe (hex editing)
Posted: July 26th, 2012, 4:45 pm
by Norbert
David wrote:[...], and I thought I could upload it.
Go for it.

Feel free to PM me anything if you want me to put it up at popot.org.
Re: Modifications to prince.exe (hex editing)
Posted: July 28th, 2012, 5:47 pm
by David
I have attached the disassembly to this post.
Of course it is far from being complete. All suggestions and corrections are welcome.
Re: Modifications to prince.exe (hex editing)
Posted: July 28th, 2012, 7:49 pm
by yaqxsw
David wrote:I have attached the disassembly to this post.
Of course it is far from being complete. All suggestions and corrections are welcome.
that prince without sword all level? but i brought more time, guards LP too..

Re: Modifications to prince.exe (hex editing)
Posted: July 28th, 2012, 9:31 pm
by Norbert
yaqxsw wrote:that prince without sword all level?
Not yet, but we're getting closer.

Thanks for the upload David.
Re: Modifications to prince.exe (hex editing)
Posted: August 1st, 2012, 4:08 am
by Norbert
yaqxsw, if you want I can provide you with a PRINCE.EXE file that will make the prince never have a sword (or only from a certain level, like from 11).
(I will use David's instructions to make the changes.)
If you want this, you can send me the PRINCE.EXE file you're using (from the CusPop export) via a private message and I'll send it back with the changes you want.
Or, alternatively, you could try to use a hex editor yourself (like
wxHexEditor; wxHexEditor-v0.20-Win32.zip is for Windows).
Re: Modifications to prince.exe (hex editing)
Posted: August 1st, 2012, 8:48 pm
by poirot
Is it possible to ask for the source code to Lance Groody? Anybody wants to do that?
Re: Modifications to prince.exe (hex editing)
Posted: August 1st, 2012, 11:02 pm
by Norbert
poirot wrote:Is it possible to ask for the source code to Lance Groody? Anybody wants to do that?
Would having the source code be an end by itself or a means to an end?
Either way, Groody, as a non-copyright holder, is not in a position to publish the code.
We'd have to ask Mechner to ask Groody, I think.
The code itself could be useful to find exploits/bugs, and could simplify making modifications.
Other than that, there are copyright/trademark problems, even with FreePrince.
Maybe we should let sleeping dogs lie, I don't know.
Re: Modifications to prince.exe (hex editing)
Posted: August 1st, 2012, 11:32 pm
by yaqxsw
Norbert wrote:yaqxsw, if you want I can provide you with a PRINCE.EXE file that will make the prince never have a sword (or only from a certain level, like from 11).
(I will use David's instructions to make the changes.)
If you want this, you can send me the PRINCE.EXE file you're using (from the CusPop export) via a private message and I'll send it back with the changes you want.
Or, alternatively, you could try to use a hex editor yourself (like wxHexEditor; wxHexEditor-v0.20-Win32.zip is for Windows).
I not programmist, and i can't try HexEditor.. but i sent you my Edit PRINCE.EXE
Re: Modifications to prince.exe (hex editing)
Posted: August 1st, 2012, 11:40 pm
by yaqxsw
Norbert wrote:yaqxsw, if you want I can provide you with a PRINCE.EXE file that will make the prince never have a sword (or only from a certain level, like from 11).
(I will use David's instructions to make the changes.)
If you want this, you can send me the PRINCE.EXE file you're using (from the CusPop export) via a private message and I'll send it back with the changes you want.
Or, alternatively, you could try to use a hex editor yourself (like wxHexEditor; wxHexEditor-v0.20-Win32.zip is for Windows).
How sent Prince.EXE? Message said, i cannot add some File.. i think, i can sent you in E-Mail or i write here my edit.
-----------------
300 minuts Time
Start level 1, Start LP 2
Maximal Prince LP 12
Guards LP
Level 1 - 3
Level 2 - 3
Level 4 - 4
Level 5 - 5
Level 6 - 6
Level 7 - 6
Level 8 - 6
Level 9 - 6
Level 10 - 6
Level 11 - 6
Level 12 - 6
Level 13 - 12
Re: Modifications to prince.exe (hex editing)
Posted: August 2nd, 2012, 12:00 am
by Norbert
yaqxsw wrote:How sent Prince.EXE?
If
private messaging is not working, you can e-mail it to
info@popot.org.
By the way, CusPop has a section
"Customize allowed resources per level".
If you check everything there, you can use, for example, use the chomper in level 2.
It allows you to use (almost) all the resources everywhere and the screen will not get distorted.
Re: Modifications to prince.exe (hex editing)
Posted: August 2nd, 2012, 12:12 am
by yaqxsw
E-mail sent
Re: Modifications to prince.exe (hex editing)
Posted: August 2nd, 2012, 12:24 am
by Norbert
yaqxsw wrote:E-mail sent
Okay, I've made the change and I've sent you back the altered PRINCE.EXE file.
Re: Modifications to prince.exe (hex editing)
Posted: August 2nd, 2012, 12:33 am
by yaqxsw
Thank! ot functioniert!
