Skip to content

Instantly share code, notes, and snippets.

@aixxe
aixxe / virtuals.h
Created Feb 7, 2017
Various virtual method table helper functions.
View virtuals.h
inline void**& GetVirtualTable(void* baseclass) {
return *reinterpret_cast<void***>(baseclass);
}
inline void* GetVirtualFunction(void* vftable, size_t index) {
return reinterpret_cast<void*>(GetVirtualTable(vftable)[index]);
}
template <typename Fn> inline Fn GetVirtualFunction(void* vftable, size_t index) {
return reinterpret_cast<Fn>(GetVirtualTable(vftable)[index]);
@aixxe
aixxe / autosplitter.js
Last active Feb 6, 2017
Hastily written video splitter thing I previously used for lody's past broadcasts.
View autosplitter.js
#!/bin/node
const fs = require("fs");
const path = require("path");
const async = require("async");
const mkdirp = require("mkdirp");
const minimist = require("minimist");
const child_process = require("child_process");
var argv = minimist(process.argv.slice(2));
View keybase.md

Keybase proof

I hereby claim:

  • I am aixxe on github.
  • I am aixxe (https://keybase.io/aixxe) on keybase.
  • I have a public key whose fingerprint is 7BFF 6C9A CFCE 946D 37AB D883 B573 FC59 76EE A726

To claim this, I am signing this object:

@aixxe
aixxe / InterfaceReg.cpp
Created Dec 18, 2016
Get interface pointers without using the exported CreateInterface function.
View InterfaceReg.cpp
// Find the pointer to 'InterfaceReg::s_pInterfaceRegs' - works on Valve game libraries. (32-bit)
uintptr_t interface_list_addr = FindPattern("bin/client.so", "89 10 8B 15 ? ? ? ? A3") + 4;
InterfaceReg* interface_list = **reinterpret_cast<InterfaceReg***>(interface_list_addr);
for (InterfaceReg* current = interface_list; current; current = current->m_pNext) {
printf("* %s => 0x%x\n", current->m_pName, current->m_CreateFn());
}
@aixxe
aixxe / GetAbsoluteAddress.cc
Last active Jun 11, 2020
Helper function to resolve RIP relative addresses.
View GetAbsoluteAddress.cc
inline uintptr_t GetAbsoluteAddress(uintptr_t instruction_ptr, int offset, int size) {
return instruction_ptr + *reinterpret_cast<uint32_t*>(instruction_ptr + offset) + size;
};
You can’t perform that action at this time.