Skip to content

Instantly share code, notes, and snippets.

import base64
import glob
import os
import binascii
import struct
INPUT_DIRECTORY = "pastebins"
OUT_DIRECTORY = "bin"
PASTEBIN_URL_TEMP = "https://pastebin.com/raw/"
@osipovar
osipovar / stackstring_hotkey.py
Created January 7, 2019 16:09
Set hotkey to assign name to stack string variable in IDA
import os
def set_stackstring_name():
head = here()
new_name = ""
size = 0
while GetOperandValue(head, 1) != 0:
size += 1
new_name += chr(GetOperandValue(head, 1))
@osipovar
osipovar / resolve-hash.py
Created January 7, 2019 16:06
Resolve hash values in shellcode idb to function names
import json
import idaapi
def get_enum(constant):
all_enums = GetEnumQty()
for enum in range(0, all_enums):
enum_id = GetnEnum(enum)
enum_constant = GetFirstConst(enum_id, -1)
name = GetConstName(GetConstEx(enum_id, enum_constant, 0, -1))
@osipovar
osipovar / create-hash-db.py
Created January 7, 2019 16:03
Create dictionary with key=hash value=function names
import pefile
import json
from os import listdir, path
DLL_PATH = <Folder with dll's>
def get_functions(dll_name):
pe = pefile.PE(path.join(DLL_PATH, dll_name))
if not hasattr(pe, 'DIRECTORY_ENTRY_EXPORT'):