Coder Social home page Coder Social logo

x64call's Introduction

x64call

Call 64bit function in 32bit process;
32位进程调用64位函数, CPP类型安全

Usage

32位进程远程注入64位进程示例

IN CPP

#include <Windows.h>
#include <x64call>
using PNtCreateThreadEx=DWORD64(
    PDWORD64                 ThreadHandle,
    ACCESS_MASK             DesiredAccess,
    LPVOID                  ObjectAttributes,
    HANDLE                  ProcessHandle,
    DWORD64  lpStartAddress,
    LPVOID                  lpParameter,
    BOOL                    CreateSuspended,
    DWORD64                 dwStackSize,
    DWORD64                 dwStackCommit,
    DWORD64                 dwStackReserve,
    LPVOID                  lpBytesBuffer
);
    DWORD64 hThread;
    x64call::x64<PNtCreateThreadEx>::call("NtCreateThreadEx",&hThread,0x1FFFFF,NULL,hProc,addr64,pParam,FALSE,0,0,0,NULL);

    //or
    char const name[]="NtCreateThreadEx";
    x64call::x64<PNtCreateThreadEx>::call<name>(&hThread,0x1FFFFF,NULL,hProc,addr64,pParam,FALSE,0,0,0,NULL);
  

IN C

#include <Windows.h>
#include <x64call.h>
DWORD64 hThread;
x64call_exec(
    11,                                //number of target function args
    x64call_dlwalk("NtCreateThreadEx"),//64bit function addr
    (uint64_t)0x1FFFFF,                //args...
    (uint64_t)NULL,
    (uint64_t)hProc,
    (uint64_t)addr64,
    (uint64_t)pParam,
    (uint64_t)FALSE,
    (uint64_t)0,
    (uint64_t)0,
    (uint64_t)0,
    (uint64_t)NULL,
)

Notes

不支持浮点类型和结构体传值

x64call's People

Contributors

system233 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

x64call's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.