Skip to content

Instantly share code, notes, and snippets.

View mahmoudimus's full-sized avatar
💭
@_@

Mahmoud Rusty Abdelkader mahmoudimus

💭
@_@
View GitHub Profile
@yeggor
yeggor / get_sig.py
Created March 20, 2021 02:32
Fixed ida2pat.py script provided by fireeye (https://github.com/fireeye/flare-ida/blob/master/python/flare/idb2pat.py) + get_sig.py script to generate FLIRT SIG file from many source binary files
#!/usr/bin/env python3
import os
import platform
import subprocess
import time
from concurrent.futures import ProcessPoolExecutor, as_completed
import click
from elftools.elf.elffile import ELFFile
@CaledoniaProject
CaledoniaProject / main.cpp
Created March 17, 2021 13:58
system resources physical memory map VM detection trick
// system resources physical memory map VM detection trick
// written by Graham Sutherland (@gsuberland) for Nettitude
// based on prior work done as part of the al-khaser project
// https://github.com/LordNoteworthy/al-khaser/
// ref: https://blog.xpnsec.com/total-meltdown-cve-2018-1038/
// ref: https://gist.github.com/xpn/3792ec34d712425a5c47caf5677de5fe
// compile:
@shashankrnr32
shashankrnr32 / model.py
Last active July 18, 2024 01:10
Pydantic Model with Builder pattern
"""
Github Issue Thread: https://github.com/samuelcolvin/pydantic/issues/2152#issuecomment-786713976
License : MIT
Copyright 2021 Shashank Sharma
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,
@mrphrazer
mrphrazer / flattening_heuristic.py
Created March 4, 2021 20:28
Flattening Heuristic Implementation
# (c) Tim Blazytko 2021
# implementation based on the blog post "Automated Detection of Control-flow Flattening"
# https://synthesis.to/2021/03/03/flattening_detection.html
import sys
from miasm.analysis.binary import Container
from miasm.analysis.machine import Machine
from miasm.core.locationdb import LocationDB

ZSH CheatSheet

This is a cheat sheet for how to perform various actions to ZSH, which can be tricky to find on the web as the syntax is not intuitive and it is generally not very well-documented.

Strings

Description Syntax
Get the length of a string ${#VARNAME}
Get a single character ${VARNAME[index]}
@mahmoudimus
mahmoudimus / chrome-history-synced-tabs-exporter-with-postprocessors-4-marvelous-suspender-and-sessionbuddy.js
Last active February 8, 2025 18:47
Chrome history tabs iphone history export syncedTabs chrome://history/syncedTabs
/**
* This script extracts synced tabs from Chrome’s History page and post-processes tab URLs.
*
* It traverses the page’s shadow DOM to locate the list of synced devices and then iterates over
* each device card to collect the device name and its open tabs (each with a title and URL).
*
* For tabs whose URLs are prefixed by Marvelous Suspender (i.e. URLs that start with a chrome-extension
* scheme and include "/suspended.html#"), the script extracts the actual URL from the "uri" query parameter.
*
* The URL processing is designed to be extensible. Simply add additional processor functions to the
@apfelchips
apfelchips / macOS-shortcuts.ahk
Last active June 16, 2025 12:52
First remap modifier keys with sharpkeys; AHK script has to run as Administrator to work on System Windows / Apps running as Administrator; see Watchdog ScheduledTask below, when you do this make sure to remove the inherited file permissions from C:/tools and only allow administrators write access.
#SingleInstance force
;#Persistent https://www.autohotkey.com/docs/commands/_Persistent.htm
;#InstallKeybdHook ; see: https://www.autohotkey.com/docs/v1/lib/_HotkeyModifierTimeout.htm
;#NoTrayIcon
TraySetIcon("accessibilitycpl.dll","6") ; Keyboard Icon
SetWorkingDir(A_ScriptDir) ; Ensures a consistent starting directory.
; Debugging
; #Warn All, OutputDebug ; Show Warnings in DebugView ( https://learn.microsoft.com/en-us/sysinternals/downloads/debugview )
@mahmoudimus
mahmoudimus / pygil.py
Created November 23, 2020 19:37
Python's GIL implemented in pure Python
"""
A pure python implementation of the CPython GIL
Note: this code will not run if you will try to execute it, because it's missing bytecode execution logic.
Originally from: https://rushter.com/blog/python-gil-thread-scheduling/
Some things to note:
- Each thread executes its code in the separate execution_loop which is run by the real OS threads.
- When Python creates a thread it calls the take_gil function before entering the execution_loop.
@mahmoudimus
mahmoudimus / ChangeAnnotationAtRuntime.java
Created November 6, 2020 17:46 — forked from henrrich/ChangeAnnotationAtRuntime.java
Modify annotation at runtime, java 8 support
public final class RuntimeAnnotations {
private static final Constructor<?> AnnotationInvocationHandler_constructor;
private static final Constructor<?> AnnotationData_constructor;
private static final Method Class_annotationData;
private static final Field Class_classRedefinedCount;
private static final Field AnnotationData_annotations;
private static final Field AnnotationData_declaredAnotations;
private static final Method Atomic_casAnnotationData;
private static final Class<?> Atomic_class;
@mahmoudimus
mahmoudimus / Online code utilities.md
Created September 29, 2020 20:30 — forked from fghber/Online code utilities.md
Online code utilities

Web IDEs

ideone Ideone is an online compiler and debugging tool which allows youto compile source code and execute it online in more than 60 programming languages and share links to the code.
repl.it Like ideaone, can also install missing Python packages.
Onlilne GDB Online compiler and debugger forC, C++, Python, Java, PHP, Ruby, Perl, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog, and more.
Coding Ground Advanced IDEs for C/C++, C#, GO, Java, PHP, Perl, Python, Octave/MATLOAB, R, Ruby, Scala, and compiler/interpreter for many other languages and frameworks.
JDOODLE very similar to ideone but a somewhat different set of languagse/compilers.

Dedicated: