Golden Sun Hacking Community
February 25, 2018, 05:39:39 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 3 ... 7   Go Down
  Print  
Author Topic: Post your GBA ASM Questions here.  (Read 29587 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: 2407

« 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...

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 #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: 2407

« 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...

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
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: 1757

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

« 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...

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
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: 2407

« 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...

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
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: 2407

« 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...

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
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: 2407

« 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...

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
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: 2407

« 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...

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 3 ... 7   Go Up
  Print  
 
Jump to:  

Cbox
February 19, 2018, 09:50:20 PM
KyleRunner: "difficult thing about the army": I'm very good at taking orders, so I don't have issues with autority or discipline. The most difficult thing is to be away from my family sometimes. I lived an entire year away from my son, so I'd say that was the most hard part by far. Now it's great!
February 19, 2018, 05:51:35 AM
Fox: I'm happy to see we have plenty of people serving the country here. :)
February 19, 2018, 05:47:15 AM
Fox: Civilian here.
February 19, 2018, 03:05:38 AM
Majora: Good for you, something to be proud of. Air Force, here
February 19, 2018, 02:11:31 AM
Fox: That's good to hear... just checking if there were any possibility of doubt. What would you say was your most difficult thing about the army?
February 18, 2018, 12:39:38 PM
KyleRunner: Well, it was a destiny kinda thing, but I was very happy when I decided to join. It was just like I thought it would be (not in the beginning, though). I'm very pleased with my decision.
February 17, 2018, 11:32:41 PM
Fox: That's awesome!  Trying to figure what question I want to ask Something about how you felt when you made the decision to do the army, and whether it was different than your expectations/etc.
February 17, 2018, 01:53:41 PM
KyleRunner: Wow... My english got rusty. Anyway... I'm in the army now. My life turned 180. But I think it was for the best.
February 16, 2018, 12:45:45 AM
Fox: Hm? So where does that make you today?
February 16, 2018, 12:06:38 AM
KyleRunner: Five years ago I could not even imagine where I am today. I hope it works well for you too!
February 12, 2018, 07:22:50 PM
Fox: 2018 - The year that I will probably be working a manufacturing job. xP What would I have thought, if I told myself this five years ago. Eh?
January 28, 2018, 08:35:28 PM
Fox: You referring to changing the PC/leader sprite to someone else? - I forgot to mention that you can do this using VBA's memory viewer. (Found under Tools.)
January 28, 2018, 03:46:22 PM
shenlong: Hi, Im following up on @Raijinken's question about the sprite change... How do I access that to change it? and can you tell me what the values are for the characters? newbie here
January 26, 2018, 10:12:00 PM
roger: h a p p y  b i r t h d a y  z m a n
January 26, 2018, 01:38:04 AM
Fox: (Assuming you're going for "E")
January 26, 2018, 01:37:06 AM
Fox: So like... https://i.imgur.com/cI4Bgoy.png = Does not explain how it works, but follows this type of thinking.
January 25, 2018, 09:57:44 PM
Fox: Hm... Actually, this gives me an idea! What if the lighthouse becons on each lighthouse were actually portals?
January 25, 2018, 09:56:19 PM
Fox: Hard to explain without a diagram or something... but I could decide on that later. Right now, it turned out I dreamed of something! Something to do with going into the dark dimension... and to go between light and dark, required some energy (energy sphere/warp portal?) to be on... I forget most of the details of the dream now, but it's like you could get trapped in the dark world. Er...
January 25, 2018, 04:56:04 PM
KyleRunner: Can't understand... but... nice!
January 24, 2018, 06:20:33 AM
Fox: Third approach idea = Scan char tables and set up an array that helps to quickly jump over bits that are scanned in the char tables.... to kind of mimic an actual tree a bit better/ and reduce unnecessary scans.).... (untested, but what to know what it's speed is like.)

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.