Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

💉 全能进程注入器 [Yet Another Process Injector] that reduce differences between x64, wow64 and x86 processes.

License

NotificationsYou must be signed in to change notification settings

ez8-co/yapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A fusion injector that reduce differences between x64, wow64 and x86 processes according toMr.Rewolf's article.

Keywords: HEADER-ONLY, DLL-FREE, ANY-CALLEE, ANY-CALLER, ANY-WIN-OS, LOCAL-LIKE

licenseMentioned in Awesome Go

Wiki

  • Wow64: Windows-on-Windows 64-bit, which 32-bit process works in.

Features

  • Cross x86 & x64 injectionwithout any external *.dll or even *.lib:

    • x86 injector -> x86 process @ 32-bit OS
    • wow64 injector -> wow64 process @ 64-bit OS
    • wow64 injector -> x64 process @ 64-bit OS
    • x64 injector -> wow64 process @ 64-bit OS
    • x64 injector -> x64 process @ 64-bit OS
  • In-process call x64 functions / APIs for Wow64 process

  • Local-like remote call of target process

    • Remote call multi-params (more than one) windows API of target process
    • Remote call windows API that return 64-bit result of target process

How to use

  • X64Call example (Unload dll in remote process)

        X64CallRtlCreateUserThread("RtlCreateUserThread");// Validate RtlCreateUserThreadif (!RtlCreateUserThread)return0;    X64CallLdrUnloadDll("LdrUnloadDll");// Validate LdrUnloadDllif (!LdrUnloadDll)return0;// => local-like call    DWORD64 ret = RtlCreateUserThread(hProcess,NULL,FALSE,0,0,NULL, LdrUnloadDll, dllBaseAddr,NULL,NULL);
    • Available constructors:

      • Specified module is allowed (ntdll.dll as default)

        X64Call(constchar* funcName);X64Call(DWORD64 module,constchar* funcName);
  • YAPICall example (MessageBox in remote process)

        YAPICallMessageBoxA(hProcess, _T("user32.dll"), "MessageBoxA");// => local-like callMessageBoxA(NULL,"MessageBoxA : Hello World!","From ez8.co", MB_OK);YAPI(hProcess, _T("user32.dll"), MessageBoxW)        (NULL,L"MessageBoxW: Hello World!",L"From ez8.co", MB_OK);
    • Available constructors:

      • Specified module or module name is allowed (ntdll.dll as default).

      • NOTICE: If failed to fetch 64-bit module, will automatically fetch 32-bit modules in wow64 process under 64-bit OS.

        YAPICall(HANDLE hProcess,constchar* funcName);YAPICall(HANDLE hProcess, DWORD64 moudle,constchar* funcName);YAPICall(HANDLE hProcess,const TCHAR* modName,constchar* funcName);
  • 64-bit result example (GetModuleHandle ofuser32.dll under 64-bit OS)

        YAPICallGetModuleHandle(hProcess, _T("kernel32.dll"), sizeof(TCHAR) == sizeof(char) ? "GetModuleHandleA" : "GetModuleHandleW");    DWORD64 user32Dll = GetModuleHandle.Dw64()(_T("user32.dll"));
  • Timeout example (GetCurrentProcessId in 300ms)

        YAPICallGetCurrentProcessId(hProcess, _T("kernel32.dll"), "GetCurrentProcessId");    DWORD pid = GetCurrentProcessId.Timeout(300)();
  • Timeout & 64-bit result example (GetModuleHandle in 300ms)

        DWORD64 user32Dll = GetModuleHandle.Dw64().Timeout(300)(_T("user32.dll"));
  • PopularLoadLibrary example

        YAPICallLoadLibraryA(hProcess, _T("kernel32.dll"), "LoadLibraryA");    DWORD64 x86Dll = LoadLibraryA("D:\\x86.dll");    DWORD64 x64Dll = LoadLibraryA.Dw64()("D:\\x64.dll");_tprintf(_T("X86: %I64x\nX64: %I64x\n"), x86Dll, x64Dll);
  • API List:

    API Namex86 EquivalentNotes
    GetNtDll64
    GetModuleHandle64GetModuleHandleoverloaded version
    GetProcAddress64GetProcAddressoverloaded version
    SetLastError64SetLastError
    VirtualQueryEx64VirtualQueryEx
    VirtualAllocEx64VirtualAllocEx
    VirtualFreeEx64VirtualFreeEx
    VirtualProtectEx64VirtualProtectEx
    ReadProcessMemory64ReadProcessMemory
    WriteProcessMemory64WriteProcessMemory
    LoadLibrary64LoadLibrary
    CreateRemoteThread64CreateRemoteThread
  • Class List:

    Class Name32-bit OS Support64-bit OS Compatiblity
    X64CallNOT READY NOW
    ProcessWriter
    YAPICall

Inside principle

  • Nomal x64->x64, x86->x86 injection:

  • Multi-params windows API:

    • Pack function address and params in one structure and use shell code to execute in remote process.
    • SeeX86/X64Delegator_disassemble for details indisassemble directory.
  • x64 call for wow64 process:

  • x64 process inject to wow64 process:

    • Use trampoline:
      • CreateRemoteThread(x64): x64 shell code with x86 mode switch (1 arg: function->x86 shell code with one param, param->packed x86 structure) -> pass packed structure (x86 real to call function address and params) to x86 shell code -> pass params to real function.
    • NOTICE: function address(target module) should be valid in target process, but not needed in source injector.
  • 64-bit result:

    • Add aDWORD64 result field to package.
    • Obtain result if needed.
    • ReadProcessMemory after remote thread finished.

Compatibility

  • Operating systems that have been tested are shown in table below.

    Operating SystemNotes
    Windows 10Tested on 64-bit, should also work on 32-bit
    Windows 8Should work on both 64-bit and 32-bit
    Windows 7Tested on 64-bit, should also work on 32-bit
    Windows VistaShould work on both 64-bit and 32-bit
    Windows XPShould work on both 64-bit and 32-bit

References

Roadmap

  • More simple impl ofX64Call.
  • 64-bit OS compatible support ofX64Call.
  • Finish shell codes that more than 6 arguments forYAPICall.
  • Support to fetch specified bit module forYAPICall (32-bit or 64-bit).
  • Same function call (mirror call) automatically in remote process.
  • Self-defined function call in remote process.
  • IAT/inline hook in remote process.
  • Support other 7 optional inject methods.

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]


][Noname][

Contributors

This project exists thanks to all the people who contribute.

Please give us a 💖 star 💖 to support us. Thank you.

And thank you to all our backers! 🙏

Misc

  • Please feel free to use yapi.
  • Looking forward to your suggestions.

About

💉 全能进程注入器 [Yet Another Process Injector] that reduce differences between x64, wow64 and x86 processes.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp