Skip to content

Instantly share code, notes, and snippets.

@blluv
blluv / colima
Last active August 16, 2024 01:43
colima
colima start -p x64 -a x86_64 -c 1 -m 2 -d 32 --vm-type qemu
alias start_pwn1804="DOCKER_HOST=unix:///Users/luv/.colima/x64/docker.sock docker run --security-opt seccomp=unconfined --privileged --cap-add=SYS_PTRACE -v ./:/pwn -it pwn:ubuntu1804 bash"
alias start_pwn2004="DOCKER_HOST=unix:///Users/luv/.colima/x64/docker.sock docker run --security-opt seccomp=unconfined --privileged --cap-add=SYS_PTRACE -v ./:/pwn -it pwn:ubuntu2004 bash"
alias start_pwn2204="DOCKER_HOST=unix:///Users/luv/.colima/x64/docker.sock docker run --security-opt seccomp=unconfined --privileged --cap-add=SYS_PTRACE -v ./:/pwn -it pwn:ubuntu2204 bash""
@blluv
blluv / legacyTx.py
Created July 24, 2024 15:25
0x15F1FCFD63656620BF58E2347B3504D6B92C70ED로 1wei를 보내는 코드
import rlp
import secp256k1
from Crypto.Hash import keccak
import requests
GWEI = 1000000000
PRIV_KEY = bytes.fromhex(
""
)
@blluv
blluv / openssl3_ecc.c
Created July 8, 2024 12:41
openssl3 ecc
#include <openssl/ec.h>
#include <openssl/obj_mac.h>
#include <openssl/objects.h>
#include <openssl/evp.h>
#include <openssl/pem.h>
#include <openssl/core_names.h>
void print_hex(const unsigned char *buf, size_t buf_len)
{
for (size_t i = 0; i < buf_len; i++)
gst-launch-1.0 rtpbin name=rtpbin \
udpsrc address=127.0.0.1 port=5000 caps="application/x-rtp,media=audio,clock-rate=48000,encoding-name=OPUS,payload=111" ! rtpbin.recv_rtp_sink_0 \
udpsrc address=127.0.0.1 port=5001 caps="application/x-rtp,media=video,clock-rate=90000,encoding-name=VP8,payload=96" ! rtpbin.recv_rtp_sink_1 \
rtpbin. ! rtpopusdepay ! opusparse ! mux. \
rtpbin. ! rtpvp8depay ! mux. \
webmmux name=mux ! filesink location=out.webm
class BitStream:
def __init__(self, data: bytes):
self.data = data
self.bitOffset = 0
def read_bits(self, bits: int):
if (bits + self.bitOffset) // 8 > len(self.data):
raise EOFError()
res = 0
@blluv
blluv / DLL_COPY.cpp
Last active January 27, 2024 16:47
#include "pch.h"
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <shlwapi.h>
#pragma comment(lib, "shlwapi")
DWORD run(LPVOID lpThreadParameter);
#!/bin/bash
if [ $# -ne 3 ]; then
echo "Usage: $0 {pack|unpack} cpio.gz-file dest"
exit -1
fi
if [ $1 = "pack" ]; then
(cd $3 && find . -print0 | cpio -o -H newc --null) | gzip -9 > $2
fi
@blluv
blluv / s-rand.py
Created September 24, 2023 14:09 — forked from integeruser/s-rand.py
Python port of the GLIBC rng
#!/usr/bin/env python2
from ctypes import c_int, c_uint
# http://www.mscs.dal.ca/~selinger/random/
def srand(seed):
srand.r = [0 for _ in range(34)]
srand.r[0] = c_int(seed).value
for i in range(1, 31):
def printAsTable(d: list, index=False):
headers = list(d[0].keys())
body = []
for row in d:
body.append(list(map(lambda v: row.get(v, ""), headers)))
if index:
headers = [""] + headers
body = list(map(lambda v: [v[0]] + v[1], enumerate(body)))
def printTree(tree, parentIdx=None, depth=0):
nodes = filter(lambda t: t["parentIdx"] == parentIdx, tree)
for node in nodes:
print("\t" * depth, node["name"], sep="")
printTree(tree, node["idx"], depth + 1)