Skip to content

Instantly share code, notes, and snippets.

@Jinmo
Jinmo / unload.py
Created May 5, 2019 14:10
Force unloading IDA plugin (or not)
from pkg.internal_api import _ida_lib
import ctypes
functype, lib = _ida_lib()
class qstring(ctypes.Structure):
_fields_ = [
('array', ctypes.c_void_p),
@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 / yey.py
Last active May 17, 2019 01:20
loading IDA colors (clr) file given a path to the file
from ctypes import c_ssize_t, c_void_p, c_int, c_void_p, create_string_buffer, cast, WINFUNCTYPE, CFUNCTYPE, windll, cdll, CDLL
from PyQt5.QtCore import Qt, QTimer, QObject
from PyQt5.QtGui import QResizeEvent, QFocusEvent
from PyQt5.QtWidgets import QWidget, QDialog, QDialogButtonBox, QPushButton, qApp
import os
import sys
import idaapi
import idc
package main
import (
"swig/plugin"
"swig/ida_kernwin"
)
func InitPlugin() int {
ida_kernwin.Msg("console!")
return plugin.PLUGIN_KEEP
@Jinmo
Jinmo / _.md
Last active April 9, 2025 14:20
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 / .py
Created August 13, 2019 21:53
import pprint
yy_meta = [0x00, 0x01, 0x01, 0x01, 0x02, 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, 0x02, 0x03, 0x01, 0x01, 0x03, 0x01, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]
yy_accept = [0x0000, 0x0000, 0x0000, 0x001C, 0x001A, 0x0018, 0x0018, 0x001A, 0x000E, 0x000F, 0x0015, 0x0013, 0x0017, 0x0014, 0x0019, 0x0016, 0x0012, 0x000D, 0x000D, 0x000D, 0x000D, 0x000D, 0x000D, 0x000D, 0x000D, 0x000D, 0x0010, 0x0011, 0x000C, 0x0000, 0x0019, 0x000D, 0x000D, 0x000D, 0x000D, 0x000D, 0x000D, 0x000D, 0x000D,
0x000D, 0x000D, 0x000B, 0x000D, 0x0003, 0x000D, 0x000D, 0x0006, 0x000D, 0x000D, 0x000D, 0x000D, 0x000D, 0x0001, 0x0004, 0x000D, 0x0002, 0x000D, 0x0005, 0x000D, 0x000A, 0x000D, 0x000D, 0x0008, 0x000D, 0x0000, 0x0009, 0x0000, 0x0000, 0x0000, 0x0007, 0x0000, 0x0000, 0x0001, 0x000
import requests
sess=requests.Session()
HOST,PORT='10.13.37.8',8888
# overflow_len: http://
# overflow_payload <- suffix
append=u'a\u3fff'.encode('utf8')
append=bytes(append)
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)
@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()
@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