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

[ASM & Hex] How do I implement the XY experience capture hack?

FSBS

Defunct
147
Posts
9
Years
    • Seen Apr 19, 2019
    Where do I start with the following?

    https://www.pokecommunity.com/showpost.php?p=8308957&postcount=508

    I get that it's hex editing, but how do I find the battle script at 1d9a42? I mean, I know how to search/goto 1d9a42.

    Is the XX XX XX XX an offset I find in free space?

    Do I simply insert 2E E0 3F 02 02 00 2E 0C 3C 02 02 00 2E 0D 3C 02 02 00 23 00 10 0D 01 3A 2E 82 3E 02 02 00 F3 80 9A 1D 08 F0 13 54 E6 3F 08 12 40 00 28 81 9A 1D 08 into free space and have the XX XX XX XX point to that?

    Or is the battle script referred to at 1d9a42 a script I write in XSE? If so, is it available to simply plug in (I've no idea how to even begin to write such a script myself)?

    Is there a tutorial on how to do this?
     

    AkameTheBulbasaur

    Akame Marukawa of Iyotono
    409
    Posts
    10
    Years
  • Open your ROM in a Hex Editor. There should be a function that lets you search for a specific offset (for me it's control-G but it might be different depending on which editor you use).

    First you should put

    2E E0 3F 02 02 00 2E 0C 3C 02 02 00 2E 0D 3C 02 02 00 23 00 10 0D 01 3A 2E 82 3E 02 02 00 F3 80 9A 1D 08 F0 13 54 E6 3F 08 12 40 00 28 81 9A 1D 08

    into some free space and then put

    2A 00 68 3D 02 02 05 00 50 9A 1D 08 60 0B 10 0B 01 F1 XX XX XX XX 2E E0 3F 02 02 00 2E 0C 3C 02 02 00 2E 0D 3C 02 02 00 23 00 10 0F 01 3A 2E 82 3E 02 02 00 F2 10 0D 01 3A 2E 82 3E 02 02 00 F3 80 9A 1D 08 F0 13 54 E6 3F 08 12 40 00 28 81 9A 1D 08

    after that and have the XX XX XX XX point to where you inserted the first group of bytes. For example, if you put the first section at 0x908070, your XX XX XX XX would be 70 80 90 08 (you swap the places of the first and last byte and then add 08 to indicate that it's a pointer).

    Then you do the same thing at 0x1D9A42 except that you repoint to the second group of bytes you put in. You don't need to touch the battle script at all. That's what the code does for you, it edits the battle script so that you get capture exp.

    Hopefully that helped.
     

    FSBS

    Defunct
    147
    Posts
    9
    Years
    • Seen Apr 19, 2019
    Okay, so I inserted the first block into the first available free space I found at 71a270, then the next block at 71a240 with the pointer 70 a2 71 08, and then repeated the second block at 1D9A42 with the pointer 40 a2 71 08. I may have gotten the free space offsets mixed up in reporting results, but I did not place the blocks out of order.
    Every time I inserted, I was told it would change the file size. Is this normal? I simply pasted the numbers at the point the search function gave me.
    I booted up the game but it was a white screen. What did I do wrong? Am I supposed to highlight an equivalent number of blocks at 1D9A42?
     
    1,591
    Posts
    10
    Years
    • Seen Mar 20, 2024
    Whenever you're using a hex editor to paste things into the ROM, make sure you're using paste write rather than paste insert. Writing will just overwrite the free space bytes, while inserting something will relocate everything after the address you inserted it at (which is why you're getting the file size prompt); this will break any pointers that pointed to things in the relocated area, and likely destroy your ROM as a result.

    If you're using HxD, paste write is ctrl + B IIRC, but you can use the right click menu to be sure.
     

    FSBS

    Defunct
    147
    Posts
    9
    Years
    • Seen Apr 19, 2019
    Open your ROM in a Hex Editor. There should be a function that lets you search for a specific offset (for me it's control-G but it might be different depending on which editor you use).

    First you should put

    2E E0 3F 02 02 00 2E 0C 3C 02 02 00 2E 0D 3C 02 02 00 23 00 10 0D 01 3A 2E 82 3E 02 02 00 F3 80 9A 1D 08 F0 13 54 E6 3F 08 12 40 00 28 81 9A 1D 08

    into some free space and then put

    2A 00 68 3D 02 02 05 00 50 9A 1D 08 60 0B 10 0B 01 F1 XX XX XX XX 2E E0 3F 02 02 00 2E 0C 3C 02 02 00 2E 0D 3C 02 02 00 23 00 10 0F 01 3A 2E 82 3E 02 02 00 F2 10 0D 01 3A 2E 82 3E 02 02 00 F3 80 9A 1D 08 F0 13 54 E6 3F 08 12 40 00 28 81 9A 1D 08

    after that and have the XX XX XX XX point to where you inserted the first group of bytes. For example, if you put the first section at 0x908070, your XX XX XX XX would be 70 80 90 08 (you swap the places of the first and last byte and then add 08 to indicate that it's a pointer).

    Then you do the same thing at 0x1D9A42 except that you repoint to the second group of bytes you put in. You don't need to touch the battle script at all. That's what the code does for you, it edits the battle script so that you get capture exp.

    Hopefully that helped.

    I've done as you've said and still getting issues: after capture, the Pokemon menu opens and is stuck - I can't get out of it. Sometimes when throwing a pokeball the game restarts. I wrote the first block to 800090 and the second block to 8000D0, reversing the offsets in the blocks when necessary and pointing to the second block. Not sure what I'm doing wrong now.

    Edit: so then I put the second block immediately after the first block, and the game didn't restart, everything was working but as soon as the pokemon was added to the pokedex I came to the pokemon selection menu, with just my starter, and no way to get out. I could select my starter but not exit the menu.

    Edit 2: Solved using the following link: https://pokemonhackersonline.com/showthread.php?t=14839-FR-Pokemons-receive-EXP-after-capturing
     
    Last edited:
    Back
    Top