Weapon Hacking

Mar 18, 2009 at 12:47 AM
Been here way too long...
"Life begins and ends with Nu."
Join Date: Jan 4, 2008
Location: Lingerie, but also, like, fancy curtains
Posts: 3054
just a quick note, if you set 55 to larger than eighty, the direction is reversed for reasons I am too lazy to comprehend.
 
Mar 18, 2009 at 1:05 AM
Been here way too long...
"Ha! Ha! Ha! Mega Man is no match for my Mimiga Man!"
Join Date: Jun 22, 2008
Location:
Posts: 251
Lace said:
just a quick note, if you set 55 to larger than eighty, the direction is reversed for reasons I am too lazy to comprehend.

Lol. No wonder setting it to FF didn't work :( Mabey its numeric overflow? When I have more time I'll see if I can try doing something with breakpoints. Now that I'm finally figuring out OllyDbg its a pretty cool program.
 
Mar 18, 2009 at 5:00 AM
In front of a computer
"Man, if only I had an apple..."
Join Date: Mar 1, 2008
Location: Grasstown
Posts: 1435
Let's see... 80 hex would be 128 decimal... so it's probably a signed char value?
 
Mar 18, 2009 at 4:15 PM
graters gonna grate
"Heavy swords for sale. Suitable for most RPG Protagonists. Apply now!"
Join Date: Jul 2, 2008
Location: &
Posts: 1886
Age: 31
That would be my guess.
 
Mar 24, 2009 at 5:29 AM
Been here way too long...
"Ha! Ha! Ha! Mega Man is no match for my Mimiga Man!"
Join Date: Jun 22, 2008
Location:
Posts: 251
Does anyone know why the Missiles and Missile Launcher have separate entries? And same with Super Missiles/Super Missile Launcher. And if I want to change the data for the missiles, what do I change?

If no one knows, I'll test it myself, but I won't have time tonight, so I figured I would put this out there.
 
Mar 24, 2009 at 4:14 PM
graters gonna grate
"Heavy swords for sale. Suitable for most RPG Protagonists. Apply now!"
Join Date: Jul 2, 2008
Location: &
Posts: 1886
Age: 31
I think changing the code for missiles/super missiles has no effect on gameplay, only changing the code for the launchers. The only purpose of having the missile weapons and not just the launcher weapons is so that you can use <GIT to show missiles rather than launchers.
 
Apr 2, 2009 at 6:23 AM
Been here way too long...
"Ha! Ha! Ha! Mega Man is no match for my Mimiga Man!"
Join Date: Jun 22, 2008
Location:
Posts: 251
Code:
Assembly offsets for weapon behavior:

0x04160 - Snake level 1
0x043F0 - Snake level 2/3

0x047B0 - Polar Star (all levels)

0x04B30 - Fireball (all levels)

0x05120 - Machinegun (all levels)

0x055A0 - Missile Launcher (all levels)

0x05F30 - Bubbler level 1
0x09190 - Bubbler level 2
0x064D0 - Bubbler level 3

0x068B0 - Bubbler level 3 shot
0x075E0 - Blade level 3 slash
0x078A0 - [unused]

0x06BB0 - Blade level 1
0x06E60 - Blade level 2
0x07110 - Blade level 3

0x07910 - Super Missile Launcher (all levels)

0x08230 - Nemesis (all levels)

0x08710 - Chargeless spur (all levels)

0x08AE0 - Non moving spur (all levels)

0x08230 - Spur level 1
0x08F40 - Spur level 2
0x08F90 - Spur level 3

I don't know why I'm posting this, since if you can edit assembly, you can probably figure it out yourself easily enough, but these are the actual offsets for weapon behavior in assembly. The ones giga posted were entirely wrong. Also the spur is messed up and I'm not entirely sure whats going on in there.
 
