Skip to content

Instantly share code, notes, and snippets.

@Jinmo
Jinmo / jni_all.h
Created May 26, 2017 07:36
Useful when reversing JNI on IDA Pro
/*
* Copyright (c) 1996, 1998, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
@Jinmo
Jinmo / riscv-readfile.s
Last active April 24, 2026 19:33
RISCV file read and encryption (4byte xor, for flag length)
# file read shellcode
# riscv
# - buffer: pc + 0x100, must be writable
# - if you want, you can change it
# compile:
# export PATH=$PATH:/opt/riscv/bin
# riscv64-unknown-elf-as code.s -o code.o
# riscv64-unknown-elf-objcopy --dump-section .text=code.dump code.o
# output: code.dump
My ethereum address is 0x332Ec6B21f552e390e8C1eBDbf5c769fF69941eB
@Jinmo
Jinmo / _.md
Last active September 29, 2025 23:06
C/C++ header to IDA

Usage

In IDAPython,

execfile('<path>/cxxparser.py')
parse_file('<path>/a.cpp',[r'-I<path>\LuaJIT-2.0.5\src', '-D__NT__', '-D__X64__', '-D__EA64__'])
parse_file('<path>/malloc.c',['-target=x86_64-linux-gnu'])
@Jinmo
Jinmo / socat.c
Last active July 26, 2025 00:15
소켓 데몬 너무 디버깅하기 싫어서 만든 별것 아닌 것
#include <sys/socket.h>
#include <sys/types.h>
#include <arpa/inet.h>
#include <strings.h>
#include <stdio.h>
#include <unistd.h>
#include <signal.h>
#include <stdlib.h>
int main(int argc, char **argv, char **envp) {
/*
first malloc(16) : 0x1a61450
eh.. and malloc(-1) : (nil)
second malloc(16) : 0x7fe57c0008c0
FYI, libc.so address is : 0x7fe5837dc000
let's calculate! : 0x7fe580000000
*/
#include <stdio.h>
#include <stdlib.h>
@Jinmo
Jinmo / ida_stdin.py
Last active March 18, 2023 02:44
IDA Pro stdin readline support
import idaapi
from Queue import Queue
from PyQt5.QtCore import QCoreApplication
from PyQt5.QtWidgets import qApp, QMainWindow, QWidget, QLineEdit
def _query(window, predicate):
results = []
@Jinmo
Jinmo / apple-script.yaml
Created June 1, 2020 21:43
kaitai struct for AppleScript file
meta:
id: apple_script
file-extension: scpt
application: AppleScript files
endian: be
ks-opaque-types: true
seq:
- id: magic
size: 4
@Jinmo
Jinmo / 1.diff
Created May 10, 2020 07:28
pwntools windows; at least remote() works
diff --git "a/pwnlib/context/__init__.py" "b/pwnlib/context/__init__.py"
index 6d43994..e813de6 100644
--- "a/pwnlib/context/__init__.py"
+++ "b/pwnlib/context/__init__.py"
@@ -26,6 +26,8 @@ import socks
from pwnlib.config import register_config
from pwnlib.device import Device
from pwnlib.timeout import Timeout
+import colorama
+colorama.init()
from pwn import *
import struct
def flatten(input_array):
result_array = []
for element in input_array:
if isinstance(element, list):
result_array += flatten(element)
else:
result_array.append(element)