Skip to content

Instantly share code, notes, and snippets.

@str4d
str4d / DemangleRust.py
Last active November 18, 2024 15:32
Ghidra script for demangling Rust symbols
# Attempts to demangle all mangled symbols in the current program using the Rust
# mangling schemes, and replace the default symbol and function signature
# (if applicable) with the demangled symbol.
#
# License: MIT OR Apache-2.0
#@author Jack Grigg <thestr4d@gmail.com>
#@category Symbol
import string
@str4d
str4d / extract_p2sh_opcodes.py
Last active December 27, 2020 21:00
Zcash P2SH metadata collection from zcashd RPCs
import csv
from enum import IntEnum
FILENAME = 'zcash-p2sh-data.csv'
class OpCode(IntEnum):
# push value
OP_0 = 0x00
OP_FALSE = OP_0
diff --git a/src/gtest/test_checktransaction.cpp b/src/gtest/test_checktransaction.cpp
index 11607b2..f9caccc 100644
--- a/src/gtest/test_checktransaction.cpp
+++ b/src/gtest/test_checktransaction.cpp
@@ -354,23 +354,27 @@ TEST(checktransaction_tests, bad_txns_prevout_null) {
}
TEST(checktransaction_tests, bad_txns_invalid_joinsplit_signature) {
+ SelectParams(CBaseChainParams::REGTEST);
+
@str4d
str4d / equihash.rs
Last active August 7, 2018 07:24
Equihash validator
use std::mem;
use std::ptr;
use byteorder::{LittleEndian, WriteBytesExt};
use libsodium_sys::crypto_generichash_blake2b_init_salt_personal;
use libsodium_sys::crypto_generichash_blake2b_state;
use libsodium_sys::crypto_generichash_blake2b_update;
use libsodium_sys::crypto_generichash_blake2b_final;
use libsodium_sys::crypto_generichash_statebytes;
use rustc_serialize::hex::ToHex;
@str4d
str4d / keybase.md
Created November 17, 2016 19:53
Keybase proof

Keybase proof

I hereby claim:

  • I am str4d on github.
  • I am str4d (https://keybase.io/str4d) on keybase.
  • I have a public key ASA2ZtnSp1EQjQ4efpvwNqpinaMv1oju0eBXEnG_-VODsgo

To claim this, I am signing this object:

// License: MIT
// http://opensource.org/licenses/MIT
package net.i2p.android.router.util;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.telephony.TelephonyManager;
/**