Advertisement
Squeetz

Everstone Breeding

Oct 16th, 2018
865
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ARM 1.13 KB | None | 0 0
  1. .thumb
  2.  
  3. .global EverstoneBreeding
  4.  
  5. .equ EVERSTONE, 0xC3
  6. .equ rom, 0x08000001
  7. .equ offset, 0xXXXXXX
  8.  
  9. .org 0x46208
  10.     push {r4-r7, lr}
  11.    
  12. .org 0x46216
  13.     mov r7, r2
  14.    
  15. .org 0x46224
  16.     add r4, r7, r1
  17.  
  18. .org 0x46234
  19.     ldr r4, jump
  20.     bx r4
  21.    
  22. .align 2
  23.     jump:   .word main + rom
  24.    
  25. .org 0x4629E
  26.     pop {r4-r7}
  27.    
  28. @sp+4 = PID
  29. @r7 = mother ptr (+0x8C = father ptr)
  30.    
  31. .org offset
  32. main:
  33.     mov r4, #0x0
  34.     str r4, [sp, #0x8]
  35.     str r4, [sp, #0xC]
  36. checkmother:
  37.     mov r0, r7
  38.     mov r1, #0xC
  39.     bl getattr
  40.     cmp r0, #EVERSTONE
  41.     bne checkfather
  42. getmothernature:
  43.     mov r0, r7
  44.     mov r1, #0x0
  45.     bl getattr
  46.     bl getnature
  47.     mov r7, r0
  48.     b natureloop
  49.    
  50. checkfather:
  51.     mov r0, r7
  52.     add r0, r0, #0x8C
  53.     mov r1, #0xC
  54.     bl getattr
  55.     cmp r0, #EVERSTONE
  56.     bne return
  57. getfathernature:
  58.     mov r0, r7
  59.     add r0, r0, #0x8C
  60.     mov r1, #0x0
  61.     bl getattr
  62.     bl getnature
  63.     mov r7, r0
  64. natureloop:
  65.     ldr r0, [sp, #0x4]
  66.     add r0, r0, #0x18
  67.     str r0, [sp, #0x4]
  68.     bl getnature
  69.     cmp r0, r7
  70.     bne natureloop
  71. return:
  72.     mov r0, r6
  73.     ldr r1, =(0x0804623C|1)
  74.     bx r1
  75.    
  76. getattr:
  77.     ldr r3, =(0x0803FBE8|1)
  78.     bx r3
  79.    
  80. getnature:
  81.     ldr r1, =(0x08042EB4|1)
  82.     bx r1
  83.    
  84. .align 2
  85. .pool
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement