Skip to content

Instantly share code, notes, and snippets.

ELF Format Cheatsheet

Introduction

Executable and Linkable Format (ELF), is the default binary format on Linux-based systems.

ELF

Compilation

@juniorprincewang
juniorprincewang / tcp_client.go
Created April 26, 2023 06:10 — forked from abhishekkr/tcp_client.go
simple golang's net example
package main
import (
"fmt"
"io/ioutil"
"net"
"os"
)
const (
@juniorprincewang
juniorprincewang / launch.json
Created November 29, 2022 07:19 — forked from xanathar/launch.json
launch.json to debug Rust with VsCode
{
// The following are sample configurations for common case scenarios of debugging
// Rust in Visual Studio Code
//
// For syntax, visit: https://go.microsoft.com/fwlink/?linkid=830387
//
"version": "0.2.0",
"configurations": [
{
"name": "Launch an application",
@juniorprincewang
juniorprincewang / Asset.sh
Created October 12, 2022 02:58 — forked from JoeyBurzynski/Asset.sh
Bash Scripting: Check if a Bash Variable Has Been Set (Or Is Empty String)
# How to determine if a bash variable is empty?
# A variable in bash (and any POSIX-compatible shell) can be in one of three states:
#
# unset
# set to the empty string
# set to a non-empty string
# Most of the time you only need to know if a variable is set to a non-empty string, but occasionally it's important to distinguish between unset and set # to the empty string.
#
#include <cmath>
#include <thread>
#include <Windows.h>
#include <MMSystem.h>
#pragma comment(lib, "winmm")
struct MultiMediaTimer {
static const wchar_t* name;
static LARGE_INTEGER elapsed[10000];
static int idx;
@juniorprincewang
juniorprincewang / Makefile
Last active June 15, 2022 08:22 — forked from kishmakov/Makefile
Shared libraries and Address Sanitizer (ASAN)
SAN_CMP := -fno-omit-frame-pointer -fsanitize=address
SAN_STAT := -static-libstdc++ -static-libasan
BIN_CMP := -std=c++11 -c -I. main.cpp -O -g3 -o main.o
LIB_CMP := -std=c++11 my.cpp -o libmy.so -shared -fPIC -g3
RUN := LD_LIBRARY_PATH=. ASAN_OPTIONS=symbolize=1 ASAN_SYMBOLIZER_PATH=$(shell which llvm-symbolizer)
PRELOAD := LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libasan.so.5
lib-gcc:
@juniorprincewang
juniorprincewang / Android.mk
Created August 3, 2021 06:15 — forked from akshar100/Android.mk
To add your own modules to the kernel of the Android-x86 project. Replace the Android.mk file in the kernel folder with this file.
#
# Copyright (C) 2009-2011 The Android-x86 Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@juniorprincewang
juniorprincewang / mesa-howto.md
Created June 22, 2021 07:12 — forked from Venemo/mesa-howto.md
How to build and use mesa from source

Building and using mesa for development and testing

This explains how to build mesa from source, and how to use the custom built mesa to run some apps and games, without needing to replace the mesa libraries that your operating system runs on.

Let's assume that you are using an x86_64 system.

Install dependencies

This is how to install them on Fedora. You can substitute with other distros' package managers, the packages are named similarly but maybe have a different naming convention (eg. -dev vs. -devel, etc.).

@juniorprincewang
juniorprincewang / Makefile
Created May 11, 2021 02:10 — forked from EXL/1-ReadMe.md
OpenGLES for Linux example
all:
$(CC) *.c -lm `sdl2-config --cflags` `sdl2-config --libs` -lEGL -lGLESv1_CM -o gles_linux
clean:
-rm -f gles_linux
-rm -f *.o
@juniorprincewang
juniorprincewang / amd-urls.txt
Last active April 25, 2021 03:36 — forked from yurikoles/amd-urls.txt
AMD GPU Open Source development docs
http://amd-dev.wpengine.netdna-cdn.com/wordpress/media/2013/10/AMD_HDA_verbs_v2.pdf
http://amd-dev.wpengine.netdna-cdn.com/wordpress/media/2013/10/CIK_3D_registers_v2.pdf
http://amd-dev.wpengine.netdna-cdn.com/wordpress/media/2013/10/si_programming_guide_v2.pdf
http://amd-dev.wpengine.netdna-cdn.com/wordpress/media/2013/10/SI_3D_registers.pdf
http://amd-dev.wpengine.netdna-cdn.com/wordpress/media/2013/10/evergreen_cayman_programming_guide.pdf
http://amd-dev.wpengine.netdna-cdn.com/wordpress/media/2013/10/evergreen_3D_registers_v2.pdf
http://amd-dev.wpengine.netdna-cdn.com/wordpress/media/2013/10/cayman_3D_registers_v2.pdf
http://amd-dev.wpengine.netdna-cdn.com/wordpress/media/2013/10/R6xx_R7xx_3D.pdf
http://amd-dev.wpengine.netdna-cdn.com/wordpress/media/2013/10/R6xx_3D_Registers.pdf
http://amd-dev.wpengine.netdna-cdn.com/wordpress/media/2012/10/r600isa.pdf