Skip to content

Instantly share code, notes, and snippets.

@rcx
rcx / COMPILING.md
Created November 18, 2017 01:36
Compiling Veles on Windows

Note: change cmake -G parameter to whatever visual studio you need... just pass cmake -G "" to make it list all the options

git clone https://github.com/codilime/veles
cd veles

Open CMakeLists.txt add this at the top:

@rcx
rcx / ControlFlowGraphDumper.java
Last active October 9, 2017 04:36
Java CFG linearization (2nd edition)
// (c) 2017 maple-ir project.
package org.mapleir.ir.algorithms;
import java.util.*;
import org.objectweb.asm.Label;
import org.objectweb.asm.Type;
import org.objectweb.asm.tree.AbstractInsnNode;
import org.objectweb.asm.tree.LabelNode;
import org.objectweb.asm.tree.MethodNode;
// What is the problem with this implementation of List#addAll? Assume add() is implemented properly.
@Override
public boolean addAll(Collection<? extends Statement> c) {
boolean ret = false;
for (Statement s : c)
ret = ret || add(s);
return ret;
}
@rcx
rcx / PluginCracker.java
Last active October 9, 2017 04:41
Spigot plugin cracker
package org.spigotmc.plugincracker;
import org.objectweb.asm.*;
import org.objectweb.asm.commons.JSRInlinerAdapter;
import org.objectweb.asm.tree.*;
import org.objectweb.asm.util.CheckClassAdapter;
import java.io.*;
import java.lang.reflect.Method;
import java.net.MalformedURLException;
@rcx
rcx / codecave.cpp
Last active May 26, 2018 02:09
CS:GO code cave proof of concept
#include "stdafx.h"
DWORD getPID(LPCSTR szFileName)
{
HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, NULL);
PROCESSENTRY32 pe;
pe.dwFlags = sizeof(PROCESSENTRY32);
if (hSnapshot == INVALID_HANDLE_VALUE)
return 0;