Apr 8, 2009 at 12:03 AM
Been here way too long...
"Ha! Ha! Ha! Mega Man is no match for my Mimiga Man!"
Join Date: Jun 22, 2008
Location:
Posts: 251
I've been trying to figure out a way to change a bullet location as soon as it is shot and then never move the bullet regularly, does anyone know a way I can do that? I was thinking mabey having a variable that starts at 0 and then is compared with, and if the variable is one, I do the stuff I need to and then change the variable, that way the function will never be called again. But, I don't know where I can initialize the variable to 0 where it won't be changed back to 0 every time the physics of the weapon is done.

Or mabey there is an existing process I can hijack? Or something even simpler than that?
 
Apr 30, 2009 at 5:12 AM
Been here way too long...
"Ha! Ha! Ha! Mega Man is no match for my Mimiga Man!"
Join Date: Jun 22, 2008
Location:
Posts: 251
has anyone ever tried to make the blade go through walls? The flags in the clean .exe are exactly the same as the ones from the snake, so logically it should, but it doesn't. I've tries various combinations of changing the two relevant flags, but nothing worked. Has anyone else tried this? With or without success?
 
May 2, 2009 at 4:15 AM
Been here way too long...
"Ha! Ha! Ha! Mega Man is no match for my Mimiga Man!"
Join Date: Jun 22, 2008
Location:
Posts: 251
I GOT A QUESTION!!!!!

Just kidding. Since I'm quintuple posting, I'll share something useful I found: Its possible to mix and match weapons, so that, say, level one of a weapon is the nemesis, level 2 is the blade, and level 3 is the bubbler. Here is how:

Open up your executable in your favorite disassembler and go to offset 0x409052 you will see about 45 calls to different functions. Some of the calls have one parameter, if so they are a unique weapon with only one level. (like the bubbler is actually 3 different weapons coded into the game, with the levels of one weapon each calling a different bit of code) and some of the function have 2 parameters, in which case the constant parameter is the level of the weapon.

What use is that to you?

Well, if you change the function that is called, then shooting the gun that would normally call that function will call the function for a different gun. So change the CALL to a different function, and you will have a mix 'n match weapon!

EXAMPLE TIME
Code:
PUSH 1                                  ; /Arg2 = 00000001
MOV EAX,[EBP-4]
SHL EAX,7                               ; |
ADD EAX,Doukutsu.00499C98               ; |
PUSH EAX                                ; |Arg1
CALL Doukutsu.00405120                  ; \Machinegun
ADD ESP,8
JMP Doukutsu.004094F8
PUSH 2                                  ; /Arg2 = 00000002
MOV ECX,[EBP-4]
SHL ECX,7                               ; |
ADD ECX,Doukutsu.00499C98               ; |
PUSH ECX                                ; |Arg1
CALL Doukutsu.00405120                  ; note 1
ADD ESP,8
JMP Doukutsu.004094F8
PUSH 3                                  ; /Arg2 = 00000003
MOV EDX,[EBP-4]
SHL EDX,7                               ; |
ADD EDX,Doukutsu.00499C98               ; |
PUSH EDX                                ; |Arg1
CaLL Doukutsu.00405120                  ; \Machinegun

This is the code that handles the machine gun. So lets say you wanted to have a machine gun/missile launcher/snake hybrid.

You would look in the list of weapon functions I posted earlier to find what the function is for the blade level 2 missile launcher, go to the bit of code I've commented as note 1 and change it from CALL 405120 to CALL what ever function you found in the the list. (note - the list I posted has all the weapons in order, so just look for the line saying CALL (the function of the weapon you want to change) )

Now do the same for the snake LV3 and voila! You have a hybrid weapon.


NOTE! Some combination do unexpected things and some don't work at all. For example mixing the missiles with something else just causes a bunch of explosions around you, and mixing the machine gun with the blade gets you a rapid fire blade. (Reminds me of a game me and brother played when we were kids - this is a gun, but instead of shooting bullets, it shoots NIVES. That would beat your gun that shoots more guns any day.) Also we didn't know how to spell knives back then.
 
