Advertisement
Bond697

OS_GetLowEntropyData Assembly

Jun 1st, 2012
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. RAM_ARM9:02088180             ; u32 __fastcall OS_GetLowEntropyData__(u32 *buffer)
  2. RAM_ARM9:02088180             OS_GetLowEntropyData__                  ; CODE XREF: buildSeed__+14p
  3. RAM_ARM9:02088180                                                     ; sub_20595A0+14p
  4. RAM_ARM9:02088180 70 40 2D E9                 STMFD   SP!, {R4-R6,LR} ; OS_GetLowEntropyData(u32 buffer[OS_LOW_ENTROPY_DATA_SIZE / sizeof(u32)]);
  5. RAM_ARM9:02088180                                                     ; Buffer is in DTCM @ 2FE36AC, White (U)
  6. RAM_ARM9:02088184 B0 10 9F E5                 LDR     R1, VCOUNT      ; VCOUNT @ =0x4000006
  7. RAM_ARM9:02088188 00 50 A0 E1                 MOV     R5, R0
  8. RAM_ARM9:0208818C B0 60 D1 E1                 LDRH    R6, [R1]        ; *VCOUNT into R6
  9. RAM_ARM9:02088190 A8 40 9F E5                 LDR     R4, =0x2FFFC00
  10. RAM_ARM9:02088194 FB FB FF EB                 BL      OS_GetTickLo__  ; get timer0
  11. RAM_ARM9:02088198 06 08 80 E1                 ORR     R0, R0, R6,LSL#16 ; (*VCOUNT << 16) | *timer0
  12. RAM_ARM9:0208819C 00 00 85 E5                 STR     R0, [R5]
  13. RAM_ARM9:020881A0 9C 00 9F E5                 LDR     R0, =0x2151358
  14. RAM_ARM9:020881A4 B8 1F D4 E1                 LDRH    R1, [R4,#0xF8]
  15. RAM_ARM9:020881A8 00 20 90 E5                 LDR     R2, [R0]
  16. RAM_ARM9:020881AC 04 30 90 E5                 LDR     R3, [R0,#4]
  17. RAM_ARM9:020881B0 01 18 22 E0                 EOR     R1, R2, R1,LSL#16
  18. RAM_ARM9:020881B4 04 10 85 E5                 STR     R1, [R5,#4]
  19. RAM_ARM9:020881B8 00 20 90 E5                 LDR     R2, [R0]
  20. RAM_ARM9:020881BC 84 20 9F E5                 LDR     R2, GxStat      ; GxStat @ =0x4000600
  21. RAM_ARM9:020881C0 04 10 90 E5                 LDR     R1, [R0,#4]
  22. RAM_ARM9:020881C4 F4 00 94 E5                 LDR     R0, [R4,#0xF4]
  23. RAM_ARM9:020881C8 3C 30 94 E5                 LDR     R3, [R4,#0x3C]
  24. RAM_ARM9:020881CC 00 00 21 E0                 EOR     R0, R1, R0
  25. RAM_ARM9:020881D0 00 30 23 E0                 EOR     R3, R3, R0
  26. RAM_ARM9:020881D4 08 30 85 E5                 STR     R3, [R5,#8]
  27. RAM_ARM9:020881D8 00 10 92 E5                 LDR     R1, [R2]
  28. RAM_ARM9:020881DC 03 0C 84 E2                 ADD     R0, R4, #0x300
  29. RAM_ARM9:020881E0 01 10 23 E0                 EOR     R1, R3, R1
  30. RAM_ARM9:020881E4 08 10 85 E5                 STR     R1, [R5,#8]
  31. RAM_ARM9:020881E8 E8 11 94 E5                 LDR     R1, [R4,#0x1E8] ; grab the date
  32. RAM_ARM9:020881EC 4D 2E 42 E2                 SUB     R2, R2, #0x4D0  ; gxstat(4000600)-4D0 = 4000130(gba-compatible controller input)
  33. RAM_ARM9:020881F0 0C 10 85 E5                 STR     R1, [R5,#0xC]
  34. RAM_ARM9:020881F4 EC 31 94 E5                 LDR     R3, [R4,#0x1EC] ; grab the time
  35. RAM_ARM9:020881F8 EA 1F 84 E2                 ADD     R1, R4, #0x3A8  ; 2FFFFA8 - nds-compatible input
  36. RAM_ARM9:020881FC 10 30 85 E5                 STR     R3, [R5,#0x10]
  37. RAM_ARM9:02088200 B4 C9 D0 E1                 LDRH    R12, [R0,#0x94]
  38. RAM_ARM9:02088204 90 33 94 E5                 LDR     R3, [R4,#0x390]
  39. RAM_ARM9:02088208 0C 38 23 E0                 EOR     R3, R3, R12,LSL#16
  40. RAM_ARM9:0208820C 14 30 85 E5                 STR     R3, [R5,#0x14]
  41. RAM_ARM9:02088210 BA 4A D0 E1                 LDRH    R4, [R0,#0xAA]
  42. RAM_ARM9:02088214 BC 3A D0 E1                 LDRH    R3, [R0,#0xAC]
  43. RAM_ARM9:02088218 04 38 83 E1                 ORR     R3, R3, R4,LSL#16
  44. RAM_ARM9:0208821C 18 30 85 E5                 STR     R3, [R5,#0x18]
  45. RAM_ARM9:02088220 B0 20 D2 E1                 LDRH    R2, [R2]        ; get gba-compatible input
  46. RAM_ARM9:02088224 B0 10 D1 E1                 LDRH    R1, [R1]        ; get nds-only input
  47. RAM_ARM9:02088228 B8 39 D0 E1                 LDRH    R3, [R0,#0x98]
  48. RAM_ARM9:0208822C 01 00 82 E1                 ORR     R0, R2, R1      ; OR the inputs together to make 1 number: (3FF | 2C00) = 2FFF, etc
  49. RAM_ARM9:02088230 03 08 80 E1                 ORR     R0, R0, R3,LSL#16
  50. RAM_ARM9:02088234 1C 00 85 E5                 STR     R0, [R5,#0x1C]
  51. RAM_ARM9:02088238 70 80 BD E8                 LDMFD   SP!, {R4-R6,PC}
  52. RAM_ARM9:02088238             ; End of function OS_GetLowEntropyData__
  53. RAM_ARM9:02088238
  54. RAM_ARM9:02088238             ; ---------------------------------------------------------------------------
  55. RAM_ARM9:0208823C 06 00 00 04 dword_208823C   DCD                     ; DATA XREF: OS_GetLowEntropyData__+4r
  56. RAM_ARM9:02088240 00 FC FF 02 dword_2088240   DCD 0x2FFFC00           ; DATA XREF: OS_GetLowEntropyData__+10r
  57. RAM_ARM9:02088244 58 13 15 02 dword_2088244   DCD 0x2151358           ; DATA XREF: OS_GetLowEntropyData__+20r
  58. RAM_ARM9:02088248 00 06 00 04 dword_2088248   DCD                     ; DATA XREF: OS_GetLowEntropyData__+3Cr
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement