Giter Site home page Giter Site logo

maze's Introduction

MAZE

Memory AntiviruZ Evasion

This library is designed to help you avoid antivirus software false positives by dynamically resolving the address(ess) of your desired function(s). As of everything there is potential for misuse, do not abuse it for bad purpose that would be bad ;) (if you get it, you get it)

Usage

Step 1

First things first you call your initialize() function, this step is crucial to load DLLs and get addresses to the required functions provided by these libraries. You shall save the return value of this function in a Maze_Functions struct. If this function fails std::runtime_error is thrown.

Step 2

Then you must get a pointer to the Process Enviroment Block of the current process, this is task is performed by the get_peb function which takes as an argument a constant reference to a the Maze_Functions struct created in the previous step. If this function fails it will return nullptr

Step 3

Next you call get_peb_entries passing the PEB pointer you adquired in the previous step to the function, this will return an std::vector<LDR_DATA_TABLE_ENTRY> object, you can implement your own search algorithm, or use any of the existing STL algorithms however it is recommended you use get_module_base which takes as arguments a constant reference to an object of type std::vector<LDR_DATA_TABLE_ENTRY> and a constant std::wstring , or it's overloaded version which takes 1 pair of iterators and a constant std::wstring, this string contains the name of the module to be found. this function will return a value of type void* which represents the base address of the desired module, in case the module can't be found the return value will be nullptr

Step 4

The final step is calling get_procedure of type void*, which will return the address of the desired function if successful, this address is then to be stored inside a function pointer defined by the programmer and appropriately casted. It's arguments are a void pointer to the base of the module where the desired function comes from(Step 3), a const char* or C-STRING with the name of the exported function and finally a constant reference to the Maze_Functions struct from step number 1.

Example

#include <iostream>
#include "Maze.h"

typedef bool(__stdcall *rpm_ptr)(HANDLE, LPCVOID, LPVOID, SIZE_T, SIZE_T*);
typedef bool(__stdcall *wpm_ptr)(HANDLE, LPVOID, LPCVOID, SIZE_T, SIZE_T*);

int main() {	
	Maze_Functions functions = initialize();
	PEB* peb = get_peb(functions);	
	void* baseaddress = get_module_base(get_peb_entries(peb), L"KERNEL32.DLL");
	if (baseaddress == nullptr) return 0;
	wpm_ptr dWriteProcessMemory_ptr = reinterpret_cast<wpm_ptr>(get_procedure(baseaddress, "WriteProcessMemory", functions));
	rpm_ptr dReadProcesMemory_ptr = reinterpret_cast<rpm_ptr>(get_procedure(baseaddress, "ReadProcessMemory", functions));
  //You can proceed to call the function pointers as normal functions...
  return 0;
  
  }

maze's People

Contributors

nihr4 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  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.