Weapon Hacking

Dec 12, 2007 at 1:25 PM
Senior Member
"Master using it, and you can have this!"
Join Date: Nov 28, 2007
Location:
Posts: 86
S. P. Gardebiter said:
Still Super Missile Launcher level 1 and Blade missing ;P
You can't change those that easily, let me explain why: the missile launcher subroutine (this is both normal and super) does a object check to see how many missiles there are on the screen:

Pseudocode for super missile launcher lv3:
Code:
obj_supermissile = 0xa
[b]if[/b] (get_number_of_objects(obj_supermissile) <= 3) 
  [i]shoot()[/i]
In x86 assembly, the last test becomes:
Code:
cmp eax, 3
jle shoot
Where eax is filled with the number of missiles on the screen.
In other words, lv3 permits 4 missiles on the screen.
lv2 is exactly the same, but 3 is replaced with 1, so you can have 2 missiles on the screen.

lv1 is special, it only allows one missile on the screen, but here the compiler has not used a comparison (cmp) to check if the value of get_number_of_objects() was less than or equal to one, it has instead used a simpler check to determine if the return value was zero or not; in x86 assembly this becomes:
Code:
test eax, eax
jz shoot
The problem with this is that while a cmp eax, 3 takes three bytes of machine code, a test eax, eax takes only two bytes, so we can't easily change the test to a cmp without enlarging the executable (and making it unusable) or find space somewhere else and make our own missile function (or part of it).

edit: I found another way, look at my next post

The blade function is even worse, it is designed with only one blade in mind and the number of blades on the screen can't be changed without rewriting it, even if one changes the current function, the blade would just disappear and respawn (or warp) beside quote.
I couldn't be more wrong... I was looking at the bullet code instead of the weapon code and assumed the blade didn't behave like a weapon :)
 
Dec 12, 2007 at 1:39 PM
Hoxtilicious
"Life begins and ends with Nu."
Join Date: Dec 30, 2005
Location: Germany
Posts: 3218
Age: 32
Whats the level 1 offset? :D

Also is there a function to edit asm code and save it in HT? :rolleyes:
 
Dec 12, 2007 at 1:51 PM
Senior Member
"Master using it, and you can have this!"
Join Date: Nov 28, 2007
Location:
Posts: 86
S. P. Gardebiter said:
Whats the level 1 offset? :o
find it yourself :p

Also is there a function to edit asm code and save it in HT? ;)
ctrl+a (or alt+a, enter), be vary because it will overwrite if the size is larger than the previous instruction
 
Dec 13, 2007 at 12:34 PM
Justin-chan
"Heavy swords for sale. Suitable for most RPG Protagonists. Apply now!"
Join Date: Oct 15, 2007
Location: Nowhere
Posts: 1921
Age: 30
You didn't add this into the FAQ, I posted it on page 5.

0x0C - Rect A1 (X Axis of smoke/explosion)
0x10 - Rect A2 (Y Axis of smoke/explosion)
0x14 - Rect A3 (X Axis probably, smoke effects vanish? Possibility of it hiding behind solid)
0x18 - Rect A4 (Y Axis of smoke effects hide behind solid)
 
Dec 13, 2007 at 2:31 PM
Hoxtilicious
"Life begins and ends with Nu."
Join Date: Dec 30, 2005
Location: Germany
Posts: 3218
Age: 32
Need more information: o.o'

0x14 - Rect A3 (X Axis probably, smoke effects vanish? Possibility of it hiding behind solid)
0x18 - Rect A4 (Y Axis of smoke effects hide behind solid)
 
Dec 13, 2007 at 3:23 PM
Luls
"Bleep, Bloop, Bleep, Bloop"
Join Date: Oct 6, 2007
Location: I dunnos
Posts: 1584
YOu also didn't add the ticks between bullets into the FAQ =P
 
Dec 13, 2007 at 3:57 PM
Hoxtilicious
"Life begins and ends with Nu."
Join Date: Dec 30, 2005
Location: Germany
Posts: 3218
Age: 32
Need more offsets.

I know what to add and what not, you don't have to post it, better find the offsets :D
 
Dec 15, 2007 at 11:17 PM
Senior Member
"Master using it, and you can have this!"
Join Date: Nov 28, 2007
Location:
Posts: 86
Hi again. Here's how to make the blade multi-shot:
First, locate offset 0x41f586, this is the beginning of the blade function:

Code:
0x41f586 [b]push[/b] 9               ; object_blade
0x41f588 [b]call[/b] [i]get_num_obj[/i]     ; get number of objects on the screen
0x41f58d [b]add[/b] esp, 4           ; remove argument object_blade
0x41f590 [b]test[/b] eax, eax        ; eax & eax
0x41f592 [b]jng[/b] [i]shoot[/i]            ; is eax zero? (is there 0 blades on the screen)
; then shoot bullet
Notice how test only ands the result from the function and sets the zero flag and how jng jumps if the zero flag is set (essentially checks if the function returned 0), but we don't want that, we want a proper check on how many blades there are. Lets do something about that test and change it to limit the number of blades to 3:
Code:
0x41f590 [b]cmp[/b] al, 3 ; al contains the last byte of eax
0x41f592 [b]jl[/b] [i]shoot[/i]  ; shoot if there are less than 3 bullets on the screen
In hex this becomes (with file offset):
Code:
0x1f590 0x3c[color=red]03[/color]7c05
You can change the 0x03 to whatever you want, up to 0xff (255 in decimal).
You also do the same with the code for the missile launcher and the super missile launcher; Just follow this example, if you have any trouble with that, just ask.
 
Dec 16, 2007 at 12:38 AM
Luls
"Bleep, Bloop, Bleep, Bloop"
Join Date: Oct 6, 2007
Location: I dunnos
Posts: 1584
cookie said:
Cookie's post was so long =S.

Wow you are amazing! How do you play with random offsets and get these results? You make looking for offsets a piece of cake. ><
 
Dec 16, 2007 at 1:49 AM
Senior Member
"Master using it, and you can have this!"
Join Date: Nov 28, 2007
Location:
Posts: 86
Metalogz said:
Wow you are amazing! How do you play with random offsets and get these results? You make looking for offsets a piece of cake. ><
Well, I am not playing with random offsets ;)
 
Dec 16, 2007 at 3:19 PM
Hoxtilicious
"Life begins and ends with Nu."
Join Date: Dec 30, 2005
Location: Germany
Posts: 3218
Age: 32
Metalogz said:
Wow you are amazing! How do you play with random offsets and get these results? You make looking for offsets a piece of cake. ><

You should have seen Runelancer, it was the same :D Allthough Cookie shares more of his offsets :D

Nice thing you posted there, I found out something too:

Polar Star:

Up - Left:
0x1DEF5 - Direction
0x1DF1D - GFX

Up - Right:
0x1DF41 - Direction
0x1DF6B - GFX

Down - Left:
0x1DFAA - Direction
0x1DFD2 - GFX

Down - Right:
0x1DFF6 - Direction
0x1E01E - GFX

Left:
0x1E04E - Direction
0x1E078 - GFX

Right:
0x1E09E - Direction
0x1E0C6 - GFX

GFX:

0x00 - No animation
0x01 - Blue spreading bubbles
0x02 - Fading out green/white bubble
0x03 - Fading out green/white star
0x04 - Blue rhomb
0x05 - ZZZzzz...
0x06 - Blue rhomb
0x07 - Booster GFX green/white
0x08 - Drowned Quote
0x09 - "?"
0x0A - "Level Up!"
0x0B - Red damage GFX
0x0C - Explosion
0x0D - 'Head bump' stars
0x0E - Glitch
0x0F - Small fading out green/white bubble
0x10 - "Empty"
0x11 - "Push Jump Key!"
0x12 - < CRASH >
0x13 - < CRASH >
0x14 - < CRASH >
0x15 - < UNTESTED >
0x16 - < UNTESTED >
0x17 - < UNTESTED >
0x18 - < UNTESTED >
0x19 - < UNTESTED >
0x1A - < UNTESTED >
0x1B - < UNTESTED >
0x1C - < UNTESTED >
0x1D - < UNTESTED >
0x1E - < UNTESTED >
0x1F - < UNTESTED >

