Skip to content

Instantly share code, notes, and snippets.

@oopsmishap
oopsmishap / ZeusVM_disassembly_to_C.py
Last active January 21, 2024 10:24
Transpile ZeusVM disassembly into valid C to compile
class ZeusVMToC:
def __init__(self, diasm_file, output_file=None):
self.diasm_file = diasm_file
self.output_file = output_file
self.line_num = 0
self.data_ptr_mov = 0
def tokenize(self):
with open(self.diasm_file, 'r') as f:
@oopsmishap
oopsmishap / ZeusVM_disassembler.py
Last active January 21, 2024 10:23
Disassmble ZeusVM VM Code to a readable format
from enum import Enum
class HandlerType(Enum):
Zero = 0
Shuffle = 1
Rc4 = 2
Imm = 3
RegReg = 4
RegImm = 5
Reg = 6
@oopsmishap
oopsmishap / ZeusVM_Miasm.ipynb
Last active January 30, 2024 11:26
ZeusVM handler semantics extractor
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@oopsmishap
oopsmishap / _jmp_deobfuscator.md
Last active February 27, 2024 05:48
IDA Jmp Deobfuscation Script
@oopsmishap
oopsmishap / pxor_string_decrypt_wip.py
Last active November 26, 2023 22:19
WIP: pxor string via janky emulation
import time
from typing import List
import pefile
from capstone import *
from capstone.x86 import *
import re
import struct
# SAMPLE_PATH = 'bin/enc_string_test.bin32'
SAMPLE_PATH = 'bin/2cd2f077ca597ad0ef234a357ea71558d5e039da9df9958d0b8bd0efa92e74c9.bin32'
#pragma once
#include <stdint.h>
#include "win_helper.h"
namespace poc_kit
{
namespace pattern
{
@oopsmishap
oopsmishap / _hellowrold.ipynb
Last active May 28, 2023 22:20
hellowrold malware
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@oopsmishap
oopsmishap / ref_sample.c
Created February 16, 2023 22:53
matching_crypt_compression_algo
int __stdcall sub_10001100(_DWORD *a1, unsigned int a2, unsigned int a3)
{
_DWORD *v3; // edi
unsigned int v4; // ebx
unsigned int v5; // esi
int v6; // edx
unsigned int v7; // eax
int v8; // ecx
unsigned int v9; // edx
unsigned __int16 *v10; // edx
@oopsmishap
oopsmishap / astaroth_hide_timewasters.py
Created January 31, 2023 21:33
Astaroth hide timewaster function calls
import idautils
import idaapi
import ida_bytes
import ida_search
import ida_segment
import ida_nalt
def find_function(pattern):
text = ida_segment.get_segm_by_name('.text')
return ida_search.find_binary(text.start_ea, text.end_ea, pattern, 16, ida_search.SEARCH_DOWN)
@oopsmishap
oopsmishap / _rhadamanthys_stage3_unpacker.py
Last active March 18, 2023 16:10
Rhadamanthys stage3 unpacker
import struct
def extract_stage3(stage3_buffer):
# struct stage3_header
# {
# uint32_t magic;
# uint16_t block_count;
# uint16_t header_size;
# uint32_t entry_offset;