Golden Sun Hacking Community
May 21, 2018, 10:51:17 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
 
  Home   Forum   DC Wiki Help Search Calendar Downloads Login Register  
Pages: [1] 2   Go Down
  Print  
Author Topic: Problem with the 5% stats patch  (Read 1875 times)
0 Members and 1 Guest are viewing this topic.

Novice Member
*

Coins: 1
Offline Offline

Posts: 33

« on: June 01, 2017, 09:53:23 PM »

I mentioned this before in the cbox but I figured that a topic would be better for it.

I applied the 5% stat patch to a fresh Golden Sun TLA (U) rom, however as shown in the pictures below it did not work out like it was supposed to.


* 5% patches.jpg (264.77 KB, 1533x384 - viewed 106 times.)

* gs2hack_11.png (7.12 KB, 240x160 - viewed 129 times.)

* gs2hack_12.png (7.67 KB, 240x160 - viewed 88 times.)
Logged
View Profile
Salanewt
His Sexiness
Mercury Clan

Oh yeah, baby!

Prodigy
*

Coins: 32
Offline Offline

I am: A part of the organization of Cool Cats, but more of a dog person in reality.
Emblems: Have a nice day.
Posts: 4566

« Reply #1 on: June 01, 2017, 09:59:09 PM »

Out of curiosity, have you had any luck with other patches? I figure that would be a good, quick way to figure out whether the patch messed things up or if there is something off with your ROM.

Logged

Oh yeah baby, £ me harder.

Fusion is just a cheap tactic to make weak Adepts stronger.

Yoshi's Lighthouse is a hacking website in progress. Why not check it out if you like Yoshi or the Mario & Luigi games?
View Profile WWW
Fox
Fox McCloud, the Hacking Doctor
Mercury Clan

Prodigy
*

Coins: 28
Offline Offline

I am: certainly not a Gallant!
Clan Position: Head Gallant
Posts: 2411

« Reply #2 on: June 01, 2017, 11:05:00 PM »

