Skip to content

Instantly share code, notes, and snippets.

View andermoran's full-sized avatar

Ander Moran andermoran

  • Microsoft
View GitHub Profile
@andermoran
andermoran / funkyClang.c
Created August 22, 2019 23:24
Weird clang behavior
// https://twitter.com/zneakr/status/1164651753993715712
/* So @zneakr tweeted about this weird behavior and I decided to tinker with his example. In order to optimize, clang
assigns fun_ptr to leak_all_my_secrets no matter what. This leads to "I have 9 toes" being printed no matter the
result of the if statement. Super weird behavior from clang and I just wanted to make a note of it :)
To reproduce this result:
clang funkyClang.c -O1 -o funkyClang; ./funkyClang
*/
#include <stdlib.h>
@andermoran
andermoran / angular-example-gist.ts
Last active October 3, 2019 15:17
This dynamic style in angular allows us to create dynamic css classes at runtime
let hrStyle: string = `
.underline {
height: .25rem;
width: 0%;
margin: 0;
background: black;
border: none;
transition: .3s ease-in-out;
position: relative;
}
@andermoran
andermoran / asm.sh
Last active February 12, 2020 21:08
Application Service Manager: a script that allows you to change an application's access to services (such as microphone, camera, etc)
#!/bin/bash
usage="usage: ./$(basename "$0") -s service [-d] [-m] [-c] app_name
where:
app_name: the name of the app
-s service: the service to change
-d disables the service (only put this option if you want to disable access)
-m sets the microphone as the service
-c sets the camera as the service
extra help:
@andermoran
andermoran / entra_admin_assistant_main.py
Last active March 14, 2024 02:29
entra_admin_assistant_main
import sys
import json
import subprocess
import secrets
import re
import requests
import base64
import os
from pyperclip import copy
# Helpers