Skip to content

Instantly share code, notes, and snippets.

View alexander-hanel's full-sized avatar
😶

Alexander Hanel alexander-hanel

😶
View GitHub Profile
@alexander-hanel
alexander-hanel / IconExample.py
Created August 21, 2021 01:17
IconExample IDAPYTHON
import ida_kernwin
"""
mostly stolen from https://github.com/idapython/ examples/ex_actions.py
"""
class IconExample(ida_kernwin.action_handler_t):
def __init__(self, passed):
ida_kernwin.action_handler_t.__init__(self)
@alexander-hanel
alexander-hanel / README.md
Last active September 30, 2023 01:20
Learning Rust
@alexander-hanel
alexander-hanel / README.md
Last active December 25, 2024 13:24
intro to opaque predicates notes

opaque predicates

In computer programming, an opaque predicate is a predicate—an expression that evaluates to either "true" or "false"—for which the outcome is known by the programmer a priori, but which, for a variety of reasons, still needs to be evaluated at run time

Source

Opaque predicates appears to have been first used by Christian Collberg & Clark Thomborson back in 1997 source. The technique is discussed in their paper A Taxonomy of Obfuscating Transformations.

Notes from A Taxonomy of Obfuscating Transformations

@alexander-hanel
alexander-hanel / README.md
Last active April 20, 2022 19:30
Rust Ownership and Borrow Notes

Rust Ownership Notes

Rather than relying on garbage collection or user memory allocation (via allocate/free memory), Rust relys on the compiler to ensure memory is managed through ownership.

Ownership is a set of rules that governs how a Rust program manages memory.

Ownership helps with organizing how data is stored in the heap, minimizing duplication of data in the heap and cleaning up the heap. Data types (e.g. Scalar types) are not stored in the heap. Data types (e.g. integers) can be easily pushed/stored and popped/removed on the stack. Rust enforces single ownership.

Ownership Rules

@alexander-hanel
alexander-hanel / README.md
Last active April 20, 2022 04:12
Cryptopals Rust Solutions

Cryptopals

link

Set 1

Challenge 1: Convert hex to base64

use std::str;
extern crate base64;
@alexander-hanel
alexander-hanel / jvm_hook.py
Created April 25, 2022 21:04
logs exported APIs in JVM
# Created By: Alexander Hanel
# Date: 20220425
# Version 2.0
# Purpose: Simple API logger for a subset of API's used by Java's JVM
# C:\tt\pypyp>C:\Python37\python.exe jvm_logger.py -file "C:\Progra~1\Java\jdk1.8.0_191\bin\java.exe" -args " -jar C:\tt\pypyp\victim-app-0.0.1-SNAPSHOT.jar"
import sys
import _ptrace
import argparse
import idautils
import string
DEBUG = True
if DEBUG:
import hexdump
SEGMENT = True
def get_to_xrefs(ea):

Disassembler (aka Task 1)

Notes on RE1.

  1. Use a language of your choice to decode the base64 encoded data, disassemble the binary data using the capstone engine and save the text to a file named disassemble.txt
@alexander-hanel
alexander-hanel / explore_binary_ninja.py
Last active August 24, 2022 19:15
Explore Binary Ninja's Python API
import logging
logging.basicConfig()
logging.getLogger().setLevel(logging.DEBUG)
file_name = ""
try:
import binaryninja
logging.debug("BinaryNinja has been imported")
@alexander-hanel
alexander-hanel / README.md
Last active September 29, 2023 03:31
IL - Overview

Stages

image

Source

1. Machine Code

  • disassemble (x86, ARM, MIPS, etc)
  • disassembler (capstone, etc)