Advertisement
fastman92

Find ped IDs

Dec 17th, 2014
291
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 1.73 KB | None | 0 0
  1. {$CLEO}
  2. goto @start
  3. 0662: printstring "Code written by fastman92"
  4.  
  5. :start
  6. 0A8D: 0@ = read_memory 0x40122D size 4 virtual_protect false  // CModelInfo::ms_modelInfoPtrs
  7. 0A8D: 1@ = read_memory 0x407106 size 4 virtual_protect false  // _countof(CModelInfo::ms_modelInfoPtrs) / base ID of TXD files
  8.  
  9. 0A8D: 2@ = read_memory 0x4C67A1 size 4 virtual_protect false  // &IDE_peds_store
  10. 0A8D: 3@ = read_memory 2@ size 4 virtual_protect false  // IDE_peds_store.count
  11.  
  12. /////////////////////////////////////////////////////////
  13.  
  14. // Get address to beginning of CStore<CPedModelInfo>.array
  15. 0A8E: 4@ = 2@ + 4 // int ; offset of CStore.array
  16.  
  17. // Get address to end of CStore<CPedModelInfo>.array
  18. 0A90: 5@ = 3@ * 0x44 // int ; sizeof(CPedModelInfo)
  19. 005A: 5@ += 4@  // (int)
  20.  
  21. // Copy address of CModelInfo::ms_modelInfoPtrs to different variable that will be overwritten.
  22. 0085: 6@ = 0@ // (int)
  23.  
  24. // model ID
  25. 7@ = 0
  26.  
  27. // Loop over CModelInfo::ms_modelInfoPtrs
  28. while 001D:   1@ > 7@  // (int)
  29.     0A8D: 8@ = read_memory 6@ size 4 virtual_protect false  // read CBaseModelInfo*
  30.    
  31.     if and
  32.     002D:   8@ >= 4@  // (int)  ;   pointer >= beginning of CStore<CPedModelInfo>.array
  33.     001D:   5@ > 8@  // (int)     ; end of CStore<CPedModelInfo>.array > pointer
  34.     then
  35.    
  36.     wait 200
  37.        
  38.         while 8AB0:  not key_pressed 48
  39.         wait 0
  40.        
  41.         0AD1: show_formatted_text_highpriority "Found ped ID: %d Press 0 to continue." time 2000 7@
  42.         end
  43.     end    
  44.  
  45.     6@ += 4 // CBaseModelInfo** modelInfoPtr
  46.     7@ += 1 // model ID
  47. end
  48.  
  49. wait 200
  50. while 8AB0:  not key_pressed 48
  51. wait 0
  52. 0AD1: show_formatted_text_highpriority "FindPedIDs finished! Press 0 to exit the script" time 2000
  53. end
  54.  
  55. 0A93: end_custom_thread
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement