Post Reply 
 
Thread Rating:
  • 6 Votes - 4.17 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Monster Hunter Freedom Unite [USA]
05-07-2021, 02:10 AM
Post: #117
RE: Monster Hunter Freedom Unite [USA]
(05-04-2021 01:47 AM)maunisphiehouse Wrote:  Does anyone know how to edit

_C0 Max Cat Attack
_L 0x112039A6 0x00004725
_C0 Max Cat Defense
_L 0x112039AA 0x00004725

to not add 42240 to the stat, and something more tame like 200 or something?

TL;DR: Here you go!
Code:
_C0 Cat Attack 200
_L 0x212039A4 0x43480000
_C0 Cat Defense 200
_L 0x212039A8 0x43480000





Oh gods, I spent so much time trying to detangle this with trial and error and it suddenly dawned on me what kind of data I as looking at x__x The original code is essentially modifying the exponent and top byte of the significand of a binary32 float (obviously! jk, I've been working on a large library of software floats for the Z80 and I just finished up the binary32 routines so it is fresh in my mind).

So with that knowledge: step 1, let's edit the full 4 bytes
_C0 Max Cat Attack
_L 0x212039A4 0x47250000
_C0 Max Cat Defense
_L 0x212039A8 0x47250000

Now go to your favorite online binary32 ==> hex float converter (there are many online) and type in "200". You ought to see a hex string like: '0x43480000'

So now modify your cheats:
Code:
_C0 Max Cat Attack
_L 0x212039A4 0x43480000
_C0 Max Cat Defense
_L 0x212039A8 0x43480000

And ta-da, you are now setting your cat's Attack and Defense to 200!
I also appreciate this code as that 42240 number is obscene. Thanks for motivating me to delve into this cheat!

For the adventurous, here is a short Python script to generate your very own Cat Attack and Cat Defense cheats:
Code:
import struct

def float2hex(x):
    # Magic using the built-in struct library
    return hex(struct.unpack('<l', struct.pack('<f', float(x)))[0])

def cat(attack, defense):
    print("_C0 Cat Attack {}".format(attack))
    print("_L 0x212039A4 {}".format(float2hex(attack)))
    print("_C0 Cat Defense {}".format(defense))
    print("_L 0x212039A8 {}".format(float2hex(defense)))
And then all you have to do is call it like:
Code:
cat(attack=200, defense=1337)
And it will print:
Code:
_C0 Cat Attack 200
_L 0x212039A4 0x43480000
_C0 Cat Defense 1337
_L 0x212039A8 0x44a72000

I hope this all helps!
Here are a few extra variants:
Code:
_C0 Cat Attack 100
_L 0x212039A4 0x42c80000
_C0 Cat Defense 100
_L 0x212039A8 0x42c80000

_C0 Cat Attack 1000
_L 0x212039A4 0x447a0000
_C0 Cat Defense 1000
_L 0x212039A8 0x447a0000

_C0 Cat Attack 9001
_L 0x212039A4 0x460ca400
_C0 Cat Defense 9001
_L 0x212039A8 0x460ca400
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Monster Hunter Freedom Unite [USA] - aki21 - 07-26-2013, 04:46 AM
RE: Monster Hunter Freedom Unite [USA] - ZedaZ80 - 05-07-2021 02:10 AM

Forum Jump: