(Lua, ASMx86) Replication of Devil May Cry 4's debug functions for it's re-released version.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

update-acquired-redorbs.txt 3.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. Devil May Cry 4: Special Edition
  2. Function Documentation
  3. Update 'Red Orbs Acquired' Count
  4. Context: This function executes right when the player collides with a Red Orb in the game.
  5. This function is not responsible for adding the total amount of Red Orbs, the player holds in a mission.
  6. x86 calling convention is stdcall.
  7. Disassembled Output
  8. ; this function takes one parameter from stack, value of red orb.
  9. dmc4se.exe+19A660 - push esi ;
  10. dmc4se.exe+19A661 - mov esi,eax ; esi = ptr to mediator
  11. dmc4se.exe+19A663 - cmp byte ptr [esi+1C],00 ;
  12. dmc4se.exe+19A667 - jne dmc4se.exe+19A672 ; jump to ntdll fn (enter).
  13. dmc4se.exe+19A669 - cmp byte ptr [dmc4se.exe+F23A58],00 ;
  14. dmc4se.exe+19A670 - je dmc4se.exe+19A67C ; jump to critical section
  15. dmc4se.exe+19A672 - lea eax,[esi+04] ;
  16. dmc4se.exe+19A675 - push eax ;
  17. dmc4se.exe+19A676 - call dword ptr [dmc4se.exe+B73198] ; ntdll.EnterCriticalSection
  18. dmc4se.exe+19A67C - cmp byte ptr [esi+0000019A],00 ; check if ignoring acquired orbs in a mission
  19. dmc4se.exe+19A683 - jne dmc4se.exe+19A68F ; jump if ignoring
  20. dmc4se.exe+19A685 - mov ecx,[esp+08] ; ecx = red orb value (on stack)
  21. dmc4se.exe+19A689 - add [esi+0000018C],ecx ; write to memory
  22. dmc4se.exe+19A68F - cmp byte ptr [esi+1C],00 ;
  23. dmc4se.exe+19A693 - jne dmc4se.exe+19A69E ; jump to ntdll fn (exit).
  24. dmc4se.exe+19A695 - cmp byte ptr [dmc4se.exe+F23A58],00 ;
  25. dmc4se.exe+19A69C - je dmc4se.exe+19A6A8 ; skip win32 api thread synch fn (exit)
  26. dmc4se.exe+19A69E - add esi,04 ; add to mediator ptr
  27. dmc4se.exe+19A6A1 - push esi ; push to stack as parameter
  28. dmc4se.exe+19A6A2 - call dword ptr [dmc4se.exe+B731A0] ; ntdll.ExitCriticalSection
  29. dmc4se.exe+19A6A8 - pop esi ;
  30. dmc4se.exe+19A6A9 - ret 0004 ; stdcall: one parameter
  31. Reformated Assembly
  32. ; this function takes one parameter from stack, value of red orb.
  33. update_redorbsacquired_count:
  34. push esi ;
  35. mov esi,eax ; esi = ptr to mediator
  36. cmp byte ptr [esi+1C],00 ;
  37. jne enter ; jump to ntdll fn (enter).
  38. cmp byte ptr [dmc4se.exe+F23A58],00 ;
  39. je critical_section ; jump to critical section
  40. enter:
  41. lea eax,[esi+04] ;
  42. push eax ;
  43. call dword ptr [dmc4se.exe+B73198] ; ntdll.EnterCriticalSection
  44. critical_section:
  45. cmp byte ptr [esi+0000019A],00 ; check if ignoring acquired orbs in a mission
  46. jne dmc4se.exe+19A68F ; jump if ignoring
  47. mov ecx,[esp+08] ; ecx = red orb value (on stack)
  48. add [esi+0000018C],ecx ; write to memory
  49. cmp byte ptr [esi+1C],00 ;
  50. jne exit ; jump to ntdll fn (exit).
  51. cmp byte ptr [dmc4se.exe+F23A58],00 ;
  52. je return ; skip win32 api thread synch fn (exit)
  53. exit:
  54. add esi,04 ; add to mediator ptr
  55. push esi ; push to stack as parameter
  56. call dword ptr [dmc4se.exe+B731A0] ; ntdll.ExitCriticalSection
  57. return:
  58. pop esi ;
  59. ret 0004 ; stdcall: one parameter
  60. C++ (prototype)
  61. void update_redorbs_acquired(orb_value);