Advertisement
Guest User

Untitled

a guest
Mar 25th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.07 KB | None | 0 0
  1. .386
  2.  
  3. .MODEL flat,stdcall
  4.  
  5. OPTION CASEMAP:NONE
  6.  
  7. Include windows.inc
  8. Include user32.inc
  9. Include kernel32.inc
  10.  
  11. IncludeLib user32.lib
  12. IncludeLib kernel32.lib
  13.  
  14. .DATA
  15. Patch PROTO
  16. .code
  17. DllEntry proc hInstance:HINSTANCE, reason:DWORD, reserved1:DWORD
  18. .if reason==DLL_PROCESS_ATTACH
  19. invoke Patch
  20. .endif
  21. mov eax,TRUE
  22. ret
  23. DllEntry Endp
  24. ; See skeleton.def: This is an exported function
  25.  
  26.  
  27. WriteMem proc MemOffset:DWORD, DataPtr:DWORD, dataLen:DWORD
  28. LOCAL OldProt:DWORD
  29.  
  30. pushad
  31. invoke VirtualProtect, MemOffset, dataLen, PAGE_EXECUTE_READWRITE, addr OldProt
  32. invoke RtlMoveMemory, MemOffset, DataPtr, dataLen
  33.  
  34. mov ecx,dataLen ; amount to copy
  35. mov esi,DataPtr ; location to copy from
  36. mov edi,MemOffset ; location to copy to
  37. rep movsb ; copy
  38.  
  39. invoke VirtualProtect, MemOffset, dataLen, OldProt, addr OldProt
  40. popad
  41. ret
  42.  
  43. WriteMem endp
  44. Patch proc
  45. jmp code1
  46. db "looky looky, I got hookie!",0
  47. code1:
  48. mov eax, 0057425Ch ;addr
  49. mov edi, 0003A8E9h ;var
  50. mov dword ptr[eax],edi
  51. ;mov dword ptr[0064074Fh],660000BBh
  52. mov eax, 0064074Fh ;addr
  53. mov edi, 660000BBh ;var
  54. mov dword ptr[eax],edi
  55. ; mov dword ptr[00640757h],900000BFh
  56. mov eax, 00640757h ;addr
  57. mov edi, 900000BFh ;var
  58. mov dword ptr[eax],edi
  59. ;mov dword ptr[00640753h],66000FB8h
  60. mov eax, 00640753h ;addr
  61. mov edi, 66000FB8h ;var
  62. mov dword ptr[eax],edi
  63. ;mov dword ptr[0064075Bh],90903FEBh
  64. mov eax, 0064075Bh ;addr
  65. mov edi, 90903FEBh ;var
  66. mov dword ptr[eax],edi
  67. jmp code2
  68. db "you do realize it is lame looking at this?",0
  69. code2:
  70. ;mov word ptr[0064075Fh],9090h
  71. mov eax, 0064075Fh ;addr
  72. mov edi, 9090h ;var
  73. mov word ptr[eax],di
  74. ;mov byte ptr[006407ABh],00h
  75. mov eax, 006407ABh ;addr
  76. mov byte ptr[eax],0
  77. ;mov byte ptr[00574260h],00h
  78. mov eax, 00574260h ;addr
  79. mov byte ptr[eax],0
  80. ret
  81. Patch endp
  82.  
  83. End DllEntry
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement