CodeTypesGuide.txt 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  1. omments: 1
  2. A Compendium of Gamecube Action Replay Code Types
  3. Note: This is note a Complete code type list.
  4. The purpose of this document is to catalogue and explain the effects of different AR code types in a clear, concise, and easy to read format. Please note that this document is not intended to explain EVERY code type, only those of interest to the amateur hacker.
  5. It would not have been possible to write this document without Kenobi's "GCN AR CODES TYPES EXPLANATION", found at www.GSCentral.com, so a big thank-you goes to Kenobi and Parasyte for their contributions to the GCN hacking scene.
  6. Kenobi's documentation is recommended reading as it is very complete, precise, and exact in it's explanations. However, that is also it's main flaw, it's TOO complex and technical for the casual or newbie hacker to understand. If "Address = ((0x0wXXXXXXX) AND 0x01FFFFFF) OR 0x80000000)" makes any sense to you, then I implore you to read Kenobi's guide instead. The intended audience for this document is people who'd rather have things explained in plain English.
  7. It should be noted that every decrypted AR code has a basic two-part format that is universal to every code. The first half contains the code type and address to be written to. The second half contains the value to be written.
  8. The Gamecube has a memory range of 80000000 - 817FFFFF (cached), or C0000000 - C17FFFFF (uncached). However for the sake of simplicity, the AR uses an offset number in the range of 00000000 - 017FFFFF. The code type identifier is an 8-bit value that is applied to the first two digits of the offset. For example, if your offset is 00012345, and you wish to perform a 32-bit write (04), you simply add (04000000) + (00012345) = 04012345.
  9. In order to conserve space and simplicity, only the 8-bit code type identifier and particulars of the second half of the code will be explained below, as the method for procuring the first half has already been described above ;)
  10. Terms:
  11. 8-bit - Byte - 0x12
  12. 16-bit - Halfword - 0x1234
  13. 32-bit - Word - 0x12345678
  14. ---Writes---
  15. (00) - NNNNNNXX
  16. 8-bit write. X is the value, N is the number of times to repeat.
  17. (02) NNNNXXXX
  18. 16-bit write. X is the value, N is the number of times to repeat.
  19. (04) XXXXXXXX
  20. 32-bit write. X is the value.
  21. Examples:
  22. 00006500 00000312
  23. Will write byte 0x12 to 80006500, 80006501, 80006502, 800067503.
  24. 02006500 00011234
  25. Will write halfword 0x1234 to 80006500, 80006502.
  26. 05006500 12345678
  27. Will write word 0x12345678 to 81006500.
  28. ---Addition---
  29. (80) - 000000XX
  30. 8-bit Addition. Load the byte at the address, add X to it, and save resulting byte.
  31. (82) - 0000XXXX
  32. 16-bit Addition. Load the halfword at the address, add X to it, and save resulting halfword.
  33. (84) - XXXXXXXX
  34. 32-bit Addition. Load the word at the address, add X to it, and save resulting word.
  35. ---Single Line Activators---
  36. ***Equal***
  37. (08) 000000XX
  38. 8-bit Equal activator.
  39. (0A) 0000XXXX
  40. 16-bit Equal activator.
  41. (0C) XXXXXXXX
  42. 32-bit Equal activator.
  43. X is the value the address must equal to activate the next line of code.
  44. ***NOT Equal***
  45. (10) 000000XX
  46. 8-bit NOT Equal activator.
  47. (12) 0000XXXX
  48. 16-bit NOT Equal activator.
  49. (14) XXXXXXXX
  50. 32-bit NOT Equal activator.
  51. If the value stored at the address is not equal to X, activate the next line of code.
  52. ***If Lower (signed)***
  53. (18) 000000XX
  54. 8-bit If Lower (signed) activator.
  55. (1A) 0000XXXX
  56. 16-bit If Lower (signed) activator.
  57. (1C) XXXXXXXX
  58. 32-bit If Lower (signed) activator.
  59. If the value stored at the address is lower than X, activate the next line of code.
  60. ***If Higher (signed)***
  61. (20) 000000XX
  62. 8-bit If Higher (signed) activator.
  63. (22) 0000XXXX
  64. 16-bit If Higher (signed) activator.
  65. (24) XXXXXXXX
  66. 32-bit If Higher (signed) activator.
  67. If the value stored at the address is higher than X, activate the next line of code.
  68. ***If Lower (unsigned)***
  69. (28) 000000XX
  70. 8-bit If Lower (unsigned) activator.
  71. (2A) 0000XXXX
  72. 16-bit If Lower (unsigned) activator.
  73. (2C) XXXXXXXX
  74. 32-bit If Lower (unsigned) activator.
  75. If the value stored at the address is lower than X, activate the next line of code.
  76. ***If Higher (unsigned)***
  77. (30) 000000XX
  78. 8-bit If Higher (unsigned) activator.
  79. (32) 0000XXXX
  80. 16-bit If Higher (unsigned) activator.
  81. (34) XXXXXXXX
  82. 32-bit If Higher (unsigned) activator.
  83. If the value stored at the address is higher than X, activate the next line of code.
  84. ---Double Line Activators---
  85. ***Equal***
  86. (48) 000000XX
  87. 8-bit activator.
  88. (4A) 0000XXXX
  89. 16-bit activator.
  90. (4C) XXXXXXXX
  91. 32-bit activator.
  92. X is the value the address must equal to activate the next two lines of code.
  93. ***NOT Equal***
  94. (50) 000000XX
  95. 8-bit NOT Equal activator.
  96. (52) 0000XXXX
  97. 16-bit NOT Equal activator.
  98. (54) XXXXXXXX
  99. 32-bit NOT Equal activator.
  100. If the value stored at the address is not equal to X, activate the next two lines of code.
  101. ***If Lower (signed)***
  102. (58) 000000XX
  103. 8-bit If Lower (signed) activator.
  104. (5A) 0000XXXX
  105. 16-bit If Lower (signed) activator.
  106. (5C) XXXXXXXX
  107. 32-bit If Lower (signed) activator.
  108. If the value stored at the address is lower than X, activate the next two lines of code.
  109. ***If Higher (signed)***
  110. (60) 000000XX
  111. 8-bit If Higher (signed) activator.
  112. (62) 0000XXXX
  113. 16-bit If Higher (signed) activator.
  114. (64) XXXXXXXX
  115. 32-bit If Higher (signed) activator.
  116. If the value stored at the address is higher than X, activate the next two lines of code.
  117. ***If Lower (unsigned)***
  118. (68) 000000XX
  119. 8-bit If Lower (unsigned) activator.
  120. (6A) 0000XXXX
  121. 16-bit If Lower (unsigned) activator.
  122. (6C) XXXXXXXX
  123. 32-bit If Lower (unsigned) activator.
  124. If the value stored at the address is lower than X, activate the next two lines of code.
  125. ***If Higher (unsigned)***
  126. (70) 000000XX
  127. 8-bit If Higher (unsigned) activator.
  128. (72) 0000XXXX
  129. 16-bit If Higher (unsigned) activator.
  130. (74) XXXXXXXX
  131. 32-bit If Higher (unsigned) activator.
  132. If the value stored at the address is higher than X, activate the next two lines of code.
  133. ---Multi-Line Activators---
  134. Note that all multi-line codes must end with the line 00000000 40000000.
  135. ***Equal***
  136. (88) 000000XX
  137. 8-bit activator.
  138. (8A) 0000XXXX
  139. 16-bit activator.
  140. (8C) XXXXXXXX
  141. 32-bit activator.
  142. X is the value the address must equal to activate the next lines of code.
  143. ***NOT Equal***
  144. (90) 000000XX
  145. 8-bit NOT Equal activator.
  146. (92) 0000XXXX
  147. 16-bit NOT Equal activator.
  148. (94) XXXXXXXX
  149. 32-bit NOT Equal activator.
  150. If the value stored at the address is not equal to X, activate the next lines of code.
  151. ***If Lower (signed)***
  152. (98) 000000XX
  153. 8-bit If Lower (signed) activator.
  154. (9A) 0000XXXX
  155. 16-bit If Lower (signed) activator.
  156. (9C) XXXXXXXX
  157. 32-bit If Lower (signed) activator.
  158. If the value stored at the address is lower than X, activate the next lines of code.
  159. ***If Higher (signed)***
  160. (A0) 000000XX
  161. 8-bit If Higher (signed) activator.
  162. (A2) 0000XXXX
  163. 16-bit If Higher (signed) activator.
  164. (A4) XXXXXXXX
  165. 32-bit If Higher (signed) activator.
  166. If the value stored at the address is higher than X, activate the next lines of code.
  167. ***If Lower (unsigned)***
  168. (A8) 000000XX
  169. 8-bit If Lower (unsigned) activator.
  170. (AA) 0000XXXX
  171. 16-bit If Lower (unsigned) activator.
  172. (AC) XXXXXXXX
  173. 32-bit If Lower (unsigned) activator.
  174. If the value stored at the address is lower than X, activate the next lines of code.
  175. ***If Higher (unsigned)***
  176. (B0) 000000XX
  177. 8-bit If Higher (unsigned) activator.
  178. (B2) 0000XXXX
  179. 16-bit If Higher (unsigned) activator.
  180. (B4) XXXXXXXX
  181. 32-bit If Higher (unsigned) activator.
  182. If the value stored at the address is higher than X, activate the next lines of code.
  183. ---Alignment---
  184. Codes must be properly aligned depending on the type of code.
  185. 8-bit codes can be used on ANY address.
  186. 16-bit codes must have an address that is a multiple of 2: 0,2,4,6,8,A,C,E.
  187. 32-bit codes must have an address that is a multiple of 4:0,4,8,C.
  188. If codes aren't aligned, they may not work, or may cause your AR to spaz out and kill your cat (R.I.P. Snowball).
  189. ---Signed & Unsigned Numbers---
  190. Unsigned means :
  191. For 8-bits : 0x00 -> 0xFF = 0 to 255.
  192. For 16-bits: 0x0000 -> 0xFFFF = 0 to 65535.
  193. For 32-bits: 0x00000000 -> 0xFFFFFFFF = 0 to 4294967295.
  194. Signed means :
  195. For 8-bits : 0x00 -> 0x7F = 0 to 127.
  196. 0x80 -> 0xFF = -127 to -1.
  197. For 16-bits: 0x0000 -> 0x7FFF = 0 to 32767.
  198. 0x8000 -> 0xFFFF = -32768 to -1.
  199. For 32-bits: 0x00000000 -> 0x7FFFFFFF = 0 to 2147483647.
  200. 0x80000000 -> 0xFFFFFFFF = -2147483648 to -1.