Giter Site home page Giter Site logo

casuallibrary's Introduction

Overview

About The Project

Helper library for external windows game hacking.

Collaborative work provided by the CasualCommunity

Installation

  1. Download current release ("CasualLibrary0.2.rar") from the release section
  2. Extract *.h and *.lib file(s) at appropriate location in your project directory.
  3. Include them into your project.

Documentation

The main set of documentation can be found here

Usage

bare-bones setup

external

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

int main(){
    External::Memory memory = External::Memory("target.exe");
    External::Memory memoryDebug = External::Memory("target.exe", true); //use for debug messages
}

internal

Sample dll including the library
#include <Windows.h>
#include <iostream>

#include <Memory.h>

HMODULE myhModule;

DWORD __stdcall EjectThread(LPVOID lpParameter) {
    Sleep(100);
    FreeLibraryAndExitThread(myhModule, 0);
}

DWORD WINAPI Menue() {
    AllocConsole();
    FILE* fp;
    freopen_s(&fp, "CONOUT$", "w", stdout); // output only
    std::cout << "Running tests ...\n\n";

    //add Code here

    while (1) {
        Sleep(100);
        if (GetAsyncKeyState(VK_NUMPAD0))
            break;
    }
    fclose(fp);
    FreeConsole();
    CreateThread(0, 0, EjectThread, 0, 0, 0);
    return 0;
}


BOOL APIENTRY DllMain(HMODULE hModule,
    DWORD  ul_reason_for_call,
    LPVOID lpReserved
    )
{
    switch (ul_reason_for_call)
    {
    case DLL_PROCESS_ATTACH:
        myhModule = hModule;
        CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)Menue, NULL, 0, NULL);
    case DLL_THREAD_ATTACH:
    case DLL_THREAD_DETACH:
    case DLL_PROCESS_DETACH:
        break;
    }
    return TRUE;
}

read/write memory

external

//works for all types including uintptr_t, int, double etc. as well as custom structs and classes.
//does NOT work for arrays/vectors
Address address = Address(0x2240001C);
// read integer stored at address
int test = memory.read<int>(address);
// read one word
std::string word = memory.readString(address);
//read 200 chars
std::string text = memory.readString(address, 200);
//write value 5 starting at given address
memory.write<int>(address, 5);

internal

//works for all types including uintptr_t, int, double etc. as well as custom structs and classes.
//does NOT work for arrays/vectors
Address address = Address(0x2240001C);
// read integer stored at address
int test = Internal::Memory::read<int>(address);
//write value 5 starting at given address
Internal::Memory::write<int>(address, 5);

get module base address

external

Address clientAddr = memory.getModule("client.dll");

internal

Address clientAddr = Internal::Memory::getModule("client.dll");

get address from static pointer + offsets

Static Pointer in CE

external

Address baseAddr = memory.getModule("ZW64.exe");
Address healthAddr = memory.getAddress(baseAddr+0x00003648, { 0x40,0xE4 });

internal

Address baseAddr = Internal::Memory::getModule("ZW64.exe");
Address healthAddr = Internal::Memory::getAddress(baseAddr+0x00003648, { 0x40,0xE4 });

AOB Scanner

external

Address address = memory.findSignature(0x7FF702CB5D00, "? 39 05 F0 A2 F6 FF" , 10000);

internal

Address address = Internal::Memory::findSignature(0x7FF702CB5D00, "? 39 05 F0 A2 F6 FF" , 10000);

casuallibrary's People

Contributors

alienthebetrayer avatar casualcoder91 avatar t0msa avatar

Stargazers

 avatar  avatar

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.