Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <stdint.h>
- typedef uint8_t u8;
- typedef uint16_t u16;
- typedef uint32_t u32;
- typedef signed char s8;
- typedef signed short s16;
- typedef signed int s32;
- typedef struct{
- u16 ID;
- u16 unk;
- u8 form;
- u8 level;
- s8 ability;
- s8 nature;
- u8 shiny;
- u8 unk2;
- u8 unk3;
- u8 unk4;
- u32 heldItem;
- s8 gender;
- u8 unk5;
- s16 metLoc;
- u16 move;
- s8 IV[6];
- u8 contestStat[6];
- u8 unk6;
- u8 unk7;
- } Pokemon;
- int main(int argc, char **argv){
- char *buf = (void*)malloc(0x1B0);
- Pokemon *pkmn = NULL;
- FILE *fp;
- fp = fopen(argv[1], "rb");
- if(!fp){
- printf("File can't open!\n");
- return 1;
- }
- fseek(fp, 0xF906C, SEEK_SET);
- fread(buf, 1, 0x1B0, fp);
- fclose(fp);
- pkmn = (void*)buf;
- int i; for(i=0;i<12;i++)
- printf( "Pkmn%d:\n"
- "\tIndex= %d\n"
- "\tLevel= %d\n"
- "\tForm= %d\n"
- "\tAbility= %d\n"
- "\tNature= %d\n"
- "\tShiny= %d\n"
- "\tHeldItem= %d\n"
- "\tGender= %d\n",
- i+1,
- pkmn[i].ID,
- pkmn[i].level,
- pkmn[i].form,
- pkmn[i].ability,
- pkmn[i].nature,
- pkmn[i].shiny,
- pkmn[i].heldItem,
- pkmn[i].gender
- );
- free(buf);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement