Giter Site home page Giter Site logo

uikit0 / graphical-ninja Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hinaria/graphical-ninja

0.0 1.0 0.0 72 KB

C++ library for hooking into the rendering pipeline of DirectX 8-11 and OpenGL 3-4 applications on Windows using a common, simple interface.

graphical-ninja's Introduction

graphical-ninja

A C++ library that allows you to hook into the rendering pipeline of DirectX 8-11 and OpenGL 3-4 applications on Windows using a common, simple interface. The rest is up to you.

Note (September 2012): This library is currently hosted on a private git server. I've been asked to put the readme onto GitHub from a few users. graphical-ninja and its dependencies may become an open source library in the near future.

installation

graphical-ninja depends on freedompeace/graphical-abstractions, freedompeace/x64-detours. Place each dependency in its own directory dep/{library}, relative to the working directory.

Assuming you've got make and gcc, build the lib and headers and reference them in your own project:

$ cd ~/graphical-ninja
$ make lib

And optionally, unit tests:

$ make tests 

anti-cheat

graphical-ninja does not have any issues working with the following anti-cheat engines:

  • Valve Anti-Cheat (checked January 2012)
  • Blizzard Warden (checked November 2011)
  • AhnLab HackShield (checked January 2012)
  • nProtect GameGuard (checked January 2012)

Some cheat engines will throw up if you try to add a callback to a protected function (because graphical-ninja will patch the function assembly code to create a codecave). For example, you might be able to add a callback to the PostEndScene function but not the Direct3dPreSetStreamSource function on some cheat engines. Please file an issue if the above information is incorrect and I'll update the information above and maybe work on a fix. Make sure graphical-ninja is causing the detection and not what you choose to do with it. Other anti-cheat engines have not been detected.

usage

Using the library is quite simple. Refer to the documentation:

// GraphicalNinja that binds to the current process.
auto ninja = new GraphicalNinja();

// Locates the first graphics device found. GraphicalNinja::FindOne() returns a 
// GraphicalAbstractions::GraphicsDevice or nullptr if a graphics device couldn't be
// found.
auto graphics = ninja->FindOne();

// Let's do something after the application renders a new scene.
auto callbackToken = graphics->AddCallback(
	CallbackType.PostEndScene,
	(auto device)
	{
		// `device` refers to the same object as `graphics`
		auto backbuffer = device->GetBackBuffer();

		// ...
		//   Perhaps copy the backbuffer into a video?
		//     Set your imagination free!
	});

// Remove the callback.
graphics->RemoveCallback(callbackToken);

I've been frequently asked about native device access. As per the graphical-abstractions readme, graphics->GetNativeDevice():

if (graphics->NativeDeviceType == NativeDeviceType.Direct3D11)
	auto direct3d11 = reinterpret_cast<ID3D11Device*>(graphics->GetNativeDevice());

license

Shhh! graphical-ninja is still a work in progress! Don't leak our hard work! graphical-ninja will eventually be licensed under the terms of the MIT license.

graphical-ninja's People

Watchers

 avatar

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.