Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. .386
  2. .MODEL flat,stdcall
  3. OPTION CASEMAP:NONE
  4.  
  5. Include windows.inc
  6. Include user32.inc
  7. Include kernel32.inc
  8.  
  9. IncludeLib user32.lib
  10. IncludeLib kernel32.lib
  11.  
  12. .DATA?
  13. hConsoleOut dd ?
  14.  
  15. .code
  16. DllEntry proc hInstance:HINSTANCE, reason:DWORD, reserved1:DWORD
  17. mov eax,TRUE
  18. ret
  19. DllEntry Endp
  20.  
  21. ConsoleWrite proc value:DWORD, len:DWORD
  22. CMP hConsoleOut, 0
  23. jz SetOutHandle
  24. jnz write
  25.  
  26. SetOutHandle:
  27. PUSH -11
  28. CALL GetStdHandle
  29. MOV hConsoleOut, EAX
  30. write:
  31. ;lets check again before calling the API
  32. CMP hConsoleOut, 0
  33. jz endfunc
  34.  
  35. push 0
  36. push 0
  37. push len
  38. push value
  39. push hConsoleOut
  40. CALL WriteConsole
  41. jmp endfunc
  42.  
  43. endfunc:
  44. ret
  45. ConsoleWrite endp
  46. End DllEntry
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement