Skip to content

Instantly share code, notes, and snippets.

@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;
@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;
// 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 / 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;
@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 / exploit.py
Created September 5, 2018 04:46
rtorrent 0.9.6 - Denial of Service (mirror from exploitdb)
# Mirror of https://www.exploit-db.com/exploits/44894/
# Exploit Title: rtorrent 0.9.6 - Denial of Service
# Date: 2018-01-10
# Exploit Author: ecx86
# Vendor Homepage: http://rtorrent.net
# Software Link: https://github.com/rakshasa/rtorrent/releases
# Version: <= 0.9.6
# Tested on: Debian GNU/Linux 9.4 (stretch)
@rcx
rcx / delete-all-messages.js
Last active November 9, 2023 19:12 — forked from niahoo/delete-all-messages.js
Delete all your messages in a Discord channel
/*
* Discord: Don't copy stuff into this box
* Me: dOn'T COpy sTuFf iNtO tHIs bOx
*/
clearMessages = function (guild_id, author_id, authToken, deleted = new Set()) {
if (guild_id[0] == "_" && guild_id[guild_id.length - 1] == "_") {
alert("Oops! You forgot to set the guild_id. Please fill it in.")
return;
}
if (author_id[0] == "_" && author_id[author_id.length - 1] == "_") {
@rcx
rcx / ipd-3.py
Last active January 29, 2020 02:54
Socket server that returns your IP address -- try it online at http://tcpb.in:9999
#!/usr/bin/env python3
from socket import *
s = socket(AF_INET, SOCK_STREAM)
s.bind(('', 9999))
s.listen(1)
while True:
try:
c,a = s.accept()
print(a)
c.send((str(a[0]) + '\n').encode('utf-8'))
@rcx
rcx / bytes.py
Created November 16, 2018 02:26
python3 encoding cheatsheet
#!/usr/bin/env python3.6
my_string = 'hello world'
# get bytes from string
my_bytes = my_string.encode() # default is utf8. accepts: utf-8, utf16, ascii, etc
print(my_bytes)
# get hex from bytes
my_hex = my_bytes.hex() # NEW in python3.5, on python<3.4 use binascii (un)hexlify
print(my_hex)
@rcx
rcx / preamble.h
Last active April 25, 2020 03:25
Preprocess library include headers for loading in IDA
// #define __attribute__(X)
// #define __asm__(X)
// #define __extension__
// #define __inline
#define __signed__ signed
#undef __GNUC__
#undef __GNUC_MINOR__
// #pragma pack(push, 1)