Skip to content

Instantly share code, notes, and snippets.

@hgarrereyn
hgarrereyn / changevm.asm
Created December 22, 2019 16:54
Annotated disassembly for Change VM - justCTF 2019
_start:
[2000] :: 01 01 00 00 :: ld r1, 0
[2004] :: 01 02 28 00 :: ld r2, 40
[2008] :: 0C 01 02 00 :: write(buf=r1, n=r2) # hello!
[200C] :: 01 01 28 00 :: ld r1, 40
[2010] :: 01 02 03 00 :: ld r2, 3
[2014] :: 0C 01 02 00 :: write(buf=r1, n=r2) # >>
[2018] :: 0E 00 D2 04 :: setkey 4D204D2
[201C] :: 01 04 00 08 :: ld r4, 2048
[2020] :: 01 05 2F 00 :: ld r5, 47 # flag len
// start with:
// frida -U -l pinning.js -f [APP_ID] --no-pause
Java.perform(function () {
console.log('')
console.log('===')
console.log('* Injecting hooks into common certificate pinning methods *')
console.log('===')
var X509TrustManager = Java.use('javax.net.ssl.X509TrustManager');
@shafik
shafik / WhatIsStrictAliasingAndWhyDoWeCare.md
Last active June 13, 2024 00:48
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

@mariocesar
mariocesar / index.html
Last active April 16, 2023 02:49
Example Python + Websockets to emulate tail -f
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Tail </title>
<style>
body {font-family: monospace;}
p{ margin: 0;}
ul{padding: 0;}
@pshchelo
pshchelo / mount-qcow2-lvm-image.sh
Last active March 6, 2024 19:05
List of commands to mount/unmount a qcow2 image conatining LVM partitions.
# kudos to dzaku at consolechars.wordpress.com
### MOUNT qcow2 image with lvm partitions
# ensure nbd can handle that many partitions
sudo modprobe nbd max_part=8
# present image as block device through NBD
sudo qemu-nbd --connect=/dev/nbd0 <image.qcow2>
@nauhygon
nauhygon / Build Emacs for Windows 64bit with Native Compilation.md
Last active June 13, 2024 01:29
Step-by-step instructions to build Emacs for Windows 64 bit with MSYS2 and MinGW-w64. Now `native-comp` supported.

Build Emacs-w64 with MSYS2/MinGW-w64 with Native Compilation

Instructions are modified from emacs-w64 Wiki page by zklhp. Many thanks for sharing!

  1. Download the latest MSYS2 from this download page.

  2. Install MSYS2 to, for example, C:\msys2 (make sure no space in path to avoid unwanted problems).

  3. Optionally prettify the MSYS2 console mintty with ~/.minttyrc to make it more pleasing to eyes. Thanks to this awesome theme!

@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active June 13, 2024 05:29
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname