Skip to content

Instantly share code, notes, and snippets.

View betelgeuse-7's full-sized avatar
🟡
Learning

Abidin Durdu betelgeuse-7

🟡
Learning
View GitHub Profile
@betelgeuse-7
betelgeuse-7 / x86.py
Created April 29, 2024 19:38
Scripts to look up a particular x86 instruction in your browser (felixcloutier.com)
import sys
import webbrowser
if __name__ == "__main__":
if len(sys.argv) != 2:
print("Usage: python3 x86.py <instruction>")
sys.exit(1)
instr = sys.argv[1]
url = f"https://www.felixcloutier.com/x86/{instr}"
@betelgeuse-7
betelgeuse-7 / inspect_reg.c
Created March 26, 2024 15:49
A simple example of extended inline assembly syntax of GCC that outputs the integer representations of some of the 64-bit x86 general-purpose registers.
#include <stdio.h>
int main() {
long rax, rbx, rcx, rdx, rdi, rsi, rsp, rbp;
asm (
"movq %%rax, %0\n"
"movq %%rbx, %1\n"
"movq %%rcx, %2\n"
"movq %%rdx, %3\n"
@betelgeuse-7
betelgeuse-7 / split.go
Last active August 29, 2023 16:56
Split a file into chunks.
// FILE=file.ext CHUNKS=4 go run split.go
// CHUNKS is optional (default is 4).
package main
import (
"fmt"
"os"
"strconv"
"sync"
)
@betelgeuse-7
betelgeuse-7 / hardlink.go
Last active May 21, 2023 19:58
Creating a hardlink using cgo.