Golden Sun Hacking Community
December 14, 2017, 10:23:00 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 3 ... 7   Go Down
  Print  
Author Topic: Post your GBA ASM Questions here.  (Read 27533 times)
0 Members and 1 Guest are viewing this topic.
Fox
Fox McCloud, the Hacking Doctor
Mercury Clan

Prodigy
*

Coins: 28
Offline Offline

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

« on: November 03, 2010, 10:10:08 PM »

I found GBATEK to be the most useful. It may be easier than you think, I strongly recommend you use the SDL-H version for any assembly hacking you do.

Take note of MOV, LDR, STR, and the Branches (B, BL) - I consider those as being the most basic.

MOV = Simply put a value in a register.
LDR = This is 32-bit, but LDRH is 16-bit, and LDRB is 8-bit. This is for loading a value from an offset into a register.
STR = similar to LDR, it has STRH, and STRB, it is for storing the value of the register into an offset.

B = A simple Jump, no conditions, that's about it, just a jump.
BL = Branch and Link. It is a function call. This is so you can Jump to another function and come back here at the end of that function.

And there are branching with conditionals.. BLE, BEQ, etc.

Ofcourse, all this is THUMB. ARM may have the same stuff as well, and they have much more you can do. (But it's a bit slower.)


So, if anyone needs help in ASM hacking (or has any questions on it) then you are welcome to post here. (My only real practices on this were in M&L:SS, so I might not be the best...)
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...
Did you know? In English, you are suppose to capitalize the languages. (e.g. English is a proper noun.) Subjects like math, science, history can be left lower-cased unless they are a title. (Kind of like how you can say either "my mom" or "Mom" in "I went with (X) to the store.", except that I don't think languages are ever lower-cased in English.) In Spanish, both subjects and languages are left lower-cased. (I put this here because I've noticed people make this mistake quite often. And am curious if they know about this, and whether they use their way because they believe this grammar usage should have never been a thing?

Remember kids! In getting a job, it's not about what you know, it's about WHO you know! So start making friends with the people that work where you want to work. :) (Friend of a friend and volunteering count too, so keep that in mind.)[/si
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: November 03, 2010, 10:16:03 PM »

ASM is ASM, thanks for posting this here! GBATEK remains one of my favourite sources when studying ASM, and I think it also talks a bit about the DS too, right? I will be sure to ask whenever I have a question, as I am going to start practicing with it soon (instead of just studying).

Have a nice day.
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: 2393

« Reply #2 on: November 03, 2010, 10:24:37 PM »

Quote
ASM is ASM
Correct.
Quote
thanks for posting this here!
You are welcome. After I saw one of your posts where there was a quote saying that no one knows assembly here..yet, I decided it would be a good idea to post this, since this may also get more people interested in learning it sooner.
Quote
GBATEK remains one of my favourite sources when studying ASM
That's very true, it is a large guide, after all.
Quote
and I think it also talks a bit about the DS too, right?
Correct, again.
Quote
I will be sure to ask whenever I have a question,
That's what this topic is for!
Quote
as I am going to start practicing with it soon (instead of just studying)
Practicing is one of the best ways to learn, so have fun.
Quote
Have a nice day.
You have a nice day as well.
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...
Did you know? In English, you are suppose to capitalize the languages. (e.g. English is a proper noun.) Subjects like math, science, history can be left lower-cased unless they are a title. (Kind of like how you can say either "my mom" or "Mom" in "I went with (X) to the store.", except that I don't think languages are ever lower-cased in English.) In Spanish, both subjects and languages are left lower-cased. (I put this here because I've noticed people make this mistake quite often. And am curious if they know about this, and whether they use their way because they believe this grammar usage should have never been a thing?

Remember kids! In getting a job, it's not about what you know, it's about WHO you know! So start making friends with the people that work where you want to work. :) (Friend of a friend and volunteering count too, so keep that in mind.)[/si
View Profile
Atrius
Programmer Extraordinaire
Web Host

Fear my blades

Veteran Member
*

Coins: 1
Offline Offline

Gender: Male
Emblems: Website Founder
Clan Position: Creation God of Sol
Posts: 1756

« Reply #3 on: November 04, 2010, 01:03:57 AM »

GBATEK = GBA & DS Hacking Bible

I'd also like to point out that v0.3 does give you the capability to do hex level ASM hacking on map code should you choose to do so.  It's a bit more advanced since you have to break the commands down into their hex equivalents though. This is where cut scenes come in to play, so please do experiment with it.
Logged

I'm shaking my head in general disapproval of everything
View Profile WWW

Novice Member
*

Coins: 0
Offline Offline

Posts: 12

« Reply #4 on: May 10, 2011, 02:08:22 AM »

GBATEK = GBA & DS Hacking Bible

I'd also like to point out that v0.3 does give you the capability to do hex level ASM hacking on map code should you choose to do so.  It's a bit more advanced since you have to break the commands down into their hex equivalents though. This is where cut scenes come in to play, so please do experiment with it.

The ASM viewer in your editor cant be edited and i dunno how to convert it to hex, does this GBATEK teaches everything there is to know about GBA, NDS editing?
Logged
View Profile
Misery
Bad Luck

Great Member
***

Coins: 2
Offline Offline

Gender: Male
Clan Position: Mercury Hack Leader
Posts: 709

« Reply #5 on: January 24, 2013, 11:34:28 PM »

Alright, I wanted to avoid taking that other thread off the rails completely, but I figured I could at least take a moment to think about this so I can reply.

Quote
If you ever plan on hacking DS, get use to seeing 32-bit code. ; I could go with a long tutorial, but I suppose it wouldn't help much if I didn't know which parts you actually needed help on.
I don't really plan to try hacking DS or any more current systems. For projects where I don't like the limitations of older hardware, I can do them on PC instead. The simplicity of older systems has a certain charm... But yeah, I guess I need to know what I want to learn. Overall I just think I need more general knowledge about the system, which the documentation can provide in abundance, but I'm not going to remember much of it if I never use it. Perhaps I can clarify some stuff here.

Last time I did anything that had to do with ASM, I think I was trying to use a simple branch (with link) - I can't recall if I was following an existing one or trying to stick in my own, but in either case it didn't end up where I expected. I'm completely off the ball with this right now so bear with me, if I look into it again I could post what I'm doing in more detail.

Quote
-Find data based on what you are looking for (RAM/VRAM/PALETTE) If the value is to be in RAM (Ex: A Stat number) Use Search for cheats / RAM Search.
I recall having some success with this, but most of the time what I'm looking for isn't in RAM, and addresses holding player related data are pretty well documented in any case, courtesy of people trying to make cheat codes.

Quote
-You may want to find out how this data is affected, so you should use a debugger. (VBA-SDL-H) With a breakpoint write if looking for things like party data, etc.
Assuming I even know where to place the breakpoint. For example, if I were looking for a function that writes to a character's attack stat, it would be no problem, but I haven't attempted anything like that. I guess I should start with something simple just to see if I can make it work. I'm also not entirely comfortable with using VBA-SDL-H, but it looks like I'll have to get used to it if I want to get anything done. I can swear I've been able to place a breakpoint with the normal VBA using something in the tools section, but I can't find that option anymore.

Quote
-Sometimes, when scanning the code (In the case of breakpoint-write, scroll up), you can just look for ROM pointers, and research what those are if you don't feel like reading the assembly. Make sure not to scroll up too far, though, or you'll be looking at a different function. (Usually functions start with the push opcode, but they don't have to have one if they don't need one.) If you don't see any pointers, then you probably check the parent function. (The function that called the function you are looking at.) ; There are ways of finding the parent function, so it shouldn't be too difficult.
This is where I've probably had the most trouble. How do you identify a pointer? Oh wait, I forget we're talking about disassembled code. But I still don't really know how to see which ones are relevant. How would you find the parent function? How do you tell where one function begins and another ends? If it's very in-depth I don't think I'd gain much from an explanation right now though, so if that's the case... save it for later.

Quote
Pretty much, when reading the code, you must understand what the variables in the registers of the instruction you are looking at are- before you can understand the purpose of the instruction that is being executed.
Yeah, I pretty much never have any idea of what I'm looking at unless someone explained it already. Like I said, I don't really know where to start...

Quote
Sometimes, you may not even need to check the assembly at all to find data that you are looking for. For example, for uncompressed graphics, you can simply search for matching data in a Hex Editor.
Not sure why I'd use a hex editor to find uncompressed graphics when I could just use a tile editor, but when it comes to Golden Sun just about everything seems to be compressed anyway (I've found the element icons and the alphabet uncompressed, possibly some attack effects, but that's all).

Quote
Quote
breaking down hex values to bit level to find out which particular flavor of an instruction I'm looking at
Do you mean you aren't actually looking at the instructions themselves, but trying to convert the hex values instead? That seems to be a long way to go about it. Why not try using the GBA Dissassembler? (Tools => Dissassemble...) I probably should tell you that the map code is at 02008000.
Yes... I suppose I should get used to use a disassembler, as well as something that compiles my own code into hex...

Quote
The addresses are read with ldr. ldr r#, [$########] (=$########) ; The address in the square brackets [ ] is where the value of the one in parenthesis ( ) is at. The parenthesis value should include the address of a database. And you aren't just limited to ROM pointers. RAM, VRAM, PALETTE, etc. are done the same way. ; Anyway, this puts the address in r#, you can then make any calculations you want to read/write to the specific data in the databases. After the calculations are made, we use another load (ldr/ldrh/ldrb/etc., depending on the datatype) to read the data. (Or if we are writing to RAM, str/strh/strb/etc.)
I was really just asking for the notation syntax, not how addresses are handled program-wise... like, I assume the data in ROM is divided into banks, and the address is something like [bank][address], or there's a number at the start of the address referring to the physical location of the GBA itself... err, like I said, I don't really know how it works, I just know that the addresses I've been seeing don't correspond to the same address in a hex editor. Anyway, after reading through that a few times, that's really helpful, so... thanks.

Well, the more I think about this, the more I realize I could find my answers simply by trying stuff out. I'm going to try to make a psynergy that affects elemental power/resistance someday ahead (there are already functions for this, so it shouldn't be too hard, right?). I'll probably get stuck with it, but then I can at least ask more specific questions. Later on I want to look into code that deals with djinn states, but I figure I'll need a bit deeper understanding before I can get anywhere with that.
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: 2393

« Reply #6 on: January 25, 2013, 05:05:56 AM »

Alright, I wanted to avoid taking that other thread off the rails completely, but I figured I could at least take a moment to think about this so I can reply.

Quote
If you ever plan on hacking DS, get use to seeing 32-bit code. ; I could go with a long tutorial, but I suppose it wouldn't help much if I didn't know which parts you actually needed help on.
I don't really plan to try hacking DS or any more current systems. For projects where I don't like the limitations of older hardware, I can do them on PC instead. The simplicity of older systems has a certain charm... But yeah, I guess I need to know what I want to learn. Overall I just think I need more general knowledge about the system, which the documentation can provide in abundance, but I'm not going to remember much of it if I never use it. Perhaps I can clarify some stuff here.

Last time I did anything that had to do with ASM, I think I was trying to use a simple branch (with link) - I can't recall if I was following an existing one or trying to stick in my own, but in either case it didn't end up where I expected. I'm completely off the ball with this right now so bear with me, if I look into it again I could post what I'm doing in more detail.
I'm interested in knowing what you had. Also, I think branch link's 5 most significant bits on both 16-bits should be done like this 11110*********** 11111*********** (F000 F800) Since I remember having a problem before (long ago) with branch-links and that seemed to be what the problem was.

Quote
Quote
-Find data based on what you are looking for (RAM/VRAM/PALETTE) If the value is to be in RAM (Ex: A Stat number) Use Search for cheats / RAM Search.
I recall having some success with this, but most of the time what I'm looking for isn't in RAM, and addresses holding player related data are pretty well documented in any case, courtesy of people trying to make cheat codes.
Yeah, but in the case where they aren't documented.... (Most likely things like room numbers and the currently selected item in menues, etc.) It can still be a huge help. And once you find the data, expect other interesting bits of information to be in the area as well, since it is most likely common for similar things to be grouped together.

Quote
Quote
-You may want to find out how this data is affected, so you should use a debugger. (VBA-SDL-H) With a breakpoint write if looking for things like party data, etc.
Assuming I even know where to place the breakpoint. For example, if I were looking for a function that writes to a character's attack stat, it would be no problem, but I haven't attempted anything like that. I guess I should start with something simple just to see if I can make it work. I'm also not entirely comfortable with using VBA-SDL-H, but it looks like I'll have to get used to it if I want to get anything done. I can swear I've been able to place a breakpoint with the normal VBA using something in the tools section, but I can't find that option anymore.
I don't think you can breakpoint with the original VBA, as far as I'm aware.

Quote
Quote
-Sometimes, when scanning the code (In the case of breakpoint-write, scroll up), you can just look for ROM pointers, and research what those are if you don't feel like reading the assembly. Make sure not to scroll up too far, though, or you'll be looking at a different function. (Usually functions start with the push opcode, but they don't have to have one if they don't need one.) If you don't see any pointers, then you probably check the parent function. (The function that called the function you are looking at.) ; There are ways of finding the parent function, so it shouldn't be too difficult.
This is where I've probably had the most trouble. How do you identify a pointer? Oh wait, I forget we're talking about disassembled code. But I still don't really know how to see which ones are relevant. How would you find the parent function? How do you tell where one function begins and another ends? If it's very in-depth I don't think I'd gain much from an explanation right now though, so if that's the case... save it for later.
I pointer is just an address written in the data.  @Parent function: If using VBA-SDL-H, you can check lr (r14) or look in the stack (Depending on if r14 changed after the function's start.). For beginners, I recommend just executing the code until you exit the function. (n = execute next instruction; but if there is a lot of code, you may prefer just skipping down to the return. (most likely the bx instruction.) rtt = run to thumb ) I have also included a little tool in Yoshi Magic to find all function calls to a specified function, so that could be even more useful. (Only for Thumb code, though.)

Quote
Quote
Pretty much, when reading the code, you must understand what the variables in the registers of the instruction you are looking at are- before you can understand the purpose of the instruction that is being executed.
Yeah, I pretty much never have any idea of what I'm looking at unless someone explained it already. Like I said, I don't really know where to start...
I'd start by learning the "easy" data before hand, and then see how it is used in the code. That may help to fill out the rest of the logic puzzle.

Quote
Quote
Sometimes, you may not even need to check the assembly at all to find data that you are looking for. For example, for uncompressed graphics, you can simply search for matching data in a Hex Editor.
Not sure why I'd use a hex editor to find uncompressed graphics when I could just use a tile editor, but when it comes to Golden Sun just about everything seems to be compressed anyway (I've found the element icons and the alphabet uncompressed, possibly some attack effects, but that's all).
@Hex Editor, because maybe it is faster than skimming the entire ROM for the graphics you want? Basically, you look at VBA's Tile Viewer, then open up the memory viewer to the VRAM section. (06000000) Match the graphics to the data in the memory viewer and search those. But only if it is uncompressed in the ROM.

Quote
Quote
Quote
breaking down hex values to bit level to find out which particular flavor of an instruction I'm looking at
Do you mean you aren't actually looking at the instructions themselves, but trying to convert the hex values instead? That seems to be a long way to go about it. Why not try using the GBA Dissassembler? (Tools => Dissassemble...) I probably should tell you that the map code is at 02008000.
Yes... I suppose I should get used to use a disassembler, as well as something that compiles my own code into hex...
Unfortunately, I don't know of any compilers at this moment, so I'd probably end up coding my own, most likely into Yoshi Magic or the GS Editor. (Or both?)

Quote
Quote
The addresses are read with ldr. ldr r#, [$########] (=$########) ; The address in the square brackets [ ] is where the value of the one in parenthesis ( ) is at. The parenthesis value should include the address of a database. And you aren't just limited to ROM pointers. RAM, VRAM, PALETTE, etc. are done the same way. ; Anyway, this puts the address in r#, you can then make any calculations you want to read/write to the specific data in the databases. After the calculations are made, we use another load (ldr/ldrh/ldrb/etc., depending on the datatype) to read the data. (Or if we are writing to RAM, str/strh/strb/etc.)
I was really just asking for the notation syntax, not how addresses are handled program-wise... like, I assume the data in ROM is divided into banks, and the address is something like [bank][address], or there's a number at the start of the address referring to the physical location of the GBA itself... err, like I said, I don't really know how it works, I just know that the addresses I've been seeing don't correspond to the same address in a hex editor. Anyway, after reading through that a few times, that's really helpful, so... thanks.
You mean something like this: READ_BYTE( Database_address + (Entry_Number * Num_of_bytes_in_entry) + Byte_num_in_entry )

Quote
I just know that the addresses I've been seeing don't correspond to the same address in a hex editor.
Also, do note, only the ROM section will appear in a hex editor, as that is read-only memory.  so 0x08000000 in VBA's memory viewer is 0x00000000 in a Hex Editor.

Quote
Well, the more I think about this, the more I realize I could find my answers simply by trying stuff out. I'm going to try to make a psynergy that affects elemental power/resistance someday ahead (there are already functions for this, so it shouldn't be too hard, right?). I'll probably get stuck with it, but then I can at least ask more specific questions. Later on I want to look into code that deals with djinn states, but I figure I'll need a bit deeper understanding before I can get anywhere with that.
Umm... not sure. I know that items can do stuff with elemental stats, though. Djinn states? Hmm...
« Last Edit: January 25, 2013, 05:19:30 AM by Teawater » 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...
Did you know? In English, you are suppose to capitalize the languages. (e.g. English is a proper noun.) Subjects like math, science, history can be left lower-cased unless they are a title. (Kind of like how you can say either "my mom" or "Mom" in "I went with (X) to the store.", except that I don't think languages are ever lower-cased in English.) In Spanish, both subjects and languages are left lower-cased. (I put this here because I've noticed people make this mistake quite often. And am curious if they know about this, and whether they use their way because they believe this grammar usage should have never been a thing?

Remember kids! In getting a job, it's not about what you know, it's about WHO you know! So start making friends with the people that work where you want to work. :) (Friend of a friend and volunteering count too, so keep that in mind.)[/si
View Profile
Misery
Bad Luck

Great Member
***

Coins: 2
Offline Offline

Gender: Male
Clan Position: Mercury Hack Leader
Posts: 709

« Reply #7 on: January 27, 2013, 01:44:27 PM »

Quote
I'm interested in knowing what you had. Also, I think branch link's 5 most significant bits on both 16-bits should be done like this 11110*********** 11111*********** (F000 F800) Since I remember having a problem before (long ago) with branch-links and that seemed to be what the problem was.
This was a while ago so I don't exactly remember it all, but I was looking at the code you posted that is used to distribute djinn to Isaac's party at the start of the game. Since the amount of djinn to distribute can't be reduced to zero, I was looking for a way to bypass the routine completely. I must simply have been looking in the wrong location though, because the hex code I was looking at didn't match that specific bit configuration... I'm still not completely sure though, because I clearly remember that command being in the value range for branches.

Quote
I don't think you can breakpoint with the original VBA, as far as I'm aware.
I don't think so either, I must be remembering incorrectly.

Quote
@Parent function: If using VBA-SDL-H, you can check lr (r14) or look in the stack (Depending on if r14 changed after the function's start.). For beginners, I recommend just executing the code until you exit the function. (n = execute next instruction; but if there is a lot of code, you may prefer just skipping down to the return. (most likely the bx instruction.) rtt = run to thumb ) I have also included a little tool in Yoshi Magic to find all function calls to a specified function, so that could be even more useful. (Only for Thumb code, though.)
Argh, yes of course it stores the return address for functions! *smacks self* :P
Even if I had thought of that though, I probably wouldn't have known how to put it to use. A tool for finding function calls? Isn't that just searching for a specific hex string? (BL + address of the function)

Quote
@Hex Editor, because maybe it is faster than skimming the entire ROM for the graphics you want? Basically, you look at VBA's Tile Viewer, then open up the memory viewer to the VRAM section. (06000000) Match the graphics to the data in the memory viewer and search those. But only if it is uncompressed in the ROM.
Oh, that would actually be pretty useful... I hadn't thought about that. Not that it will help me with Golden Sun, but perhaps with other games.

Quote
Unfortunately, I don't know of any compilers at this moment, so I'd probably end up coding my own, most likely into Yoshi Magic or the GS Editor. (Or both?)
Oh, hehehe... that must be why I hadn't found one. I was sure I had been looking for one.

Coding a compiler for GBA ASM sounds like a huge project, so best of luck to you if you're planning to do that. I'd recommend you try to make it work as a standalone application so it can be of benefit to people trying to hack other games than M&L or GS.

Quote
You mean something like this: READ_BYTE( Database_address + (Entry_Number * Num_of_bytes_in_entry) + Byte_num_in_entry )
To be honest... I have no idea what this refers to.

Quote
Also, do note, only the ROM section will appear in a hex editor, as that is read-only memory.  so 0x08000000 in VBA's memory viewer is 0x00000000 in a Hex Editor.
Oh, right... it makes sense now. Just had a look at the GBA memory map... guess I should've done that before asking this.

Quote
Umm... not sure. I know that items can do stuff with elemental stats, though. Djinn states? Hmm...
The in-battle player data has space reserved for a "status effect" that increases elemental power, I think. Remember when you use a summon, it increases elemental power? I was planning to try to access that. Anyway, on second thought I don't think there's anything like that for element-specific resistance, but I'm only really interested in elemental power.

Just to be clear, what I mean with djinn states is whether they are set, standby or recovering.
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: 2393

« Reply #8 on: January 27, 2013, 03:37:16 PM »

Quote
This was a while ago so I don't exactly remember it all, but I was looking at the code you posted that is used to distribute djinn to Isaac's party at the start of the game. Since the amount of djinn to distribute can't be reduced to zero, I was looking for a way to bypass the routine completely. I must simply have been looking in the wrong location though, because the hex code I was looking at didn't match that specific bit configuration... I'm still not completely sure though, because I clearly remember that command being in the value range for branches.
The unconditional branch command (b) is used to jump to another location in the code, perhaps that could be of use? (Ofcourse, you could replace what you don't want with 0000s, however, the code would still be executed,... lsl r0, r0, #0x0 doesn't make any noticeable changes that you should worry about.)

Quote
A tool for finding function calls? Isn't that just searching for a specific hex string? (BL + address of the function)
Pretty much. The branches are done with relative addressing, so the value would be based off of the distance from the call to the actual function.



Quote
You mean something like this: READ_BYTE( Database_address + (Entry_Number * Num_of_bytes_in_entry) + Byte_num_in_entry )
To be honest... I have no idea what this refers to.

Think of "Database_address" As one of the sub-editors in the editor.
Think of "Entry_Number" as one of the items in the main list of a sub-editor.
Num_of_byte_in_entry could be based off everything that is editable for a partically item.
Byte_num_in_entry would be the actual attribute you are dealing with for the particular item. (Like when you go to edit a stat, or other value in the editor, or something.)
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...
Did you know? In English, you are suppose to capitalize the languages. (e.g. English is a proper noun.) Subjects like math, science, history can be left lower-cased unless they are a title. (Kind of like how you can say either "my mom" or "Mom" in "I went with (X) to the store.", except that I don't think languages are ever lower-cased in English.) In Spanish, both subjects and languages are left lower-cased. (I put this here because I've noticed people make this mistake quite often. And am curious if they know about this, and whether they use their way because they believe this grammar usage should have never been a thing?

Remember kids! In getting a job, it's not about what you know, it's about WHO you know! So start making friends with the people that work where you want to work. :) (Friend of a friend and volunteering count too, so keep that in mind.)[/si
View Profile
Misery
Bad Luck

Great Member
***

Coins: 2
Offline Offline

Gender: Male
Clan Position: Mercury Hack Leader
Posts: 709

« Reply #9 on: January 27, 2013, 05:51:32 PM »

The unconditional branch command (b) is used to jump to another location in the code, perhaps that could be of use? (Ofcourse, you could replace what you don't want with 0000s, however, the code would still be executed,... lsl r0, r0, #0x0 doesn't make any noticeable changes that you should worry about.)
Actually, the plan was to use an unconditional branch to skip that entire block of code... but to know where to jump, I still need to figure out what the rest of the code does, to make sure I'm not skipping anything critical. Which led to me trying to follow an existing BL. Which led to me getting stuck.

Quote
Quote
A tool for finding function calls? Isn't that just searching for a specific hex string? (BL + address of the function)
Pretty much. The branches are done with relative addressing, so the value would be based off of the distance from the call to the actual function.
Oh, I just assumed it used absolute addressing. It makes a lot more sense to have a tool when each function call uses a different value (which is the case, apparently).

Quote
Think of "Database_address" As one of the sub-editors in the editor.
Think of "Entry_Number" as one of the items in the main list of a sub-editor.
Num_of_byte_in_entry could be based off everything that is editable for a partically item.
Byte_num_in_entry would be the actual attribute you are dealing with for the particular item. (Like when you go to edit a stat, or other value in the editor, or something.)
Ok, I get it. This doesn't lead to the address being written differently though, so it's not really what I was asking about (you already cleared up my confusion, thank you very much), but I suppose it's the best method to calculate the address of a byte within a given data structure.

That should be all, I need to take some time and figure stuff out on my own if I'm going to get anywhere with this. But I think I'm more likely to ask questions about using VBA-SDL-H to begin with than actual ASM questions (I hope that's still relevant to this topic).
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: 2393

« Reply #10 on: January 28, 2013, 11:38:25 AM »

Well the entire image here: http://forum.goldensunhacking.net/index.php?action=dlattach;topic=1421.0;attach=915;image is djinn related, so I suppose you could put the branch at 080AE8D4 or 080AE8e8 depending on if you want Flint and Fizz, and point the branch to 080AE9A4? (Maybe.) I'm not sure what is outside of the area the image shows at the moment, though. (Since I haven't really looked.)

*Looks at the start of the function and sees a read_flag(x800)* This should be the Flint flag for Isaac's party... Hmm... If on, jump to end of function? (This is before you are giving Flint, in the code.) ; It may be possible that you want to skip the entire function itself.


All branches seem to be done relatively, except for when you load a pointer into a register.


Okay...
Okay.
« Last Edit: January 28, 2013, 12:02:56 PM by Teawater » 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...
Did you know? In English, you are suppose to capitalize the languages. (e.g. English is a proper noun.) Subjects like math, science, history can be left lower-cased unless they are a title. (Kind of like how you can say either "my mom" or "Mom" in "I went with (X) to the store.", except that I don't think languages are ever lower-cased in English.) In Spanish, both subjects and languages are left lower-cased. (I put this here because I've noticed people make this mistake quite often. And am curious if they know about this, and whether they use their way because they believe this grammar usage should have never been a thing?

Remember kids! In getting a job, it's not about what you know, it's about WHO you know! So start making friends with the people that work where you want to work. :) (Friend of a friend and volunteering count too, so keep that in mind.)[/si
View Profile
Misery
Bad Luck

Great Member
***

Coins: 2
Offline Offline

Gender: Male
Clan Position: Mercury Hack Leader
Posts: 709

« Reply #11 on: January 01, 2014, 12:54:01 PM »

I think I'm more likely to ask questions about using VBA-SDL-H to begin with than actual ASM questions (I hope that's still relevant to this topic).
Looks like I was right about this...

How do I place a breakpoint write in VBA-SDL-H? The manual mentions how to place breakpoints for when an address is read from, and "execution" breakpoints, which if I've understood them correctly take effect when the instruction at a certain address is executed. But I can't find anything for when an address is written to.

And... did I really write that in January? Man, a year sure goes by quickly...

EDIT: lol nevermind, I found it. And it was mentioned in the same section as read breakpoints too... >.<
« Last Edit: January 01, 2014, 12:58:37 PM by Misery » 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: 2393

« Reply #12 on: January 02, 2014, 01:16:17 AM »

Some info if you need it...

There is a VBA-SDL-H2 version I found on pokecommunity once, but didn't see a way to do breakpoint read or write.

Anyway, for SDL-H, the main commands you need to know are these:

bpr = Breakpoint Read
bpw = Breakpoint Write
bt = Breakpoint Thumb (I think there is a bug for this one in SDL-H, so I often like to use rtt instead. Which I forget if it too includes the bug or not.)(ba/rta? for Arm)
n = Execute next instruction
c = Continue execution

There are some other useful commands as well, but I wanted to say that the No$gba NDS debugger works a bit different. For one, it's not a command prompt, and you use [address]! for writes (only works when the value is actually changed, I thin, unlike SDL-H), and you use [address]? for reads...


So what are you trying to do in SDL-H anyway?
« Last Edit: January 02, 2014, 01:19:07 AM by Teawater » 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...
Did you know? In English, you are suppose to capitalize the languages. (e.g. English is a proper noun.) Subjects like math, science, history can be left lower-cased unless they are a title. (Kind of like how you can say either "my mom" or "Mom" in "I went with (X) to the store.", except that I don't think languages are ever lower-cased in English.) In Spanish, both subjects and languages are left lower-cased. (I put this here because I've noticed people make this mistake quite often. And am curious if they know about this, and whether they use their way because they believe this grammar usage should have never been a thing?

Remember kids! In getting a job, it's not about what you know, it's about WHO you know! So start making friends with the people that work where you want to work. :) (Friend of a friend and volunteering count too, so keep that in mind.)[/si
View Profile
Thunder-squall
Mercury Clan

Great Member
*

Coins: 0
Offline Offline

Posts: 538

« Reply #13 on: January 02, 2014, 03:29:35 AM »

Did a google search for "GBATEK," and scanned this thread.  Still can't follow much.  While I can't ask that you guys make tutorials for noobs, I'd say you're not doing yourselves any favors in terms of recruitment.  In your OP, could you link to an index of acronyms, and perhaps to some starter sites?

Side question:  From reading above, it seems that the main changes people are making are with parameters (attack, defense, etc).  Have you been able to add and take away djinn from the game?  Or give enemy attacks to players?  It might even be neat to come across a bunch of enemies who, at the time of battle, have the exact same stats and abilities as the players.  Are these things which are ultimately possible through hacking?
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: 2393

« Reply #14 on: January 02, 2014, 05:34:54 AM »

GBATEK is one of them documents that would be hard to understand at-first, until you understand. (Which may take a long time.) And when you do understand, it's the GBA/DS Hacking Bible. Useful for anything concerning GBA and DS hardware. (As well as externals like e-Reader, Action Replay, Gameshark, etc.) The CPU - Thumb Instructions Set might be notable for people wanting to learn thumb assembly. Although, I recommend actually using SDL-H in the process, so one can see how the operations work in real-time.

Giving people djinn and removing them from the party is done in Map Code, where they call a function with arguments/parameters for the djinn. (Or you could just go and edit the RAM values for the djinn themselves if you did it manually.)

Giving enemy attacks to players is done in Classes and Abilities tables.

Would any enemy have the EXACT same stats AND abilities? That sounds mostly illogical unless you had a clone for an enemy, maybe.
« Last Edit: January 02, 2014, 05:37:16 AM by Teawater » 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...
Did you know? In English, you are suppose to capitalize the languages. (e.g. English is a proper noun.) Subjects like math, science, history can be left lower-cased unless they are a title. (Kind of like how you can say either "my mom" or "Mom" in "I went with (X) to the store.", except that I don't think languages are ever lower-cased in English.) In Spanish, both subjects and languages are left lower-cased. (I put this here because I've noticed people make this mistake quite often. And am curious if they know about this, and whether they use their way because they believe this grammar usage should have never been a thing?

Remember kids! In getting a job, it's not about what you know, it's about WHO you know! So start making friends with the people that work where you want to work. :) (Friend of a friend and volunteering count too, so keep that in mind.)[/si
View Profile
Pages: [1] 2 3 ... 7   Go Up
  Print  
 
Jump to:  

Cbox
Yesterday at 09:19:38 PM
Fox: Okay, so that Summon Night games adds the fram number to the seed, before generating another seed via mul/add....  (GS1-GS3 never adds the fram number.) ... So um, that makes sense! ;  Summon Night:  ((seed + frame) * 0x343FD + 0x269E3C) >> 0x10 ; Which is also on the list here: https://en.wikipedia.org/wiki/Linear_congruential_generator
December 12, 2017, 11:10:45 PM
Fox: Yes, and there could be contests. Maybe ones where 1st/2nd/3rd place get a cash reward, but eh. Dunno.... Kind of thinking about making a topic about how people got their job, and what was their experience. (e.g. Did they use references of people already working in the job, and various other things.)
December 09, 2017, 04:24:14 AM
Majora: Import old forum posts for reference, perhaps take posts containing important info like documentation away from the old stickied forum post model and make them into their own pages on a site with an in-built search bar. Might help with SEO, too. If nothing else, perhaps whipping them into PDFs and hosting them via Scribd? The possibilities are boundless when it comes to restructuring a site
December 09, 2017, 04:20:02 AM
Majora: Just a nice idea to have even if it doesn't come to fruition. Updating, modernizing, always a good idea. Could probably do something pretty nifty using a good Wordpress theme
December 09, 2017, 04:15:45 AM
Majora: Would be kind of neat to do something like that for GSHC. Could change it up a bit to show all tweets/instagram posts/facebook posts/golden sun subreddit posts all in one sidebar. It would be cool in that it gives the site it's on (and the topic in general) appear more lively and active, which is a plus
December 09, 2017, 04:14:19 AM
Majora: That does sound interesting. One cool thing I've seen some sites use is a sort of unique take on a sidebar option that acts like a social media integration (like, "See GSHC's latest Tweets"). It displays activity from a variety of related sites, such as Reddit, Twitter, Instagram, etc.
December 09, 2017, 12:58:53 AM
Fox: And the way it'd work via code is not that all users would instantly get nicknames the minute you register... but rather, the moment you view a name if it doesn't have a nickname, it gets one. (My Thoughts.)
December 09, 2017, 12:53:55 AM
Fox: (I was thinking that it would be "Name (Nickname)" ... The nickname is what you first known the user as, and you can change that yourself... and the Name is what the user wants to be called... Something like that.
December 09, 2017, 12:47:56 AM
Fox: So like... for starters, one idea I had was to make it so anyone can name anyone... much like how it works on Skype, and you (the namer) would be the only one to see it, and such...
December 09, 2017, 12:45:02 AM
Fox: Would need to be carefully thought out and tested, though.
December 09, 2017, 12:43:02 AM
Fox: I'm thinking I could make it so that name changes can happen whenever... (Without any limit)... Since I believe there's a way to do it with minimum confusion. (I think.) Hmm....
December 09, 2017, 12:31:36 AM
Fox: (I mean an offline version... at least initially.)
December 09, 2017, 12:25:01 AM
Fox: Now that I have thought about it a bit more, would I be right to assume that GSHC would be one of the most interesting websites to administrate, or no? It's sad to see not much going on with it. == I almost want to make a concept website at some point. :D Anyway, how is everyone doing today?
December 06, 2017, 12:12:59 AM
Fox: Like... Start using Github or something... Do like how many of those other projects such as Citra (WIP 3DS Emulator) does. Etc.
December 06, 2017, 12:08:12 AM
Fox: No idea. I just wish OpenGoldenSun would release it as unfinished, but oh well.
December 05, 2017, 06:52:09 AM
MaxiPower: Bummed out that the open golden sun project is dead it seems with no actitivy in close to a year at this point. Is there any hope left in any other projects?
November 27, 2017, 10:25:28 AM
Fox: (When I say research, mainly refering to the data in the game, though checking websites can count to a degree.)
November 27, 2017, 09:52:27 AM
Fox: Maybe. But Dark Dawn is meh, hahah... I still research it, though, because data can be interesting.
November 27, 2017, 05:28:36 AM
Portakin: I'm here! This game is underrated!
November 25, 2017, 08:03:23 PM
Fox: .... and the email listed in that post makes me think we should just make a new rules topic with most of the same information. (So the old ones can be sort o archived.)

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