May 2, 2009 at 5:58 AM
Senior Member
"Master using it, and you can have this!"
Join Date: Apr 12, 2009
Location:
Posts: 70
That's really cool O.O Now if you find a way to make a weapon do Damage over Time you can have a Poison Dart Gun xP
 
May 2, 2009 at 3:23 PM
Been here way too long...
"Life begins and ends with Nu."
Join Date: Jan 4, 2008
Location: Lingerie, but also, like, fancy curtains
Posts: 3054
similarily, you could use that method to make the nemmy act like a normal weapon, but where's the fun in that, eh? =P

also, level three blade spawns two types of bullets, the slashes and king, so you could utilize this to make it shoot something else, say, a missile and super missile at once.

anyway, nice find/tutorial dooey.
 
May 2, 2009 at 5:40 PM
Been here way too long...
"Life begins and ends with Nu."
Join Date: Jan 4, 2008
Location: Lingerie, but also, like, fancy curtains
Posts: 3054
that would be soooooooo cool. [/loopy]
=P
 
May 2, 2009 at 5:42 PM
Been here way too long...
"Life begins and ends with Nu."
Join Date: Jan 4, 2008
Location: Lingerie, but also, like, fancy curtains
Posts: 3054
That's really cool O.O Now if you find a way to make a weapon do Damage over Time you can have a Poison Dart Gun xP
actually, dot would be really cool to work on, though it would take forever to implement.
 
May 6, 2009 at 11:03 AM
Hax on....Hax off....
"Big Joe Tire and Battery Restaurant! Opening Soon! Eat at Big Joes!"
Join Date: Jan 5, 2009
Location: Easter Island
Posts: 476
Okay here's a little problem I have.
because I'm rather clueless about assembly I've decided I'll have to make do with editing weapons with just the hex editor. I'm making a blade that doesn't do much damage but it just pierces through everything making it do more damage to bosses and large enemies and such. So to make the level two blade effective I made the range slightly longer than level 1 but that kinda makes it worse than before cause when you shoot at something it'll pierce through and fly off so you'll have to wait for a while before you can fire again so i wanna make the limit of shots 2 or maybe 3 but in what I'm pretty certain is the most recent version of the faq it doesn't have the limit of shots for any level blade so I'm just wondering does anyone know where to find the offsets? If not, can anyone tell me how people find offsets for everything in the exe? I don't really understand how anyone can find the hex offsets cause the various numbers don't make much sense.
Thanks
 
May 6, 2009 at 6:04 PM
Been here way too long...
"Ha! Ha! Ha! Mega Man is no match for my Mimiga Man!"
Join Date: Jun 22, 2008
Location:
Posts: 251
Read the whole thread, and will see a post by cookie explaining it. Editing max shots for the blade is a bit harder than editing max shots for other weapons, but it is possible.

To find offsets pretty much requires use of assembly, because you can look at the code and see what each thing is actually doing. Yeah just looking at the various numbers doesn't make much sense, but once you disassemble it its less confusing.
 
May 6, 2009 at 8:40 PM
Been here way too long...
"Life begins and ends with Nu."
Join Date: Jan 4, 2008
Location: Lingerie, but also, like, fancy curtains
Posts: 3054
real men can translate hex into assembly in their heads.
=P
 
May 6, 2009 at 8:43 PM
Cold Agony of Resolute Vacuum
"Heavy swords for sale. Suitable for most RPG Protagonists. Apply now!"
Join Date: Jan 1, 2008
Location: Elsewhere
Posts: 1973
Lace said:
real men can translate hex into assembly in their heads.
=P

Actually, real men don't spend 8 hours a day in front of a compter pouring over endless values between 00 and FF and trying to comprehend the meaning.

Real men lift boxes onto shelves.
And get paid to do it.
 
Top