Direction:

0x00 - Left
0x01 - Up
0x02 - Right
0x03 - Down

Enjoy!
 
Dec 17, 2007 at 5:05 AM
Luls
"Bleep, Bloop, Bleep, Bloop"
Join Date: Oct 6, 2007
Location: I dunnos
Posts: 1584
So thats for the bullet GFX? or the Polar star GFX? or the Quote GFX holding the Polar star?

btw awesome.
 
Dec 17, 2007 at 7:15 AM
Senior Member
"Master using it, and you can have this!"
Join Date: Feb 19, 2006
Location:
Posts: 73
Bubbler level 3 is amusing with the Zzz animation and set up to snake through blocks. (although the spawned shots don't phase through as well, which makes it less useful :D)
 
Dec 17, 2007 at 12:43 PM
Hoxtilicious
"Life begins and ends with Nu."
Join Date: Dec 30, 2005
Location: Germany
Posts: 3218
Age: 32
Don't you know what a "GFX" is? :x
You just should test the offsets before asking here :p
 
Dec 17, 2007 at 11:25 PM
Been here way too long...
"The Ultimate Sword of Extraordinary Magnitude"
Join Date: Jun 14, 2006
Location:
Posts: 299
Age: 34
I'm starting Legacy again, and I have an idea in mind in changing the Missle's way of life...
I'll use this thread to document my trials / findings.
 
Dec 18, 2007 at 12:55 AM
Luls
"Bleep, Bloop, Bleep, Bloop"
Join Date: Oct 6, 2007
Location: I dunnos
Posts: 1584
S. P. Gardebiter said:
Don't you know what a "GFX" is? :x
You just should test the offsets before asking here :D

*is thinking you're just trying to piss me off ._.*

lol

Anyway I meant GFX of what. Well I'm guessing its the bullet.

P.S - *has no time to test just yet =S*

EDIT - Wait those are only for the Polar star... o.o

How do you know how to edit the missile launcher then?

Nator teh Nifty dude :p said:
I'm starting Legacy again, and I have an idea in mind in changing the Missle's way of life...
I'll use this thread to document my trials / findings.
 
Dec 18, 2007 at 1:04 PM
Hoxtilicious
"Life begins and ends with Nu."
Join Date: Dec 30, 2005
Location: Germany
Posts: 3218
Age: 32
GraFic EffeX = Graphic Effects

The nifty guy was Doublethink and not Nator by the way.
 
Dec 18, 2007 at 1:16 PM
Luls
"Bleep, Bloop, Bleep, Bloop"
Join Date: Oct 6, 2007
Location: I dunnos
Posts: 1584
S. P. Gardebiter said:
GraFic EffeX = Graphic Effects

The nifty guy was Doublethink and not Nator by the way.

oh I thought GFX = GraFiX lol

oh not Nator o.o
 
Dec 18, 2007 at 1:31 PM
Hoxtilicious
"Life begins and ends with Nu."
Join Date: Dec 30, 2005
Location: Germany
Posts: 3218
Age: 32
Why all the members think Nator is the nifty guy? O_o

Metalogz said:
oh I thought GFX = GraFiX lol

lol thats actually a game name...
 
Dec 19, 2007 at 5:04 AM
Been here way too long...
"The Ultimate Sword of Extraordinary Magnitude"
Join Date: Jun 14, 2006
Location:
Posts: 299
Age: 34
Found out what B-Rects are today, if you guys didn't know already...
www.superficial.tv/MISSLES.html
for the tl;dr:
From this, I gather that
A- Rects are the hitbox data. Size and postion, I gather...

Rect B1 is the -x position when facing left, the +y when facing up.
Rect B2 is the +y position when facing left or right, the -x when facing up or down.
Rect B3 is -x position when facing right, the -y when facing down.
Rect B4 seems like garbage at this point.
(this are all positions of GRAPHICS, not HITBOXES.)
Pixel must have decided mid-project to streamline the graphics creation into 3 variables instead of 4...
 
Top