Skip to content

Instantly share code, notes, and snippets.

View rbran's full-sized avatar
🦜

Rubens BrandΓ£o rbran

🦜
View GitHub Profile
pub struct Architecture {
pub name: String,
}
#[derive(Clone, Copy)]
pub struct RegisterInfo;
#[derive(Clone, Copy, Hash, PartialEq, Eq)]
pub struct Register;
#[derive(Clone, Copy)]
pub struct RegisterStackInfo;
@rbran
rbran / 6502.txt
Last active August 20, 2024 10:59
List of 6502 instructions generated using ghidra sleigh with sleigh-rs
NOTE: bits are from least to most significant, 'X' means the value could not be defined as a single bit.
name DEC:
bits 01100011
bits 01110011
bits 01101011
bits 01111011
name INC:
bits 01100111
bits 01110111
bits 01101111
@rbran
rbran / binshow.rs
Created January 15, 2026 11:58
Example of Binary Ninja rust plugin that detect new data events on all BinaryViews
use binaryninja::binary_view::{
BinaryView, BinaryViewEventHandler, BinaryViewEventType,
};
use binaryninja::data_notification::{
CustomDataNotification, DataNotificationTriggers,
};
use binaryninja::tags::TagReference;
const LOG_NAME: &str = "BinShow";
macro_rules! info {
($msg:expr) => {
@rbran
rbran / functions.md
Created March 2, 2026 19:59
Core API function uses of APIs 2026/03/02
rs py cpp Function Name
πŸ¦€ 🐍 πŸ€ BNAllocString
🚧 🚧 🚧 BNAllocStringWithLength
πŸ¦€ 🐍 πŸ€ BNFreeString
πŸ¦€ 🚧 🚧 BNAllocStringList
πŸ¦€ 🐍 πŸ€ BNFreeStringList
🚧 🐍 🚧 BNShutdown
🚧 🚧 🚧 BNIsShutdownRequested
πŸ¦€ 🐍 πŸ€ BNGetVersionInfo
@rbran
rbran / main.rs
Created March 16, 2026 10:46
Breaking three sticks
// inspired by https://www.youtube.com/watch?v=vR3b8N-YOLA
// breaking a stick in two random points or
// breaking a stick in one point and then breaking the other randonly
// gives very diferent changes of forming a triangle with the three pices.
use std::cmp::Ordering;
use std::time::{Duration, SystemTime};
use rand;