Giter Club home page Giter Club logo

gamesharp's Introduction

GameSharp

TIP: The solution only works with VS 2019.

For the record; there are a many libraries which are better than mine available for free on GitHub. I'm just creating this codebase for myself to get a better understanding of architectures.

This library changes a native (unmanaged) game application into a managed application by injecting your managed library and loading all the needed CLR dlls.

How to

See the Samples folder where you can see how I do things, I'm using notepad++ 32-bit for all my samples currently. The library you are injecting needs an explicit architecture version, such as, if you're injecting into a 32 bit process then the DLL will have to be build with the x86 architecture.

Add your own injection method

You always want to extend your injection method from the GameSharp.External.Injection.InjectionBase class. You can add your own injection methods by overriding the Inject and Execute method.

Anti-Cheat

Currently there are a lot of detection vectors which are still present and most likely you'll have to figure out how their anti-cheat is working to get the most out of this project. However, I do try to keep some of the anti-cheat in mind, for example:

  • The code searches for a code cave inside the memory region of the to be called function before applying a hook or calling the original function. This is to bypass return address checks.
  • When a debugger attaches we set the IsBeingDebugged flag in the PEB to 0.

What the sample includes

  • DLL injection of a managed DLL in an unmanaged application through the famous RemoteThread injection method.
  • Randomizing the PE header.
  • Attaching a managed debugger to the unmanaged remote process.
  • Hiding the presence of the debugger from the PEB!IsBeingDebugged flag.
  • Execution of the entry point of the injected DLL in the remote process.
  • Execution of the MessageBoxW function with my own arguments in a safe way.
  • Hooking the MessageBoxW function in a safe way.
  • Calling NtQueryInformationProcess in 3 different ways, safe function call, pinvoke, through a payload.

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.