Squire looks fine.... (Since the percents in Atrius's editor do not take the code modification into consideration when determining what to display.)
Knight and Gallant??? Look off...


Might have also been useful to post screenshots of VBA>Tools>Memory viewer ... at address locations of:
0x080000A0 (To verify file version.)
0x080C15F4 (To verify if class data was here - Atrius's editor is compatible with more ROM versions than the 5% Patcher, since I only did the 5% Patcher with one version in mind.)

And to possibly go to VBA>Tools>Disassemble... with a screenshot at address 0x080AD768 (To verify if the percentage code stuff is here properly in your ROM.)



I would test it again to make sure... but I'm getting an error at the moment/little lazy...
Quote
ImportError: No module named tkinter
« Last Edit: June 01, 2017, 11:52:52 PM by Fox » Logged

Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Remember kids! Before you go on that interview, remember to wash your hands in teawater! *Coughs on hand* (Excuse me, I just coughed up a little teawater, so they're still clean!) You wouldn't want that hiring manager to be unimpressed.

May the force be with you!
Shoo! Why does it smell in here?
Maybe that's the wrong kind of force. *smirk*
View Profile

Novice Member
*

Coins: 1
Offline Offline

Posts: 33

« Reply #3 on: June 02, 2017, 12:21:33 AM »

This is what it looks like at the offsets. Also, I've used a copy of this rom before to patch stuff like the Reloaded patch and the Intellect patch and they've worked just fine so I don't think anything's wrong with my rom.

Also, I did have to change the first line to Tkinter import * #GUI stuff and comment out this one f = open(filedialog.askopenfilename(), 'r+b') in order to get it to patch.


* Memory Viewer.jpg (287.51 KB, 1392x658 - viewed 95 times.)
Logged
View Profile
Salanewt
His Sexiness
Mercury Clan

Oh yeah, baby!

Prodigy
*

Coins: 32
Offline Offline

I am: A part of the organization of Cool Cats, but more of a dog person in reality.
Emblems: Have a nice day.
Posts: 4566

« Reply #4 on: June 02, 2017, 01:17:37 AM »

I haven't checked through the patch/code yet, but wouldn't it be easier to just divide by 20 rather than 10? It almost looks like there is either an error in that patch or some weird workaround.

Edit: If you replace all six "325B" intructions with "2114" then you might be able to fix it. Assuming nothing else has really been changed!
« Last Edit: June 02, 2017, 01:20:05 AM by Lord Squirtle » Logged

Oh yeah baby, £ me harder.

Fusion is just a cheap tactic to make weak Adepts stronger.

Yoshi's Lighthouse is a hacking website in progress. Why not check it out if you like Yoshi or the Mario & Luigi games?
View Profile WWW
Fox
Fox McCloud, the Hacking Doctor
Mercury Clan

Prodigy
*

Coins: 28
Offline Offline

I am: certainly not a Gallant!
Clan Position: Head Gallant
Posts: 2411

« Reply #5 on: June 02, 2017, 04:19:10 AM »

EDIT:(Putting this at the top since it could maybe be the answer/not sure, though... so proceed with caution.)

OH!!!
Quote
Tkinter has been renamed to tkinter in Python 3.
Maybe I look into seeing if Python 3 works... Since my last test was with Python 2.7... xP
There are a bunch of differences between both, that it is probably better to use the Python that the code was made for before adapting it to a different version of Python... probably.

If this is it(?), then the rest of the post can be ignored.

How is it putting in 0x325B everywhere? o.O
So all 0x0A's become 0x5B's? ... when they're supposed to become 0x14's...
... Hmmm.... And the next instruction afterwards for each is messed up? - Attached image compares yours against an unmodified ROM.
It's possible the numbers could be stored in some 32-bit format when I intended an 8-bit format.... / Maybe some type of float or fixed point, I dunno... ??

@Salanewt: Dividing by 20 is exactly what the patch is supposed to put in.  The code originally looks like this (So you can see it is pretty simple.):

Unmodified/uncorrected version....
Code:
from tkinter import * #GUI stuff.

#Window
root = Tk()
root.title("Class Stats 5% Patcher")
root.geometry("300x200")
app = Frame(root)
app.grid()
lbl1 = Label(app, text = "Waiting for file...")
lbl1.grid()

#Open file.
f = open(filedialog.askopenfilename(), 'r+b')
#f = open('C:/Users/name/Desktop/gs2.gba', 'r+b')
fileOk = 1
#f.seek(0xA0)
#if f.read(16) != b'GOLDEN_SUN_BAGFE': fileOk = 0

#Check if values have not been altered.
for i in range(6):
    f.seek(0xAD768 + (i * 0x10))
    if ord(f.read(1)) != 10:
        fileOk = 0
       
if fileOk == 1:

    #Update the denominators to *2.  0x14 (20)
    for i in range(6):
        f.seek(0xAD768 + (i * 0x10))
        f.write(bytes([20]))
       
    #Update all class stats to *2.
    for i in range(0xF4): #Number of classes.
        for j in range(6): #Number of stats per class.
            f.seek(0xC15F4 + (i * 0x54) + (8 + j))
            val = ord(f.read(1))
            f.seek(0xC15F4 + (i * 0x54) + (8 + j))
            f.write(bytes([val * 2]))
           
    message = "Changes have been successfully saved."
else:
    message = "No changes have been made."

f.close()
lbl1['text'] = message
root.mainloop()

f.write(bytes([20]))

^You would think that'd put the 0x14's in for the denominators.... There is no fancy equations here... so... erm....


* statdenominators.png (79.21 KB, 602x688 - viewed 92 times.)
« Last Edit: June 02, 2017, 05:32:52 AM by Fox » Logged

Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Remember kids! Before you go on that interview, remember to wash your hands in teawater! *Coughs on hand* (Excuse me, I just coughed up a little teawater, so they're still clean!) You wouldn't want that hiring manager to be unimpressed.

May the force be with you!
Shoo! Why does it smell in here?
Maybe that's the wrong kind of force. *smirk*
View Profile
Salanewt
His Sexiness
Mercury Clan

Oh yeah, baby!

Prodigy
*

Coins: 32
Offline Offline

I am: A part of the organization of Cool Cats, but more of a dog person in reality.
Emblems: Have a nice day.
Posts: 4566

« Reply #6 on: June 02, 2017, 06:49:12 AM »

Okay, yeah I figured that was the case!

What's going on with python stuff?
Logged

Oh yeah baby, £ me harder.

Fusion is just a cheap tactic to make weak Adepts stronger.

Yoshi's Lighthouse is a hacking website in progress. Why not check it out if you like Yoshi or the Mario & Luigi games?
View Profile WWW

Novice Member
*

Coins: 1
Offline Offline

Posts: 33

« Reply #7 on: June 02, 2017, 12:21:42 PM »

Okay, so I ran it in python 3 and it works just fine. I don't really get the difference between the two since I don't know python but thanks alots.

Now if only there was a faster way to copy paste class data so I could input the various classes that I added.
Logged
View Profile
Fox
Fox McCloud, the Hacking Doctor
Mercury Clan

Prodigy
*

Coins: 28
Offline Offline

I am: certainly not a Gallant!
Clan Position: Head Gallant
Posts: 2411

« Reply #8 on: June 02, 2017, 04:07:03 PM »

That's easy with a small amount of hex editor experience.

All you need is VBA's Memory viewer...
Go to the address of the class data (0x080C15F4 in TLA (U)), select the first byte. Click the Save button at the bottom. The size should be in hexadecimal, I believe. You can do it in a calculator: 0x54 times the number of classes there are.
Once you have a dump saved, you can open up the ROM you want to put those into. This time, hit Load (while at the appropriate address), and load the dump you saved.


After that's done, make sure you don't forget to save the whole ROM section, otherwise you may lose the changes....: Go to 0x08000000, save a dump for 0x1000000 (For TLA), and change that to .gba.



Alternately, you could do it with Python... ; Even though there are some things I do like about Python...  I feel that it's a bit messed up, so I try to use something else most of the time. (Currently C#) Especially since C# can easily load a whole ROM into an array in minimum time. (<1 second....) compared to Python which takes some time. :(


Given my analysis of some programming languages. (Not a detailed one at that.) I have came to the conclusion that the best programming languages for me were of the C ones...  (Currently C#)  At least if it isn't an obscure language, more people would be more likely to read source code from it.... Etc.
« Last Edit: June 02, 2017, 05:46:07 PM by Fox » Logged

Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Remember kids! Before you go on that interview, remember to wash your hands in teawater! *Coughs on hand* (Excuse me, I just coughed up a little teawater, so they're still clean!) You wouldn't want that hiring manager to be unimpressed.

May the force be with you!
Shoo! Why does it smell in here?
Maybe that's the wrong kind of force. *smirk*
View Profile

Novice Member
*

Coins: 1
Offline Offline

Posts: 33

« Reply #9 on: June 04, 2017, 10:06:33 PM »

I'm a bit confused at the memory dump size part.

So let me get this straight, at the memory dump part, I'm supposed to go to 80C15F4 and select the byte in the attached picture? Then when I'm saving the dump, its supposed to be a size of BE50 (0x54 multiplied by the 244 classes (NPC + 243) in the game data?


* Memory Viewer Class Copy.jpg (89.64 KB, 768x330 - viewed 85 times.)
Logged
View Profile
Fox
Fox McCloud, the Hacking Doctor
Mercury Clan

Prodigy
*

Coins: 28
Offline Offline

I am: certainly not a Gallant!
Clan Position: Head Gallant
Posts: 2411

« Reply #10 on: June 04, 2017, 11:03:00 PM »

Yes.

Except the 244 is a decimal number, and treating it as a hex number will mess up the calculation.

0x5010 should be the correct size for GS2.

080C15F4 = Classes
080C6604 = Class Type chart
Logged

Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Remember kids! Before you go on that interview, remember to wash your hands in teawater! *Coughs on hand* (Excuse me, I just coughed up a little teawater, so they're still clean!) You wouldn't want that hiring manager to be unimpressed.

May the force be with you!
Shoo! Why does it smell in here?
Maybe that's the wrong kind of force. *smirk*
View Profile

Novice Member
*

Coins: 1
Offline Offline

Posts: 33

« Reply #11 on: June 05, 2017, 12:40:40 AM »

Thanks, I managed to stumble on another problem or maybe a weird quirk would be a better way to put it, but for some reason the text at locations 3346 and 3347 in the editor are backwards. Most locations would list the stats in the order Attack/Defense/Agility/Luck but for some weird reason this
section lists it as Attack/Defense/Luck/Agility. Then if you correct the order it mucks up a couple text areas.


* gs2hack_14.png (8.42 KB, 240x160 - viewed 75 times.)

* gs2hack_15.png (7.25 KB, 240x160 - viewed 72 times.)

* gs2hack_16.png (8.38 KB, 240x160 - viewed 72 times.)

* gs2hack_17.png (7.27 KB, 240x160 - viewed 71 times.)
Logged
View Profile
Fox
Fox McCloud, the Hacking Doctor
Mercury Clan

Prodigy
*

Coins: 28
Offline Offline

I am: certainly not a Gallant!
Clan Position: Head Gallant
Posts: 2411

« Reply #12 on: June 05, 2017, 02:14:37 AM »

Interesting...

Looking at how specific this topic's name is, I am assuming this is a "Wrong topic?" As in, I think this is related to the Intellect patch?


It is going to be my guess that Salanewt forgot to fully update it for everything else, since there's likely an index needed for every time the text should appear.
« Last Edit: June 05, 2017, 02:21:54 AM by Fox » Logged

Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Remember kids! Before you go on that interview, remember to wash your hands in teawater! *Coughs on hand* (Excuse me, I just coughed up a little teawater, so they're still clean!) You wouldn't want that hiring manager to be unimpressed.

May the force be with you!
Shoo! Why does it smell in here?
Maybe that's the wrong kind of force. *smirk*
View Profile
Salanewt
His Sexiness
Mercury Clan

Oh yeah, baby!

Prodigy
*

Coins: 32
Offline Offline

I am: A part of the organization of Cool Cats, but more of a dog person in reality.
Emblems: Have a nice day.
Posts: 4566

« Reply #13 on: June 05, 2017, 04:01:53 AM »

Oops, yeah I guess I either wrote the words in the wrong slots or forgot to switch those two labels around.

Thanks for pointing that out! Is this something you can fix yourself in the text editor or do I need to make a quick fix for that? I ask because I'm planning to revisit this patch and touch up a couple things when the AI overhaul patch is done, since that will have a second version that includes the Intellect patch when I finish the main one.
Logged

Oh yeah baby, £ me harder.

Fusion is just a cheap tactic to make weak Adepts stronger.

Yoshi's Lighthouse is a hacking website in progress. Why not check it out if you like Yoshi or the Mario & Luigi games?
View Profile WWW
Fox
Fox McCloud, the Hacking Doctor
Mercury Clan

Prodigy
*

Coins: 28
Offline Offline

I am: certainly not a Gallant!
Clan Position: Head Gallant
Posts: 2411

« Reply #14 on: June 05, 2017, 04:26:07 AM »

...
Huh. Oh yeah. I guess I must have read something wrong at first... but it was only a minor tidbit, anyway...

I think this line should be enough, though:  If you do want them to be in the right order (and don't want to wait for an update), it could help to search the text indexes (Probably 32-bit) in a hex editor and switch them. (Preferably check each one to make sure it changed properly, as you would likely be changing quite a few. - But quite a few doesn't mean a lot, so it shouldn't be that difficult.)
^ And yeah, for some things, it can be that easy.... I say to check (Field Menus and Battle menus individually.) to make sure of any false positives when switching them.
For other things, it can be a little more complicated (e.g. base index + offset index , or coded via mov/lsl/add... but I think TLA usually has text indexes as a 32-bit loaded by an ldr-relative.)


---
To find indexes of 3346, I can search 120D0000 in a hex editor... and only pay attention to the ones at addresses divisible by 4 (32-bit), as if it is not, it's likely a false positive. But if it is aligned as such, then it depends.
« Last Edit: June 05, 2017, 04:52:50 AM by Fox » Logged

Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Remember kids! Before you go on that interview, remember to wash your hands in teawater! *Coughs on hand* (Excuse me, I just coughed up a little teawater, so they're still clean!) You wouldn't want that hiring manager to be unimpressed.

May the force be with you!
Shoo! Why does it smell in here?
Maybe that's the wrong kind of force. *smirk*
View Profile
Pages: [1] 2   Go Up
  Print  
 
Jump to:  

Cbox
May 09, 2018, 12:35:37 AM
KyleRunner: The "Start In" field is not editable... I'll try making new shortcuts
May 08, 2018, 09:51:08 PM
Fox: If all else fails, you canmake new Shortcuts to do the same thing.
May 08, 2018, 09:49:53 PM
Fox: Export Properties > Shortcut (Tab) > Target / Start In ; Target (for Export) should be: (filename) 0 , and for Import: (filename) 1
May 08, 2018, 08:52:00 PM
KyleRunner: I can't change the path in properties menu...
May 08, 2018, 01:27:19 AM
Fox: You may need to edit something in properties, though... so it uses the exe file in the same directory.
May 08, 2018, 01:24:59 AM
Fox: It is suppose to be a shortcut, yes.
May 03, 2018, 11:48:05 PM
KyleRunner: Fox, the "export" function in your text editor is just a shortcut... Could you please fix it?
May 02, 2018, 09:53:45 PM
KyleRunner: I come here everyday. I'm working on a Portuguese translation, and the people here help me a lot.
May 02, 2018, 08:56:07 AM
Drake baku: My feel as well, I posted a little as well since my return, but silence was all that followed... At least the forum is a great source for data when hacking GS/ GS2, currently looking for something I have read a long time ago cause my PP recovery psy is not working
May 01, 2018, 09:58:04 AM
Fox: I am thinking a lot of this might be because of Discord?
May 01, 2018, 09:56:08 AM
Fox: Yeah, this forum is more dead than ever before.  February and April have 0 new topics. (All other months prior have more.) And March has lowest number of new posts. (It'd be dumb to count the very first month this site was created.)
April 25, 2018, 09:02:13 PM
Fox: Yes. The best tool is a hex editor. Well.... VBA, VBA-SDL-H, no$gba Debugger, GBATEK, and my documentation.... to use these to learn how the code/data works. Best method because it maximizes your editing ability... and then there is my program gsmagic that I was working on. Still in its early stages, though. (Even after year(s).)
April 25, 2018, 04:21:58 PM
Xendrox D: *exept tla editor.
April 25, 2018, 04:21:29 PM
Xendrox D: is there any other tool for hacking gs?
April 23, 2018, 09:26:27 PM
Atrius: Rarely, but not never.
April 23, 2018, 08:01:48 AM
Drake baku: Can it be, the god who created the editor, atrius. I heard you never came back online here anymore
April 20, 2018, 02:46:36 PM
KyleRunner: Atrius!!
April 19, 2018, 11:29:46 PM
Atrius: @Fox, I tried, but for some reason Mario Golf won't boot, and Mario Tennis crashes when you patch out the text compression, and I'm not sure why...  The normal text loading functions in them are basically the same as the ones in the Golden Sun games.
April 16, 2018, 07:44:36 AM
Drake baku: So it took about halve a hour of letting my lap stay off for it to suddenly work again
April 16, 2018, 07:31:28 AM
Drake baku: All of a sudden fox his editor gets errors. When trying to start it, thing worked fine yesterday...

Affiliates
Temple of Kraden Golden Sunrise
Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.055 seconds with 22 queries.