• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Help Thread: ASM & Disassembly

Status
Not open for further replies.

jiangzhengwenjzw

now working on katam
181
Posts
11
Years
    • Seen yesterday
    That's all you need yes. The other things do no harm (apart from the .hword 0x0), but they can cause errors in the case of a typo, bring confusion, and I just find it a hassle putting them there every time.

    That's really very strange. Hackmew is the developer of his assembler, but he also wrote the ".text", ".thumb_func" in his routine. JPAN used some .hword 0x0 in his routine in his tutorial and he layed emphasis on this issue, believing that the code won't work without them.
    Thank you greatly, otherwise I will be misled by these two really awesome people. :)
     

    daniilS

    busy trying to do stuff not done yet
    409
    Posts
    10
    Years
    • Seen Jan 29, 2024
    That's really very strange. Hackmew is the developer of his assembler, but he also wrote the ".text", ".thumb_func" in his routine. JPAN used some .hword 0x0 in his routine in his tutorial and he layed emphasis on this issue, believing that the code won't work without them.
    Thank you greatly, otherwise I will be misled by these two really awesome people. :)

    Hackmew didn't develop the assembler, just the .bat file that makes assembling easier. The core itself comes from a really old DevkitARM.
    As for JPAN: he's a great hacker, but lacked understanding of some things (of course, he was a pioneer in the area) and his routines should never be used as quality examples for they're often really unoptimized and use too many things (example: he wrote a custom pokemon enc/decryptor while there is one ready in the ROM.)
     

    jiangzhengwenjzw

    now working on katam
    181
    Posts
    11
    Years
    • Seen yesterday
    Hackmew didn't develop the assembler, just the .bat file that makes assembling easier. The core itself comes from a really old DevkitARM.
    As for JPAN: he's a great hacker, but lacked understanding of some things (of course, he was a pioneer in the area) and his routines should never be used as quality examples for they're often really unoptimized and use too many things (example: he wrote a custom pokemon enc/decryptor while there is one ready in the ROM.)

    Really? Then that's really a mistake to read JPAN's document first for me.;-; I thought it was more detailed when I started learning assembly so I read it first...
    Another question if you have time to answer: How can you get the address of the encryptor/decryptor through diassembly? (I use no$gba instead of vba-sdl-h, for vba-sdl-h cannot work properly on my computer and I often get error. ;-;)
     

    daniilS

    busy trying to do stuff not done yet
    409
    Posts
    10
    Years
    • Seen Jan 29, 2024
    Really? Then that's really a mistake to read JPAN's document first for me.;-; I thought it was more detailed when I started learning assembly so I read it first...
    Another question if you have time to answer: How can you get the address of the encryptor/decryptor through diassembly? (I use no$gba instead of vba-sdl-h, for vba-sdl-h cannot work properly on my computer and I often get error. ;-;)

    Nah, his document is okay, that's the one I used myself to get into ASM. As for the enc/decryptor: www.romhack.me/database/23/fire-red-commonly-used-asm-rom-offsets/
     

    daniilS

    busy trying to do stuff not done yet
    409
    Posts
    10
    Years
    • Seen Jan 29, 2024
    This thread seems really useful! Thank you for giving me the link.
    But it's still a problem how to get those address. I do not have an idea of how to get them through disassembly.
    You'd probably set a break on reading the Pokémon data then trace back from there.
    Is it possible to create a random number ?

    Look at the link I just sent.
     

    jiangzhengwenjzw

    now working on katam
    181
    Posts
    11
    Years
    • Seen yesterday
    You'd probably set a break on reading the Pokémon data then trace back from there.


    Look at the link I just sent.

    Okay, I will just try. For VBA-SDL-H2, I don't know why the game returns to the very beginning unexpectedly sometimes. Maybe I have made some mistakes? I use VBA-SDL-H2, for the original VBA-SDL-H crashes as soon as it loaded the game. TAT
     

    daniilS

    busy trying to do stuff not done yet
    409
    Posts
    10
    Years
    • Seen Jan 29, 2024
    Okay, I will just try. For VBA-SDL-H2, I don't know why the game returns to the very beginning unexpectedly sometimes. Maybe I have made some mistakes? I use VBA-SDL-H2, for the original VBA-SDL-H crashes as soon as it loaded the game. TAT

    Why do you want to find the offset yourself though?
     

    jiangzhengwenjzw

    now working on katam
    181
    Posts
    11
    Years
    • Seen yesterday
    Why do you want to find the offset yourself though?

    Because that's a kind of experience in my opinion. Perhaps it may help me learn disassembly...
    But the debugger is a huge problem as almost all ASM tutorials use VBA-SDL-H, from Hackmew several years ago to FBI's tutorial last week..... Maybe the error was caused by my misuse. :(
     

    daniilS

    busy trying to do stuff not done yet
    409
    Posts
    10
    Years
    • Seen Jan 29, 2024
    Because that's a kind of experience in my opinion. Perhaps it may help me learn disassembly...
    But the debugger is a huge problem as almost all ASM tutorials use VBA-SDL-H, from Hackmew several years ago to FBI's tutorial last week..... Maybe the error was caused by my misuse. :(

    Nocash is better than vba-sdl-h.
     

    Blah

    Free supporter
    1,924
    Posts
    11
    Years
  • Ehh, I don't like the syntax on no$GBA, nor do I agree it's better. It's good if you're doing conditional breaks, otherwise VBA-SDL-H is my preferred choice because you can:
    1) Speed the emulation speed over 100% (no$ you cannot go much faster)
    2) Save states from VBA-SDL-H is supported by VBA emulators
    3) Register states are more clearly visible, and it shows the important info we care about
    4) A command help that's actually understandable and useful

    I wouldn't really say no$GBA's debugger is better. It has more features, but most of those features can be replaced by good debugging skills. An example would be when I tried to track changes in a dynamic address which was being read every frame in the game. I used VBA-SDL-H and instead I broke at the END of the memory randomizing function and was able to track it every time from there. In no$GBA this would've been the same process. So complicated debugging isn't even better, it's just conditional breaking (which is rare in itself).
     

    jiangzhengwenjzw

    now working on katam
    181
    Posts
    11
    Years
    • Seen yesterday
    Ehh, I don't like the syntax on no$GBA, nor do I agree it's better. It's good if you're doing conditional breaks, otherwise VBA-SDL-H is my preferred choice because you can:
    1) Speed the emulation speed over 100% (no$ you cannot go much faster)
    2) Save states from VBA-SDL-H is supported by VBA emulators
    3) Register states are more clearly visible, and it shows the important info we care about
    4) A command help that's actually understandable and useful

    I wouldn't really say no$GBA's debugger is better. It has more features, but most of those features can be replaced by good debugging skills. An example would be when I tried to track changes in a dynamic address which was being read every frame in the game. I used VBA-SDL-H and instead I broke at the END of the memory randomizing function and was able to track it every time from there. In no$GBA this would've been the same process. So complicated debugging isn't even better, it's just conditional breaking (which is rare in itself).

    I have vba-sdl-h,but it often crashes and vba-sdl-h2 have a problem that sometimes the game returns to the very beginning unexpectedly... Do you know the reason?
     

    Blah

    Free supporter
    1,924
    Posts
    11
    Years
  • I have vba-sdl-h,but it often crashes and vba-sdl-h2 have a problem that sometimes the game returns to the very beginning unexpectedly... Do you know the reason?
    Nope. I have no such problems. Remember you can't keep playing the game once a breakpoint is reached, or when you've hit F11. You need to hit "c" to get back.
     

    jiangzhengwenjzw

    now working on katam
    181
    Posts
    11
    Years
    • Seen yesterday
    Nope. I have no such problems. Remember you can't keep playing the game once a breakpoint is reached, or when you've hit F11. You need to hit "c" to get back.

    Actually I know that I should use the command c and I'm sure that it's not the problem.

    I may show my problem more detailed, in case someone can help.
    My problem is that VBA-SDL-H often crashes unexpectedly, I always get a window says that the program didn't work...
    For JPAN's VBA-SDL-H2, the game crashes after some progress and automatically returns to the "Game Freak" Screen...

    My operation system is Window 8.1.
     

    Blah

    Free supporter
    1,924
    Posts
    11
    Years
  • Actually I know that I should use the command c and I'm sure that it's not the problem.

    I may show my problem more detailed, in case someone can help.
    My problem is that VBA-SDL-H often crashes unexpectedly, I always get a window says that the program didn't work...
    For JPAN's VBA-SDL-H2, the game crashes after some progress and automatically returns to the "Game Freak" Screen...

    My operation system is Window 8.1.
    Yeah, I'm not sure why that would happen. I'm on Windows 7 and it works fine for me. I suppose if no$gba doesn't crash for you, then you should stick with that instead.
     

    jiangzhengwenjzw

    now working on katam
    181
    Posts
    11
    Years
    • Seen yesterday
    Yeah, I'm not sure why that would happen. I'm on Windows 7 and it works fine for me. I suppose if no$gba doesn't crash for you, then you should stick with that instead.

    You're right, but most tutorials taught me how to use vba-sdl-h instead of no$gba. Do U know a tutorial for noobs about debugging with no$gba? I only know how to add breakpoints with it.
     

    Blah

    Free supporter
    1,924
    Posts
    11
    Years
  • You're right, but most tutorials taught me how to use vba-sdl-h instead of no$gba. Do U know a tutorial for noobs about debugging with no$gba? I only know how to add breakpoints with it.

    Sorry, I do not know one personally. There is a user manual, with a mini tutorial which you could probably find with a quick google search. I don't think it's very beginner friendly though.
     

    jiangzhengwenjzw

    now working on katam
    181
    Posts
    11
    Years
    • Seen yesterday
    Sorry, I do not know one personally. There is a user manual, with a mini tutorial which you could probably find with a quick google search. I don't think it's very beginner friendly though.

    OK, then I will try to find one myself. Thank you for your reply.
    For the .hword 0x0 case, I asked someone yesterday, he said that the assember will automatically add "nop" if the label cannot be fetched by "ldr".
     
    Status
    Not open for further replies.
    Back
    Top