Posts: 233
Threads: 13
Joined: Oct 2008
05-19-2014, 07:08 PM
(This post was last modified: 05-19-2014, 07:17 PM by Dragon5.)
I copied Louis's armor and and fixed the jumps to the proper addresses for it to register, but it works like Julian's for some reason. Well, the obvious reason is that it probably is ignoring
the part where this lines like this "cmp dword ptr ds:[ecx+edx+7AC],5" should be the ones registering the armor. I can't figure out how to get around that.
I wanted to copy it exactly, but ODbg forced me to redo the short jumps into long ones. I assume this might be the problem to why armor will not work properly? Personally it doesn't sound like it should have been a problem, but it's the only thing I changed aside from the ID and regeneration values.
To live a life of power, you must have faith that what you believe is right, even if others tell you you're wrong.
The first thing you must do to live a life of power is to find courage. You must reach beyond the boundaries of time itself.
And to do that, all you need is the will to take that first step...
Ask not what others can do for you, but what you can do for others.
Thanks given by:
Posts: 1,556
Threads: 77
Joined: May 2011
Well, I would like to help, but you didn't give us much info. A snippet of the codes you've copied and edited would do. Also, this (clicky) might help.
Thanks given by:
Posts: 1,018
Threads: 60
Joined: Mar 2008
05-20-2014, 06:11 PM
(This post was last modified: 05-20-2014, 06:11 PM by Boop.)
You probably jumped back/from the wrong place. Look at how the DLL framework does it. Replacing long jumps with short jumps changes nothing.
10 ʏᴇᴀʀs sɪɴᴄᴇ ɪʀᴄ ɢᴏᴏᴅ.ɪ ᴡᴀʟᴋ ᴛʜʀᴏᴜɢʜ ᴛʜᴇ ᴇᴍᴘᴛʏ sᴛʀᴇᴇᴛs ᴛʀʏɪɴɢ ᴛᴏ ᴛʜɪɴᴋ ᴏғ sᴏᴍᴇᴛʜɪɴɢ ᴇʟsᴇ ʙᴜᴛ ᴍʏ ᴘᴀᴛʜ ᴀʟᴡᴀʏs ʟᴇᴀᴅs ᴛᴏ ᴛʜᴇ ɪʀᴄ. ɪ sᴛᴀʀᴇ ᴀᴛ ᴛʜᴇ sᴄʀᴇᴇɴ ғᴏʀ ʜᴏᴜʀs ᴀɴᴅ ᴛʀʏ ᴛᴏ sᴜᴍᴍᴏɴ ᴛʜᴇ ɢᴏᴏᴅ ɪʀᴄ. ɪ ᴡᴀᴛᴄʜ ᴏᴛʜᴇʀ ɪʀᴄ ᴄʜᴀɴɴᴇʟs ʙᴜᴛ ɪᴛ ɪs ɴᴏ ɢᴏᴏᴅ. ɪ ᴘᴇsᴛᴇʀ ᴢᴏʀᴛ ᴀɴᴅ ᴛʀʏ ᴛᴏ ʀᴇsɪsᴛ ʜɪs sᴇxɪɴᴇss ʙᴜᴛ ɪᴛ ɪs ᴀʟʟ ᴍᴇᴀɴɪɴɢʟᴇss. ᴛʜᴇ ᴇɴᴅ ɪs ɴᴇᴀʀ.ɪ ᴛʜᴇɴ ᴜsᴜᴀʟʟʏ ʀᴇᴀᴅ sᴏᴍᴇ ᴏʟᴅ ɪʀᴄ ʟᴏɢs ᴀɴᴅ ᴄʀʏ ᴍʏsᴇʟғ ᴛᴏ sʟᴇᴇᴘ.
Thanks given by:
Posts: 233
Threads: 13
Joined: Oct 2008
05-20-2014, 06:22 PM
(This post was last modified: 05-20-2014, 06:59 PM by Dragon5.)
Remake's EXE is offset by a few places, so pay no mind to that. Also I don't know how to make the armor sound change.
As I said, the main difference between the two codes is that I had to replace Jump short with a regular jump. Maybe I'm using the wrong jumps?
The jump to the first armor character is in Louis's code.
Louis's Armor code
0042E6EC 83F9 06 CMP ECX,6
0042E6EF 0F85 1B7C0100 JNZ armor2.00446310 // This and the one below are the only addresses adjusted to jump to the proper code. My mistake
0042E6F5 8B84BE 94010000 MOV EAX,DWORD PTR DS:[ESI+EDI*4+194]
0042E6FC 83B8 B8000000 06 CMP DWORD PTR DS:[EAX+B8],6
0042E703 0F8F 077C0100 JG armor2.00446310
0042E709 8B4C24 0C MOV ECX,DWORD PTR SS:[ESP+C]
0042E70D 8B49 2C MOV ECX,DWORD PTR DS:[ECX+2C]
0042E710 B8 67666666 MOV EAX,66666667
0042E715 F7E9 IMUL ECX
0042E717 C1FA 02 SAR EDX,2
0042E71A 8BC2 MOV EAX,EDX
0042E71C C1E8 1F SHR EAX,1F
0042E71F 03C2 ADD EAX,EDX
0042E721 83F8 02 CMP EAX,2
0042E724 0F84 A4000000 JE armor2.0042E7CE
0042E72A 83F8 03 CMP EAX,3
0042E72D 0F84 9B000000 JE armor2.0042E7CE
0042E733 83F9 02 CMP ECX,2
0042E736 0F84 92000000 JE armor2.0042E7CE
0042E73C 83F9 03 CMP ECX,3
0042E73F 0F84 89000000 JE armor2.0042E7CE
First new armor character
00446310 83F9 56 CMP ECX,56
00446313 0F85 F3000000 JNZ armor2.0044640C
00446319 8B84BE 94010000 MOV EAX,DWORD PTR DS:[ESI+EDI*4+194]
00446320 83B8 B8000000 04 CMP DWORD PTR DS:[EAX+B8],4
00446327 0F8F DF000000 JG armor2.0044640C
0044632D 8B4C24 0C MOV ECX,DWORD PTR SS:[ESP+C]
00446331 8B49 2C MOV ECX,DWORD PTR DS:[ECX+2C]
00446334 B8 67666666 MOV EAX,66666667
00446339 F7E9 IMUL ECX
0044633B C1FA 02 SAR EDX,2
0044633E 8BC2 MOV EAX,EDX
00446340 C1E8 1F SHR EAX,1F
00446343 03C2 ADD EAX,EDX
00446345 83F8 02 CMP EAX,2
00446348 0F84 BE000000 JE armor2.0044640C
0044634E 83F8 03 CMP EAX,3
00446351 0F84 B5000000 JE armor2.0044640C
00446357 83F9 02 CMP ECX,2
0044635A 0F84 AC000000 JE armor2.0044640C
00446360 83F9 03 CMP ECX,3
00446363 0F84 A3000000 JE armor2.0044640C
00446369 8B849E 94010000 MOV EAX,DWORD PTR DS:[ESI+EBX*4+194]
00446370 8B90 68030000 MOV EDX,DWORD PTR DS:[EAX+368]
00446376 8B82 F4060000 MOV EAX,DWORD PTR DS:[EDX+6F4]
0044637C 3D D6000000 CMP EAX,0D6
00446381 0F84 85000000 JE armor2.0044640C
00446387 3D D0000000 CMP EAX,0D0
0044638C 74 7E JE SHORT armor2.0044640C
Second new armor character
0044640C 83F9 0C CMP ECX,0C
0044640F ^0F85 B983FEFF JNZ armor2.0042E7CE
00446415 8B84BE 94010000 MOV EAX,DWORD PTR DS:[ESI+EDI*4+194]
0044641C 83B8 B8000000 03 CMP DWORD PTR DS:[EAX+B8],3
00446423 ^0F8F A583FEFF JG armor2.0042E7CE
00446429 8B4C24 0C MOV ECX,DWORD PTR SS:[ESP+C]
0044642D 8B49 2C MOV ECX,DWORD PTR DS:[ECX+2C]
00446430 B8 67666666 MOV EAX,66666667
00446435 F7E9 IMUL ECX
00446437 C1FA 02 SAR EDX,2
0044643A 8BC2 MOV EAX,EDX
0044643C C1E8 1F SHR EAX,1F
0044643F 03C2 ADD EAX,EDX
00446441 83F8 02 CMP EAX,2
00446444 ^0F84 8483FEFF JE armor2.0042E7CE
0044644A 83F8 03 CMP EAX,3
0044644D ^0F84 7B83FEFF JE armor2.0042E7CE
00446453 83F9 02 CMP ECX,2
00446456 ^0F84 7283FEFF JE armor2.0042E7CE
0044645C 83F9 03 CMP ECX,3
0044645F ^0F84 6983FEFF JE armor2.0042E7CE
00446465 8B849E 94010000 MOV EAX,DWORD PTR DS:[ESI+EBX*4+194]
0044646C 8B90 68030000 MOV EDX,DWORD PTR DS:[EAX+368]
00446472 8B82 F4060000 MOV EAX,DWORD PTR DS:[EDX+6F4]
00446478 3D D6000000 CMP EAX,0D6
0044647D ^0F84 4B83FEFF JE armor2.0042E7CE
00446483 3D D0000000 CMP EAX,0D0
00446488 ^0F84 4083FEFF JE armor2.0042E7CE
I realized I only jumped two of the lines to the new code, but when I tried to fixed that the extra bits ruined part of the code. Fixing the parts I could made the game crash for some reason.
EDIT 2:Well, turns out this code makes the game crash with my second character. Back to square one then I'll update.
To live a life of power, you must have faith that what you believe is right, even if others tell you you're wrong.
The first thing you must do to live a life of power is to find courage. You must reach beyond the boundaries of time itself.
And to do that, all you need is the will to take that first step...
Ask not what others can do for you, but what you can do for others.
Thanks given by:
Posts: 1,018
Threads: 60
Joined: Mar 2008
Remake as in http://ztage.com/forum/viewtopic.php?f=10&t=13548 that?
I'm pretty sure that lets you program your own armours in the dat files.
Also I can't what you copy pasted, so painful :P
10 ʏᴇᴀʀs sɪɴᴄᴇ ɪʀᴄ ɢᴏᴏᴅ.ɪ ᴡᴀʟᴋ ᴛʜʀᴏᴜɢʜ ᴛʜᴇ ᴇᴍᴘᴛʏ sᴛʀᴇᴇᴛs ᴛʀʏɪɴɢ ᴛᴏ ᴛʜɪɴᴋ ᴏғ sᴏᴍᴇᴛʜɪɴɢ ᴇʟsᴇ ʙᴜᴛ ᴍʏ ᴘᴀᴛʜ ᴀʟᴡᴀʏs ʟᴇᴀᴅs ᴛᴏ ᴛʜᴇ ɪʀᴄ. ɪ sᴛᴀʀᴇ ᴀᴛ ᴛʜᴇ sᴄʀᴇᴇɴ ғᴏʀ ʜᴏᴜʀs ᴀɴᴅ ᴛʀʏ ᴛᴏ sᴜᴍᴍᴏɴ ᴛʜᴇ ɢᴏᴏᴅ ɪʀᴄ. ɪ ᴡᴀᴛᴄʜ ᴏᴛʜᴇʀ ɪʀᴄ ᴄʜᴀɴɴᴇʟs ʙᴜᴛ ɪᴛ ɪs ɴᴏ ɢᴏᴏᴅ. ɪ ᴘᴇsᴛᴇʀ ᴢᴏʀᴛ ᴀɴᴅ ᴛʀʏ ᴛᴏ ʀᴇsɪsᴛ ʜɪs sᴇxɪɴᴇss ʙᴜᴛ ɪᴛ ɪs ᴀʟʟ ᴍᴇᴀɴɪɴɢʟᴇss. ᴛʜᴇ ᴇɴᴅ ɪs ɴᴇᴀʀ.ɪ ᴛʜᴇɴ ᴜsᴜᴀʟʟʏ ʀᴇᴀᴅ sᴏᴍᴇ ᴏʟᴅ ɪʀᴄ ʟᴏɢs ᴀɴᴅ ᴄʀʏ ᴍʏsᴇʟғ ᴛᴏ sʟᴇᴇᴘ.
Thanks given by:
Posts: 233
Threads: 13
Joined: Oct 2008
05-20-2014, 06:33 PM
(This post was last modified: 05-20-2014, 07:02 PM by Dragon5.)
Remake as in my mod. I'll highlight the jumps to make things a little more clear.
Edit: I tried that, and while it is so much easier to code things there I decided not to use it as custom AI wasn't supported.
Edit 2: Code is faulty now for some reason. Redoing.
To live a life of power, you must have faith that what you believe is right, even if others tell you you're wrong.
The first thing you must do to live a life of power is to find courage. You must reach beyond the boundaries of time itself.
And to do that, all you need is the will to take that first step...
Ask not what others can do for you, but what you can do for others.
Thanks given by:
Posts: 1,556
Threads: 77
Joined: May 2011
05-24-2014, 05:54 PM
(This post was last modified: 05-24-2014, 05:55 PM by A-Man.)
Dude.. The code you posted is extremely messed up. I don't really get what are you trying to do ?_? Plus I don't think "cmp dword ptr ds:[ecx+edx+7AC],5" does have anything to do with the armor strength (against normal hits at least). It is actually this line: "CMP DWORD PTR DS:[EAX+B8],4" which does it (+B8 stores the defending points according to the spreadsheet). I also noticed that right after you jumped to your new armor stuff, you CMPed with 56 (?). If you actually meant id 56, then you should make sure you convert it into base-16 first (in this case, it would be 0x38).
Can you tell me what are you trying to do exactly? Are you trying to give Julian Louis's armor or what exactly?
Thanks given by:
Posts: 233
Threads: 13
Joined: Oct 2008
What I'm trying to do is clone Louis's armor other characters can use it while having slightly different properties.
I deleted Julian's armor to make room to redirect all the jumps to new code properly. The problem I'm running into is that the characters with the new armor have armor all-around for some reason pretty much just like Julian's. By that, I mean it works pretty much like Julian's armor even though I copied Louis. The armor does not protect against Henry's Arrow, Julian's ball, Fire, Ice, etc. as the code says. The code that is supposed to grant him protection in certain states only is pretty much useless because the armor is applied for all states.
56 is intentional as it's the id for 86; I know hexadecimal, mind you. It's just a temporary number as I want to separate characters.
To live a life of power, you must have faith that what you believe is right, even if others tell you you're wrong.
The first thing you must do to live a life of power is to find courage. You must reach beyond the boundaries of time itself.
And to do that, all you need is the will to take that first step...
Ask not what others can do for you, but what you can do for others.
Thanks given by:
Posts: 1,018
Threads: 60
Joined: Mar 2008
If you just want to copy louis armour don't need to copy the entire thing. Just replace the CMP which compares the ID with a JMP to multiple CMPs and JE's and a final JMP back. This is how the DLL system does it.
If you want to make custom armour then yeah, you would need to copy all the logic. I'm still too lazy to look through the code. If you upload the exe I might take a look at some point (not promising anything).
10 ʏᴇᴀʀs sɪɴᴄᴇ ɪʀᴄ ɢᴏᴏᴅ.ɪ ᴡᴀʟᴋ ᴛʜʀᴏᴜɢʜ ᴛʜᴇ ᴇᴍᴘᴛʏ sᴛʀᴇᴇᴛs ᴛʀʏɪɴɢ ᴛᴏ ᴛʜɪɴᴋ ᴏғ sᴏᴍᴇᴛʜɪɴɢ ᴇʟsᴇ ʙᴜᴛ ᴍʏ ᴘᴀᴛʜ ᴀʟᴡᴀʏs ʟᴇᴀᴅs ᴛᴏ ᴛʜᴇ ɪʀᴄ. ɪ sᴛᴀʀᴇ ᴀᴛ ᴛʜᴇ sᴄʀᴇᴇɴ ғᴏʀ ʜᴏᴜʀs ᴀɴᴅ ᴛʀʏ ᴛᴏ sᴜᴍᴍᴏɴ ᴛʜᴇ ɢᴏᴏᴅ ɪʀᴄ. ɪ ᴡᴀᴛᴄʜ ᴏᴛʜᴇʀ ɪʀᴄ ᴄʜᴀɴɴᴇʟs ʙᴜᴛ ɪᴛ ɪs ɴᴏ ɢᴏᴏᴅ. ɪ ᴘᴇsᴛᴇʀ ᴢᴏʀᴛ ᴀɴᴅ ᴛʀʏ ᴛᴏ ʀᴇsɪsᴛ ʜɪs sᴇxɪɴᴇss ʙᴜᴛ ɪᴛ ɪs ᴀʟʟ ᴍᴇᴀɴɪɴɢʟᴇss. ᴛʜᴇ ᴇɴᴅ ɪs ɴᴇᴀʀ.ɪ ᴛʜᴇɴ ᴜsᴜᴀʟʟʏ ʀᴇᴀᴅ sᴏᴍᴇ ᴏʟᴅ ɪʀᴄ ʟᴏɢs ᴀɴᴅ ᴄʀʏ ᴍʏsᴇʟғ ᴛᴏ sʟᴇᴇᴘ.
Thanks given by:
|