Skip to content

Instantly share code, notes, and snippets.

View mrexodia's full-sized avatar
🍍

Duncan Ogilvie mrexodia

🍍
View GitHub Profile
@giladHaimov
giladHaimov / BasicERC20.sol
Last active March 19, 2025 19:41
Basic ERC20 implementation
pragma solidity ^0.4.19;
contract ERC20Basic {
string public constant name = "ERC20Basic";
string public constant symbol = "BSC";
uint8 public constant decimals = 18;
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
@fay59
fay59 / Quirks of C.md
Last active July 26, 2025 08:32
Quirks of C

Here's a list of mildly interesting things about the C language that I learned mostly by consuming Clang's ASTs. Although surprises are getting sparser, I might continue to update this document over time.

There are many more mildly interesting features of C++, but the language is literally known for being weird, whereas C is usually considered smaller and simpler, so this is (almost) only about C.

1. Combined type and variable/field declaration, inside a struct scope [https://godbolt.org/g/Rh94Go]

struct foo {
   struct bar {
 int x;
@namazso
namazso / pdb_parser_lite.cpp
Created April 18, 2018 17:49
A lightweight PDB parser that retrieves type and symbol CodeView streams.
/* MIT License
*
* Copyright (c) namazso 2018
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
@seanjensengrey
seanjensengrey / octal_x86.txt
Last active July 9, 2025 04:26
x86 is an octal machine
# source:http://geocities.com/SiliconValley/heights/7052/opcode.txt
From: [email protected] (Mark Hopkins)
Newsgroups: alt.lang.asm
Subject: A Summary of the 80486 Opcodes and Instructions
(1) The 80x86 is an Octal Machine
This is a follow-up and revision of an article posted in alt.lang.asm on
7-5-92 concerning the 80x86 instruction encoding.
The only proper way to understand 80x86 coding is to realize that ALL 80x86
@shafik
shafik / WhatIsStrictAliasingAndWhyDoWeCare.md
Last active August 1, 2025 01: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

@atar-axis
atar-axis / win_re_processes.txt
Last active July 29, 2024 18:00
List of filenames and Window ClassNames related to reverse engineering (which malware may look for)
Filename : ClassName - Program
Debuggers/Disassemblers:
---
OLLYDBG.exe : OllyDbg - OllyDbg
x32dbg.exe : (Qt5QWindowIcon) - x32Dbg
x64dbg.exe : (Qt5QWindowIcon) - x64Dbg
x96dbg.exe : (#32770) - x32/x64Dbg Launcher
idag.exe : TIdaWindow - IDA native Windows (deprecated)
@kingseva
kingseva / allocterminal.cpp
Created January 27, 2018 15:11
Example redirecting cout/stdout to allocated terminal in GUI programs.
#include "rang.hpp"
#include <windows.h>
#include <cstdlib>
void BindStdHandlesToConsole()
{
//TODO: Add Error checking.
// Redirect the CRT standard input, output, and error handles to the console
@mgeeky
mgeeky / dtpscan.py
Last active September 19, 2023 23:15
DTP Scanner - simple script trying to determine type of configured switchport and DTP negotation mode in order to assist in VLAN Hopping attacks.
#!/usr/bin/python
#
# Simple script showing configuration of the DTP protocol on
# the switch's port. This reconessaince will be helpful for performing
# VLAN Hopping attacks.
#
# Mariusz B. / mgeeky, '18
#
@magjac
magjac / README.md
Last active September 21, 2024 15:25
d3-graphviz demo application showing association of SVG elements with DOT source elements

Open the console to see detalied info about what's going on

@Jinmo
Jinmo / jni_all.h
Created May 26, 2017 07:36
Useful when reversing JNI on IDA Pro
/*
* Copyright (c) 1996, 1998, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*