Skip to content

Instantly share code, notes, and snippets.

View zommiommy's full-sized avatar
💤
Too tired to live

Tommaso Fontana zommiommy

💤
Too tired to live
View GitHub Profile
@zommiommy
zommiommy / shell.nix
Created September 10, 2024 20:00
Nix-shell that can run idapro 9.0
{ pkgs ? import <nixpkgs> {} }:
let
idaProPath = "$PWD"; # Adjust this to your IDA Pro installation path
idaExecutable = "${idaProPath}/ida64"; # Adjust if needed for different executables
fhsEnv = pkgs.buildFHSUserEnv {
name = "ida-pro-env";
targetPkgs = pkgs: (with pkgs; [
glibc
libGL
@zommiommy
zommiommy / vmmap.py
Last active July 16, 2024 14:42
make lldb usable. use `command script import /path/to/vmmap.py` to import it. It's important that the file is named vmmap
def parse_maps(pid):
with open("/proc/{pid}/maps".format(pid=pid)) as f:
for line in f.readlines():
vals = (
val.strip()
for val in line.split(" ")
if val.strip()
)
addrs = next(vals)
@zommiommy
zommiommy / data.csv
Last active March 20, 2024 13:37
Bisect the stack needed to sort a vec of a given size using rayon par sort unstable
1 1
2 1
3 1
4 1
5 1
6 1
7 1
8 1
9 1
10 1
#![no_std]
extern crate alloc;
use alloc::vec::Vec;
use primitive::Primitive;
/// Implementation of:
/// > An Efficient Representation for Sparse Sets
/// > by Preston Briggs and Linda Torczon
/// > <https://dl.acm.org/doi/pdf/10.1145/176454.176484>
/// > <https://research.swtch.com/sparse>
@zommiommy
zommiommy / sip.rs
Created July 28, 2023 10:51
Hashes impl
//! Implementation of SipHash from [Jean-Philippe Aumasson](https://www.aumasson.jp/) and Daniel J. Bernstein.
//!
//! SipHash is a general-purpose hashing function: it runs at a good
//! speed (competitive with Spooky and City) and permits strong _keyed_
//! hashing. This lets you key your hash tables from a strong RNG, such as
//! [`rand::os::OsRng`](https://docs.rs/rand/latest/rand/rngs/struct.OsRng.html).
//!
//! Although the SipHash algorithm is considered to be generally strong,
//! it is not intended for cryptographic purposes. As such, all
//! cryptographic uses of this implementation are _strongly discouraged
@zommiommy
zommiommy / main.rs
Created May 28, 2023 19:57
Implementation of online first and second order ordinary least squares regression
/// A simple online linear regression algorithm.
/// See https://en.wikipedia.org/wiki/Simple_linear_regression#Fitting_the_regression_line
/// for details.
pub struct FirstOrderOLS {
x: f64,
y: f64,
xx: f64,
xy: f64,
n: usize,
@zommiommy
zommiommy / bench.rs
Created May 12, 2023 15:28
Code for benchmarking all the implementations of the cardinality extimations of hyperloglog
#![feature(test)]
extern crate test;
use test::{black_box, Bencher};
// Optionally include some setup
const NUMBER_OF_ELEMENTS: usize = 10_000;
const BITS: usize = 5;
fn gen_data() -> Vec<u8> {
let mut res = Vec::with_capacity(NUMBER_OF_ELEMENTS);
@zommiommy
zommiommy / lib.rs
Last active January 14, 2023 18:43
Better num-traits ?
#![deny(unconditional_recursion)]
use core::fmt::{Debug, Display, LowerHex, Binary};
use core::ops::*;
use core::sync::atomic::*;
use core::num::*;
/// Trait of operations possible on both Signed and Unsiged words
pub trait Number: Sized + Send + Sync +
Display + LowerHex +
@zommiommy
zommiommy / .env
Created October 4, 2022 15:41
Elastic + Kibana + TheHive + Cortex
# Version of Elastic products
STACK_VERSION=8.4.2
# Port to expose Elasticsearch HTTP API to the host
ES_PORT=9200
# Port to expose Kibana to the host
KIBANA_PORT=5601
# RAM for each service 4GB
@zommiommy
zommiommy / emulator.py
Last active September 26, 2022 21:27
iki1vm-crackmeeva aka armando che mi fa' perdere tempo https://github.com/TeamItaly/TeamItalyCTF-2022/tree/master/CrackmeEVA
import struct
def u32(data):
return struct.unpack("i", data)[0]
def p32(data):
return struct.pack("i", data)
class Regs:
IP = 0