Golden Sun Hacking Community
October 23, 2017, 09:57:18 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 703 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 34 times.)

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

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

« 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...
*Cross my fingers and hope we have Big Brother All-Stars next year... with Paulie & Cody Califorie(sp?)... and Vanessa & Tiffany Rousso.... Would be fun? :P Especially if one of the boys got evicted early since there's usually some all-guy alliance in there, right?
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 29 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: 2376

« 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 26 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...
*Cross my fingers and hope we have Big Brother All-Stars next year... with Paulie & Cody Califorie(sp?)... and Vanessa & Tiffany Rousso.... Would be fun? :P Especially if one of the boys got evicted early since there's usually some all-guy alliance in there, right?
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: 2376

« 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...
*Cross my fingers and hope we have Big Brother All-Stars next year... with Paulie & Cody Califorie(sp?)... and Vanessa & Tiffany Rousso.... Would be fun? :P Especially if one of the boys got evicted early since there's usually some all-guy alliance in there, right?
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 21 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: 2376

« 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...
*Cross my fingers and hope we have Big Brother All-Stars next year... with Paulie & Cody Califorie(sp?)... and Vanessa & Tiffany Rousso.... Would be fun? :P Especially if one of the boys got evicted early since there's usually some all-guy alliance in there, right?
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 24 times.)

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

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

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

« 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...
*Cross my fingers and hope we have Big Brother All-Stars next year... with Paulie & Cody Califorie(sp?)... and Vanessa & Tiffany Rousso.... Would be fun? :P Especially if one of the boys got evicted early since there's usually some all-guy alliance in there, right?
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: 2376

« 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...
*Cross my fingers and hope we have Big Brother All-Stars next year... with Paulie & Cody Califorie(sp?)... and Vanessa & Tiffany Rousso.... Would be fun? :P Especially if one of the boys got evicted early since there's usually some all-guy alliance in there, right?
View Profile
Pages: [1] 2   Go Up
  Print  
 
Jump to:  

Cbox
October 16, 2017, 09:57:26 AM
AZVRE: Im pretty okay, what about you?
October 16, 2017, 01:17:14 AM
Fox: I think the nine is doing a cirno on me, though... Anyway, how is everyone doing today?
October 16, 2017, 01:12:20 AM
Fox: onesixtwo*
October 16, 2017, 01:12:00 AM
Fox: Okay... Meanwhile... ah... 162 being a number that has made itself known to me.... I look at the relationships of the numbers.... 162  1+6+2 = 9 ; onesizetwo = alphabetical order = 9 characters ; Distance apart analysis: os = 4 = 1[6][2] , st = 1 = [1]6[2] , ot = 5 = [1][6]2 ; ost = original sound track?
October 15, 2017, 06:31:17 PM
AZVRE: ah okay :D i thought i caused some trouble
October 14, 2017, 07:49:16 AM
Fox: Oh i know... You were messing with yours, and the description says mine. It's kind of a funny bug. :P
October 13, 2017, 08:18:31 PM
AZVRE: I did not edit your profile tho. Just to erase that confusion ^^"
October 12, 2017, 04:49:56 AM
Fox: e.g. this art = http://forum.goldensunhacking.net/Themes/Jupiter/images/catbg.gif (etc.)
October 12, 2017, 04:48:58 AM
Fox: I have a question: Where did the art for the headers come from? (Like the backgrounds to each of these things... "Affiliates", etc... Asking just incase it inspires me to do something... but if Charon made it, then that's cool too.
October 11, 2017, 04:23:02 AM
FoxWas thinking about having something for the editor anniversary, but I believe I had to change my mind....
October 10, 2017, 12:58:36 PM
Fox: That's alright. ;       @AZVRE's profile: "Current Activity:  Editing the profile of Fox." ...Eh... That looks weird.
October 07, 2017, 11:45:16 PM
Atrius: Sorry about that, the auto bot detection is still working, but it also requires an admin to visit the site regularly.
October 04, 2017, 04:17:40 AM
Fox: Yeah, it does bring a small amount of activity. Not good quality activity, but it's still activity, nonetheless.  Now if we can get them to randomly post pictures and vdeios!
October 04, 2017, 02:10:48 AM
Majora: If nothing else, I like how they're copying the content of real posts at random. Interesting to see how they adapt to seem more authentic
October 03, 2017, 08:29:38 PM
Fox: medico6601 = Most likely another bot. :(
September 26, 2017, 03:32:24 PM
Fox: by ten* Excuse me.
September 26, 2017, 03:32:12 PM
Fox: Oh yes... Also multiply all levels by two. (So actually, an adept will have levels of 54, 3, 2, and 1, rather than 5, 0, 0, 0.... if going by those.)
September 26, 2017, 03:29:07 PM
Fox: ...I mean the theory also saves space on the Status Screen.
September 26, 2017, 03:26:11 PM
Fox: Random/fun concept theory: What if we got rid of ePow/eRest, and just made eLevel do everything. :P (A process of cleaning stuff up... Though, could make things less versatile. - Like, if a Djinni add 1 eLevel = Okay, that's understood... by why specifically +5 on the ePow/eRes (Rhetorical))
September 23, 2017, 04:42:08 AM
Fox: Oh nevermind, it does... but I swear I saw that a minute ago.

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