ce吧 关注:196,805贴子:3,802,907
  • 3回复贴,共1

求助贴 求会C#的大神 我的汇编没用不知道怎么回事

只看楼主收藏回复

1L是最帅


IP属地:湖南1楼2015-11-17 14:41回复
    public void RunAsm(int pid)//在目的空间(游戏空间)分配运行汇编码所需的内存空间,并启动远程线程函数调用代码
    {
    int hwnd, addre, threadhwnd;
    byte[] Asm = this.AsmChangebytes(this.Asmcode);
    if (pid != 0)
    {
    hwnd = OpenProcess(PROCESS_ALL_ACCESS, 0, pid);
    if (hwnd != 0)
    {
    addre = VirtualAllocEx(hwnd, 0, 1024, MEM_COMMIT, PAGE_EXECUTE_READWRITE);
    WriteProcessMemory(hwnd, addre, Asm, 1024, 0);
    threadhwnd = CreateRemoteThread(hwnd, 0, 0, addre, 0, 0, ref pid);
    VirtualFreeEx(hwnd, addre, 1024, MEM_RELEASE);
    CloseHandle(threadhwnd);
    CloseHandle(hwnd);
    }
    }
    this.Asmcode = "";
    }
    private byte[] AsmChangebytes(string asmPram)//将16进制样式的字符串转换成以字节数组表现的汇编码
    {
    byte[] reAsmCode = new byte[asmPram.Length / 2];
    for (int i = 0; i < reAsmCode.Length; i++)//29
    {
    reAsmCode[i] = Convert.ToByte(Int32.Parse(asmPram.Substring(i * 2, 2), System.Globalization.NumberStyles.AllowHexSpecifier));
    }
    return reAsmCode;
    }


    IP属地:湖南2楼2015-11-17 14:43
    回复
      2025-06-30 04:49:42
      广告
      这行代码 求助 大神来看


      IP属地:湖南3楼2015-11-17 14:43
      回复
        有没大屌会弄的


        IP属地:湖南4楼2015-11-17 14:52
        回复