Skip to content

Instantly share code, notes, and snippets.

View th0rex's full-sized avatar

Timo von Hartz th0rex

View GitHub Profile
@th0rex
th0rex / Cargo.toml
Created December 7, 2019 10:08
zydis rs bench
[package]
name = "zydis-rs-bench"
version = "0.1.0"
authors = ["th0rex "]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
goblin = "*"
> PS: You want to hook into font-lock rather than into
> `window-scroll-functions`. More about this is my next email.
Here's one way to do it.
[ Note: like the previous, this is guarantee 100% untested. ]
Stefan
@th0rex
th0rex / Usage.md
Last active February 21, 2025 23:26
Build qemu as a library

Place file into qemu root directory Do cd path/to/qemu && ./name_of_file name_of_target (i.e. x86_64-softmmu) Library is at /path/to/qemu/x86_64-softmmu/libqemu.so You might need to compile vl.c and link with it in your final binary, just do something like this:

#define main __definetly_not_main
#include "/path/to/qemu/vl.c"
#undef main
#include <stdio.h>
#include <functional>
#include <unordered_map>
template<template<typename> typename F>
struct fix { F<fix<F>> f; };
enum kind {
Int, Var, Add, Div, Mul, Sub
};
ACTION=="add", SUBSYSTEM=="input", ENV{ID_VENDOR_ENC}=="Logitech", ENV{ID_INPUT_KEYBOARD}=="1", RUN+="/bin/sh -c 'sudo -u user DISPLAY=:0 XAUTHORITY=/home/user/.Xauthority DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus /usr/bin/notify-send -u critical \"foo\"'"