Skip to content

Instantly share code, notes, and snippets.

View defunctio's full-sized avatar

defunct defunctio

View GitHub Profile
@joshwatson
joshwatson / callgraph.py
Last active July 10, 2020 02:08
Callgraph Generating Binary Ninja Plugin
import struct
import threading
import binaryninja as bn
class Graph(object):
def __init__(self, view):
# type: (Graph, bn.BinaryView) -> None
self.view = view
@mattifestation
mattifestation / BaseEnforcementPolicy.xml
Last active March 5, 2021 16:31
A Device Guard policy in enforcement mode that just works. It permits execution of only enough to boot the OS, run Windows code, and run Store apps.
<?xml version="1.0" encoding="utf-8"?>
<SiPolicy xmlns="urn:schemas-microsoft-com:sipolicy">
<VersionEx>10.0.0.0</VersionEx>
<PolicyTypeID>{A244370E-44C9-4C06-B551-F6016E563076}</PolicyTypeID>
<PlatformID>{2E07F7E4-194C-4D20-B7C9-6F44A6C5A234}</PlatformID>
<Rules>
<Rule>
<Option>Enabled:Unsigned System Integrity Policy</Option>
</Rule>
<Rule>
@pgoodman
pgoodman / asan.md
Created July 3, 2020 03:59
Address Sanitizer

On macOS

export CFLAGS="-fsanitize=address -ffunction-sections -fdata-sections -Wl,-dead_strip -Wl,-undefined,dynamic_lookup -Wno-unused-command-line-argument"
export CXXFLAGS="-fsanitize=address -ffunction-sections -fdata-sections -Wl,-dead_strip -Wl,-undefined,dynamic_lookup -Wno-unused-command-line-argument"

On Linux

export CFLAGS="-fsanitize=address -ffunction-sections -fdata-sections -Wl,--gc-sections -Wl,--allow-multiple-definition"
export CXXFLAGS="-fsanitize=address -ffunction-sections -fdata-sections -Wl,--gc-sections -Wl,--allow-multiple-definition"
@willccbb
willccbb / grpo_demo.py
Last active May 9, 2025 03:34
GRPO Llama-1B
# train_grpo.py
#
# See https://github.com/willccbb/verifiers for ongoing developments
#
import re
import torch
from datasets import load_dataset, Dataset
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import LoraConfig
from trl import GRPOConfig, GRPOTrainer