Golden Sun Hacking Community
January 16, 2018, 01:40:56 PM *
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 1207 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 79 times.)

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

* gs2hack_12.png (7.67 KB, 240x160 - viewed 61 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: 4565

« 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: 2403

« 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 69 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: 4565

« 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: 2403

« 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 65 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: 4565

« 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: 2403

« 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 57 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: 2403

« 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 51 times.)

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

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

* gs2hack_17.png (7.27 KB, 240x160 - viewed 47 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: 2403

« 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: 4565

« 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: 2403

« 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
Yesterday at 07:26:16 PM
Fox: (path) 1 text=(address) char=(address) free=(address) ; << Well, closer to this... but yeah... even if I do choose to have defaults in the code, I could still use this method for overrides.
Yesterday at 07:24:28 PM
Fox: So like (path) 0 text=(address) char=(address) len=(number) ; (path) 1 free=(address) ; Or something. But that's just a quick example.
Yesterday at 06:59:14 PM
Fox: Hopefully. I was wanting to make it so you could put in the addresses/etc. as one of the arguments in the path. Hm?
Yesterday at 03:37:07 PM
KyleRunner: Nice! I hope you'll add compatibility with others games (GS1, Mario Golf and Tennis) soon.
January 14, 2018, 11:40:09 PM
Fox: Okay. Posted (in Downloads section) an initial cutdown version for now, for my text compressor. Basically to separate the code from my Editor for anyone who wants to mess with it. It only supports GS2, because I still didn't add the addresses/etc. for the other games.
January 14, 2018, 05:01:00 PM
Fox: Okay! Going to need to think how I want it to work. Initial thoughts is maybe have a number of arguments in the filepath thing. And have a number of shortcuts (files) to be used as examples. Assuming there are no problems.
January 14, 2018, 10:38:24 AM
KyleRunner: Well... I'm used to editing text ina a text editor, so... yes! Thanks in advance!
January 13, 2018, 11:38:43 PM
Fox: (Text editor = Text Document like notepad.)
January 13, 2018, 11:38:21 PM
Fox: Would you prefer during the text editing in a text editor? (Like what gstoolkit lets you do?) I could probably make a separate tool or something to compress it.
January 13, 2018, 10:10:02 PM
KyleRunner: Ok. Once I finish my Lost Age translation, I'll try a Mario Golf one. Thanks. (But I'll need help).
January 13, 2018, 10:03:17 PM
Fox: If you want to make it "permanent" (part of a hack), then you'd edit code in the ROM that writes to this location of the IDs you'd want to change. (You can find these locations by using a breakpoint debugger like SDL-H or no$gba.)
January 13, 2018, 10:00:11 PM
Fox: Reload/switch = Recommended to be done through Debug mode/warp menu, ofcourse... since doors seem to appear as if they were disabled? ; 03001238:01 and B+Start to get to warp menu.
January 13, 2018, 09:55:39 PM
Fox: @Kyle Runner = It might be, but you'd have to use the correct addresses for Mario Golf, rather than for GS2 as I have it right now. ; @raijinken = Yes. 02000454 = ID of leader. (Change this and reload/switch room you are in, enjoy.)
January 13, 2018, 02:23:29 PM
raijinken: Hey guys, is it possible to somehow change the lead character on the map? Was wondering. I remember there was a cheat to use Jenna, but what if I wanted Isaac, or Piers?
January 13, 2018, 02:10:03 PM
KyleRunner: Hey, Fox *
January 13, 2018, 02:09:37 PM
KyleRunner: Hey, is your text editor compatible with Mario Golf (GBA)?
January 11, 2018, 08:33:13 PM
Fox: But if it isn't an oversight, I still can't imagine it being that useful.
January 11, 2018, 08:28:24 PM
Fox: part, ofcourse.
January 11, 2018, 08:28:15 PM
Fox: 0200274C = Hmm... Stuff happens here when you use Cyclone around bushes. (These cause tile replacements, and setting event 0 to those tiles.) - And I guess this kept here so it can be scanned after battle. (To re-update the map.) So here is my fun thought (assuming if it is even possible, or even convenient if so.) ... Are there any events from other maps that could be disabled do to using Cyclone on bushes + Retreat glitch? I'll need to do some testing to make sure this isn't an oversight on my
January 09, 2018, 08:09:26 PM
Fox: And the chance for a Djinni battle is 50%.

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.086 seconds with 22 queries.