Advertisement
RedouaneRed1

NFSMW 2012 : Make Opponents Fly

Jan 20th, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. [enable]
  2. assert(player_car,**)
  3. alloc(forall,1024)
  4. label(start_time)
  5. label(amount)
  6. label(alreadystarted)
  7. label(clean_and_skip)
  8. label(carscount)
  9. label(returnforall)
  10. label(activated)
  11. registersymbol(activated)
  12. forall:
  13. cmp byte ptr[activated], 0
  14. jz skip
  15. // ITS ACTIVATED
  16. push edi
  17. push eax
  18. call GetTickCount
  19. mov ecx, [start_time]
  20. test ecx, ecx
  21. jnz alreadystarted
  22. mov [start_time], eax
  23. alreadystarted:
  24. sub eax,[start_time]
  25. cmp eax, 5
  26. pop eax
  27. jle stillactive
  28. mov byte ptr[activated], 0
  29. mov [start_time], 0
  30. //CLEAN ARRAY
  31. mov ecx, [carscount]
  32. lea edi, [cars]
  33. push eax
  34. xor eax, eax
  35. rep stosd
  36. mov [carscount],0
  37. pop eax
  38. jmp clean_and_skip
  39. stillactive:
  40. mov edi,[player_car]
  41. cmp edi, eax
  42. jz clean_and_skip
  43. lea edi, [cars]
  44. // SEARCH FOR eax IN cars ARRAY
  45. mov ecx, [carscount]
  46. repne scasd
  47. jz clean_and_skip
  48. //NOT FOUND IN ARRAY, AND NOT MY CAR
  49. mov [edi], eax // INSERT IN ARRAY
  50. inc [carscount]
  51. // MAKE IT FLY
  52. fld [eax+34]
  53. fadd [amount]
  54. fstp [eax+34]
  55. clean_and_skip:
  56. pop edi
  57. skip:
  58. db 0f 28 40 30 8b 44 24 04
  59. jmp returnforall
  60. activated:
  61. db 0
  62. start_time:
  63. dd 0
  64. amount:
  65. dd (float)20.0
  66. carscount:
  67. dd 0
  68. cars:
  69. "NFS13.exe"+5903E6:
  70. jmp forall
  71. db 90 90 90
  72. returnforall:
  73. [disable]
  74. dealloc(forall)
  75. "NFS13.exe"+5903E6:
  76. db 0f 28 40 30 8b 44 24 04
  77. unregistersymbol(activated)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement