Skip to content

Instantly share code, notes, and snippets.

@stong
stong / CleanBoot.java
Last active January 27, 2024 11:35
Real World CTF 2023: Dark Portal Writeup
package org.mapleir;
import org.mapleir.app.client.SimpleApplicationContext;
import org.mapleir.app.service.ApplicationClassSource;
import org.mapleir.app.service.InstalledRuntimeClassSource;
import org.mapleir.asm.ClassHelper;
import org.mapleir.asm.ClassNode;
import org.mapleir.asm.MethodNode;
import org.mapleir.context.AnalysisContext;
import org.mapleir.context.BasicAnalysisContext;
@sucremad
sucremad / callcon.md
Last active November 19, 2021 12:28
Function Call Conventions

Most Common Calling Conventions

Most commons are cdecl, stdcall, fastcall

In function calls, parameters are pushed onto the stack from right to left.

Example Function Pseudo Code

int func(int x, int y, int z, int m, int k);
 
int a, b, c, d, e, ret;
@NaxAlpha
NaxAlpha / HookFx.cs
Last active December 2, 2023 09:08
Windows API Hook with C#
using System;
using System.Runtime.InteropServices;
public class FxHook:IDisposable {
const int nBytes = 5;
IntPtr addr;
Protection old;
byte[] src = new byte[5];