首页 > 学院 > 开发设计 > 正文

C# 制作外挂常用的API

2019-11-17 03:02:10
字体:
来源:转载
供稿:网友
C# 制作外挂常用的API
  1. C#做外挂的常用API,本人用了很久,基本没发现问题
  2. usingSystem;
  3. usingSystem.Collections.Generic;
  4. usingSystem.Text;
  5. usingSystem.Runtime.InteropServices;//这个肯定要的
  6. namespaceWindowsapplication1
  7. {
  8. classwin32API
  9. {
  10. publicconstintOPEN_PROCESS_ALL=2035711;
  11. publicconstintPAGE_READWRITE=4;
  12. publicconstintPROCESS_CREATE_THREAD=2;
  13. publicconstintPROCESS_HEAP_ENTRY_BUSY=4;
  14. publicconstintPROCESS_VM_OperaTION=8;
  15. publicconstintPROCESS_VM_READ=256;
  16. publicconstintPROCESS_VM_WRITE=32;
  17. privateconstintPAGE_EXECUTE_READWRITE=0x4;
  18. privateconstintMEM_COMMIT=4096;
  19. privateconstintMEM_RELEASE=0x8000;
  20. privateconstintMEM_DECOMMIT=0x4000;
  21. privateconstintPROCESS_ALL_access=0x1F0FFF;
  22. //查找窗体
  23. [DllImport("User32.dll",EntryPoint="FindWindow")]
  24. publicexternstaticIntPtrFindWindow(
  25. stringlpClassName,
  26. stringlpWindowName
  27. );
  28. //得到目标进程句柄的函数
  29. [DllImport("USER32.DLL")]
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表