Skip to content

Instantly share code, notes, and snippets.

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

Mahmoud Rusty Abdelkader mahmoudimus

💭
@_@
View GitHub Profile
@mahmoudimus
mahmoudimus / get_sig.py
Created June 28, 2025 18:28 — forked from yeggor/get_sig.py
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
@mahmoudimus
mahmoudimus / enviorenmentfixes.md
Created June 28, 2025 00:29 — forked from Acephalia/enviorenmentfixes.md
Quick Guide For Fixing/Installing Python, PyTorch, CUDA, Triton, Sage Attention and Flash Attention For Local AI Image Generation

Quick Guide For Fixing/Installing Python, PyTorch, CUDA, Triton, Sage Attention and Flash Attention For Local AI Image Generation

With all the new local image & video generation tools coming out I've been seeing a lot of posts and error threads being opened for various issues with cuda/pytorch/sage attantion/triton/flash attention. I was tired of digging links up so I initially made this as a cheat sheet for myself but expanded it with hopes that this will help some of you get your venvs and systems running smoothly.

In This Guide:

  1. Check Installed Python Versions
  2. Set Default Python Version by Changing PATH
  3. Installing VS Build Tools
  4. Check the Currently Active CUDA Version
@Acephalia
Acephalia / enviorenmentfixes.md
Last active June 28, 2025 00:52
Quick Guide For Fixing/Installing Python, PyTorch, CUDA, Triton, Sage Attention and Flash Attention For Local AI Image Generation

Quick Guide For Fixing/Installing Python, PyTorch, CUDA, Triton, Sage Attention and Flash Attention For Local AI Image Generation

With all the new local image & video generation tools coming out I've been seeing a lot of posts and error threads being opened for various issues with cuda/pytorch/sage attantion/triton/flash attention. I was tired of digging links up so I initially made this as a cheat sheet for myself but expanded it with hopes that this will help some of you get your venvs and systems running smoothly.

In This Guide:

  1. Check Installed Python Versions
  2. Set Default Python Version by Changing PATH
  3. Installing VS Build Tools
  4. Check the Currently Active CUDA Version
@mahmoudimus
mahmoudimus / _.md
Last active April 9, 2025 16:18 — forked from Jinmo/_.md
C/C++ header to IDA

Usage

In IDAPython,

execfile('<path>/cxxparser.py')
parse_file('<path>/a.cpp',[r'-I<path>\LuaJIT-2.0.5\src', '-D__NT__', '-D__X64__', '-D__EA64__'])
parse_file('<path>/malloc.c',['-target=x86_64-linux-gnu'])
@mahmoudimus
mahmoudimus / idapro_python_apply_dif_file_patch_to_idb.py
Created February 18, 2025 21:51
Program for using IDA's .dif files to patch binaries
# from https://reverseengineering.stackexchange.com/a/11835/13408
# ported to python3 and IDA 8.0+ by Mahmoud Abdelkader
import idaapi
import ida_bytes
import ida_kernwin
def apply_dif_file(dif_file_name):
print("Applying " + dif_file_name + " to database.")
@junron
junron / demo.py
Last active February 7, 2025 05:14
C Types for Python
import real_ctypes
arr = (char[16])(b'I love Python+C!')
print("A big integer:", (uint128)(arr))
arr2 = (long[:])(arr)
print("Chunked:", arr2)
arr2 += 1
print("Back to bytes, but offset:", bytes((char[:])(arr2)))
@mahmoudimus
mahmoudimus / stop-cheatengine-laugh.bat
Last active August 9, 2024 19:31
Cheat Engine's Creepy Laughter on Windows Mahmoud Abdelkader (aka mahmoudimus)
@echo off
REM Place this file into the cheat engine directory and run it.
REM
REM If you've downloaded Cheat Engine and installed it from a non-standard installer,
REM you might periodically hear a creepy man's laugh lasting three seconds or so. It
REM seems like it might be a virus, malware or something untoward but it is not. It
REM turns out, for non-Patreon users, cheat engine software has a two-stage installer.
REM
REM The first stage is basically adware. The second stage downloads the actual
REM installer, which can malfunction if not launched by the ad-filled installer.
@mahmoudimus
mahmoudimus / leaderkeyideas.md
Last active July 10, 2024 17:18
Emacs Key Leader Keys

Obviously the normal ones are: Ctrl-x, Ctrl-u

Alt can be a good leader prefix. Alt-x is emacs-extended-command. Alt-m is used by spacemacs.

Visual Studio has Ctrl-k, Ctrl-e, but IMO, they are not good. Those are very "hot" keys that are used all the time

Tmux has Ctrl-b, which is almost always rebound to Ctrl-a for memory compatibility with Screen's Ctrl-a. It's also not good IMO, but Tmux is used very often that it is reasonable to include Ctrl-a as a leader key.

One I've started playing with is Ctrl-Insert - it has almost no conflicts. There are also Ctrl-Numlock and Ctrl-Scrolllock

@mahmoudimus
mahmoudimus / llvm17_clang17.sh
Last active April 1, 2024 14:12
dockerfile to build tensorflow from source
function install() {
wget https://apt.llvm.org/llvm.sh
chmod u+x llvm.sh
sudo ./llvm.sh 17
locate clang-17
clang-17 --version
}
function uninstall() {
sudo rm /etc/apt/sources.list.d/archive_uri-http_apt_llvm_org_*.list