Giter Club home page Giter Club logo

bypassgetmodulebaseaddressandgetexportaddress's Introduction

Bypass GetModuleBaseAddress and GetExportAddress in C#

A proof of concept of real and native custom GetExportAddress (GetProcAddress) and GetModuleBaseAddress (GetModuleHandle) in C#.

This took me so long time to code and find resources about it (mostly old and not working anymore or C++). I decided to write that in C# because I didn't find C# implementation of those functions. Also most of native imports I wrote come from ReactOS code I translated to C# and then tested with ProcessHacker for PEB and Detect It Easy for Image structures.
Works with x86 and x64.

TODO

  • Some code refractoring & improvements
  • Some docs or explanations

bypassgetmodulebaseaddressandgetexportaddress's People

Contributors

arsium avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

bypassgetmodulebaseaddressandgetexportaddress's Issues

Сonvert

  • Is it possible to convert this code to c++ ?

when use CreateProcess,it failed with error code 0xf10

Hi ! Here is my code :

[UnmanagedFunctionPointer(CallingConvention.Winapi)]
        public delegate bool Delegate_CreateProcessW(string lpApplicationName, string lpCommandLine, ref SECURITY_ATTRIBUTES lpProcessAttributes, ref SECURITY_ATTRIBUTES lpThreadAttributes, bool bInheritHandles, uint dwCreationFlags, IntPtr lpEnvironment, string lpCurrentDirectory, [In] ref STARTUPINFO lpStartupInfo, out PROCESS_INFORMATION lpProcessInformation);

IntPtr ptrBaseAddres = CustomGetProcAndGetModule.GetExportAddress("kernel32.dll", "CreateProcessW");
Delegate_CreateProcessW D_CreateProcessW = (Delegate_CreateProcessW)Marshal.GetDelegateForFunctionPointer(ptrBaseAddres, typeof(Delegate_CreateProcessW));
retValue = D_CreateProcessW(program, cmd, ref pSec, ref tSec, false, 0x0020, IntPtr.Zero, null, ref s, out p);

and it will failed with error code 0xf10. I cannot find what happend

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.