Jump to content

[Tutorial] Creating custom Trainer/Berry e-Cards


BlackShark
 Share

Recommended Posts

This guide is for those who are interested in editing an actual trainer/berry e-Card to use with the real e-Reader. If you are capable of save editing or you are playing on an emulator it's probably easier to inject the trainer/berry into your save file directly.

Requirements

 

decodedcard.png.f71715f75a953d6f82a14357102fb443.png

 

Editing the raw e-Card

  1. Decode your raw e-Card with nedcenc like this: nedcenc.exe -i card.raw -d -o card.bin
  2. Open the decoded card in your hex editor.
  3. Copy the header (the first 83 (0x53) bytes as seen above) and save them for later.
  4. Copy and save the VPK (starting at offset 0x53 with "vpk0") into a new file. The full VPK size can be found at offset 0x51. Keep in mind that this is written as little endian, which means if these two byte are "81 07" the actual size is 0x781 (from 0x53-0x7D3). The rest of the decoded card is just padding, you can ignore/delete it for now.
  5. You have saved the VPK into a new file, now decompress it with nevpk: nevpk.exe -i trainer.vpk -d -o trainer_decompressed.vpk
  6. Open the decompressed VPK in your hex editor.
  7.  
    • For trainers: navigate to offset 0xD50, that's where the actual trainer data (ECT) is located, it's 188 (0xBC) bytes.
    • For berries: the data (ECB) is at offset 0x4EA, it's 530 (0x212) bytes.
  8.  
    • For trainers: replace the data from 0xD50-0xE0B with your custom trainer and save the file.
    • For berries: replace the data from 0x4EA-0xA19 with your custom berry.
  9. Compress your edited VPK with nevpk: nevpk.exe -i mytrainer.vpk -c -o mytrainer_compressed.vpk
  10. Note the size of your new compressed VPK!
  11. Create a new file in your hex editor and paste the header you have saved earlier in step 3.
  12. Paste your compressed VPK right after the header at offset 0x53.
  13. Now fix the VPK size at 0x51 to match the new size. Remember to write it as little endian!
  14. Fix the size info at 0x26:
    1. in the image above the value is 0x020F0622
    2. bit 9-23 is the same as your VPK size + 2
    3. bits are counted from left to right starting with 0
    4. the original VPK size is 0x781 + 2 = 0x783 or in bits 0000 0111 1000 0011
    5. 0x020F0622 in bits: 0000 0010 0000 1111 0000 0110 0010 0010
    6. convert your new VPK size into bits
    7. replace the bits marked in red in the size info
    8. convert the size info value back into hexadecimal
    9. write it back to offset 0x26
  15. Pad the card to a proper size of 2112 (0x840) bytes. You can fill the area after the VPK until 0x83F with FF.
  16. Fix the cards checksums by droping it on headerfix.exe and you are done!
  17. You are done! You can now encode your edited card back into a raw e-Card: nedcenc.exe -i custom.bin -e -o custom.raw

 

You can use the dotcode printer from the devtools for printing, it can print dotcodes in raw or bmp format. Keep the DPI at 300, choose your card and your printer and print it!
You could as well just convert your raw card into bmp (raw2bmp.exe -i card.raw -o card.bmp) and print that.

 

So, I hope everything was clear enough, if there are still questions feel free to ask!

  • Like 2
  • Thanks 2
Link to comment
Share on other sites

  • BlackShark changed the title to [Tutorial] Creating custom Trainer e-Cards
  • BlackShark changed the title to [Tutorial] Creating custom Trainer/Berry e-Cards

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...