Skip to content

Instantly share code, notes, and snippets.

@Chubek
Chubek / README.md
Last active May 31, 2023 13:46
Tools to Mix C and Assembly

This gist contains C preprocessor files to mix C and Assembly easier.

  • syscnr.inc includes all the Linux system call numbers.
  • registers.inc includes all the Linux ABI registers for both C and system calls. Arguments start at 0.
  • syscall.inc includes macros for syscalls based on argument number.

Please do not remove the newline at the end of each file. Head to my Github profile where you will find a lot of goodies, a lot of projects and the such and so. My project Panah has some good Assembly code mixed with C.

Enjoy.

@boarchuz
boarchuz / esp_rtc_reset.c
Last active January 19, 2022 17:40
ESP32 RTC Reset
#include "soc/rtc_cntl_struct.h"
#include "hal/wdt_types.h"
#include "hal/rwdt_ll.h"
void __attribute__((noreturn)) esp_rtc_reset(void)
{
rwdt_ll_write_protect_disable(&RTCCNTL);
rwdt_ll_disable(&RTCCNTL);
rwdt_ll_config_stage(&RTCCNTL, WDT_STAGE0, 0, WDT_STAGE_ACTION_RESET_RTC);
rwdt_ll_disable_stage(&RTCCNTL, WDT_STAGE1);
@muff-in
muff-in / resources.md
Last active April 27, 2024 22:37
A curated list of Assembly Language / Reversing / Malware Analysis / Game Hacking-resources
@joaomoreno
joaomoreno / README.md
Last active February 1, 2024 22:19
VS Code Insiders Updater for Linux

VS Code Insiders Updater for Linux

This script will download and replace ~/Applications/VSCode-linux-x64 with the latest VS Code Insiders.

gif

Install

  1. Install jq: https://stedolan.github.io/jq/download/
  2. Place update-code somewhere in your PATH
@shafik
shafik / WhatIsStrictAliasingAndWhyDoWeCare.md
Last active May 2, 2024 15:08
What is Strict Aliasing and Why do we Care?

What is the Strict Aliasing Rule and Why do we care?

(OR Type Punning, Undefined Behavior and Alignment, Oh My!)

What is strict aliasing? First we will describe what is aliasing and then we can learn what being strict about it means.

In C and C++ aliasing has to do with what expression types we are allowed to access stored values through. In both C and C++ the standard specifies which expression types are allowed to alias which types. The compiler and optimizer are allowed to assume we follow the aliasing rules strictly, hence the term strict aliasing rule. If we attempt to access a value using a type not allowed it is classified as undefined behavior(UB). Once we have undefined behavior all bets are off, the results of our program are no longer reliable.

Unfortunately with strict aliasing violations, we will often obtain the results we expect, leaving the possibility the a future version of a compiler with a new optimization will break code we th

@pierrejoubert73
pierrejoubert73 / markdown-details-collapsible.md
Last active May 2, 2024 16:19
How to add a collapsible section in markdown.

How to add a collapsible section in markdown

1. Example

Click me

Heading

  1. Foo
  2. Bar
    • Baz
  • Qux
@JamesMGreene
JamesMGreene / gitflow-breakdown.md
Last active May 3, 2024 12:32
`git flow` vs. `git`: A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository