Advertisement
Riremito

v400.1 NPC Talk Text

Nov 6th, 2021
353
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. // JMS v400.1 NPC Talk Text
  2.  
  3. [Enable]
  4. Alloc(NPCTextData, 4096)
  5. RegisterSymbol(NPCTextData)
  6. NPCTextData:
  7. dd #0
  8. dd #0
  9. dd #0
  10.  
  11. Alloc(ProcessPacket_Hook, 256)
  12. Label(ProcessPacket_Hook_Ret)
  13.  
  14. ProcessPacket_Hook:
  15. pushad
  16. mov esi,[ebp+8] // InPacket
  17. cmp dword ptr [esi+C],#20 // minimum data length
  18. jbe ProcessPacket_Hook_Ret
  19. mov eax,[esi+8] // Packet
  20. add eax,4
  21. cmp word ptr [eax],0730 // NPC Talk
  22. jne ProcessPacket_Hook_Ret
  23. cmp byte ptr [eax+2],#4 // always 4?
  24. jne ProcessPacket_Hook_Ret
  25. // [eax+#3] NPC ID
  26. // [eax+#12] Text Length
  27. // [eax+#14] Text
  28.  
  29. mov ebx,[eax+3]
  30. mov [NPCTextData],ebx
  31. movzx ebx, word ptr [eax+C]
  32. mov [NPCTextData+4],ebx
  33.  
  34. lea ebx,[eax+E]
  35. lea ecx,[NPCTextData+8]
  36. push [NPCTextData+4]
  37. push ebx
  38. push ecx
  39. call memcpy
  40. add esp,C
  41. ProcessPacket_Hook_Ret:
  42. popad
  43. jmp 049DF32E
  44.  
  45.  
  46. // ProcessPacket vm section
  47. 049DF31D:
  48. jmp ProcessPacket_Hook
  49.  
  50. [Disable]
  51. 049DF31D:
  52. jmp 049DF32E
  53.  
  54. DeAlloc(ProcessPacket_Hook)
  55. DeAlloc(NPCTextData)
  56. UnRegisterSymbol(NPCTextData)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement