Guest User

AHK example for Shabrout

a guest
Oct 31st, 2013
595
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1.  
  2. 1::
  3. {
  4. MsgBox % "P1's X-position = " . P1POSX() . "`nP2's X-position = " . P2POSX() . "`n" . SIDES()
  5. }
  6.  
  7.  
  8. P1POSX()
  9. {
  10. Program := "SSFIVAE"
  11. Address := 0x00400000
  12. Offset := 0x0080F0CC
  13. Value := ReadMemory( Address+Offset, Program)
  14. Address := Value
  15. Offset := 0x8
  16. Value := ReadMemory( Address+Offset, Program)
  17. Address := Value
  18. Offset := 0x60
  19. Value := ReadMemory( Address+Offset, Program)
  20.  
  21. Value := HexToFloat(Value)
  22.  
  23. return Value
  24. }
  25.  
  26.  
  27. P2POSX()
  28. {
  29. Program := "SSFIVAE"
  30. Address := 0x00400000
  31. Offset := 0x0080F0CC
  32. Value := ReadMemory( Address+Offset, Program)
  33. Address := Value
  34. Offset := 0xc
  35. Value := ReadMemory( Address+Offset, Program)
  36. Address := Value
  37. Offset := 0x60
  38. Value := ReadMemory( Address+Offset, Program)
  39.  
  40. Value := HexToFloat(Value)
  41.  
  42. return Value
  43. }
  44.  
  45.  
  46. SIDES()
  47. {
  48. if (P1POSX() > P2POSX())
  49. {
  50. return "P1 is to the right, and P2 is to the left"
  51. }
  52. else
  53. {
  54. return "P1 is to the left, and P2 is to the right"
  55. }
  56. }
  57.  
  58.  
  59. HexToFloat(x)
  60. {
  61. Return (1-2*(x>>31)) * (2**((x>>23 & 255)-150)) * (0x800000 | x & 0x7FFFFF)
  62. }
  63.  
  64.  
  65. ReadMemory(MADDRESS,PROGRAM)
  66. {
  67. winget, pid, PID, %PROGRAM%
  68.  
  69. VarSetCapacity(MVALUE,4,0)
  70. ProcessHandle := DllCall("OpenProcess", "Int", 24, "Char", 0, "UInt", pid, "UInt")
  71. DllCall("ReadProcessMemory","UInt",ProcessHandle,"UInt",MADDRESS,"Str",MVALUE,"UInt",4,"UInt *",0)
  72.  
  73. Loop 4
  74. result += *(&MVALUE + A_Index-1) << 8*(A_Index-1)
  75.  
  76. return, result
  77. }
Advertisement
Add Comment
Please, Sign In to add comment