Advertisement
Guest User

Untitled

a guest
May 6th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Runtime.InteropServices;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7.  
  8. namespace Dll_Injector
  9. {
  10. static class pInvokes
  11. {
  12. [DllImport("kernel32.dll")]
  13. public static extern IntPtr OpenProcess(
  14. uint dwDesiredAccess,
  15. bool bInheritHandle,
  16. uint dwProcessId
  17. );
  18.  
  19. [DllImport("kernel32.dll")]
  20. public static extern IntPtr VirtualAllocEx(
  21. IntPtr hProcess,
  22. IntPtr lpAddress,
  23. int dwSize,
  24. uint flAllocationType,
  25. uint flProtect);
  26.  
  27. [DllImport("kernel32.dll")]
  28. public static extern bool WriteProcessMemory(
  29. IntPtr hProcess,
  30. IntPtr lpBaseAddress,
  31. string lpBuffer,
  32. int nSize,
  33. IntPtr lpNumberOfBytesWritten);
  34.  
  35. [DllImport("kernel32.dll")]
  36. public static extern IntPtr GetModuleHandleA(
  37. string lpModuleName);
  38.  
  39. [DllImport("kernel32")]
  40. public static extern IntPtr GetProcAddress(
  41. IntPtr hModule,
  42. string lpProcName);
  43.  
  44. [DllImport("kernel32.dll")]
  45. public static extern IntPtr CreateRemoteThread(
  46. IntPtr hProcess,
  47. IntPtr lpThreadAttributes,
  48. uint dwStackSize,
  49. IntPtr lpStartAddress,
  50. IntPtr lpParameter,
  51. uint dwCreationFlags,
  52. IntPtr lpThreadId);
  53.  
  54. }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement