Skip to content

Instantly share code, notes, and snippets.

@w4kfu-synacktiv
w4kfu-synacktiv / msdelta.py
Last active January 2, 2025 15:42
Python wrapper around msdelta.dll
import ctypes
import os
import datetime
import argparse
HANDLE = ctypes.c_void_p
HMODULE = HANDLE
LPCSTR = LPSTR = ctypes.c_char_p
BOOL = ctypes.c_long
BYTE = ctypes.c_ubyte
@icecr4ck
icecr4ck / idapython_cheatsheet.md
Last active March 11, 2025 14:17
Cheatsheet for IDAPython
@littlelailo
littlelailo / apollo.txt
Created September 27, 2019 12:04
Apple Bootrom Bug
This bug was also called moonshine in the beginning
Basically the following bug is present in all bootroms I have looked at:
1. When usb is started to get an image over dfu, dfu registers an interface to handle all the commands and allocates a buffer for input and output
2. if you send data to dfu the setup packet is handled by the main code which then calls out to the interface code
3. the interface code verifies that wLength is shorter than the input output buffer length and if that's the case it updates a pointer passed as an argument with a pointer to the input output buffer
4. it then returns wLength which is the length it wants to recieve into the buffer
5. the usb main code then updates a global var with the length and gets ready to recieve the data packages
6. if a data package is recieved it gets written to the input output buffer via the pointer which was passed as an argument and another global variable is used to keep track of how many bytes were recieved already
7. if all the data was recieved th
@ubogdan
ubogdan / ida_plugins.md
Created August 11, 2019 09:03
A list of IDA Plugins

A list of IDA Plugins

I'll be organizing the plugins over time. Please submit PRs if you have any other outstanding plugins. I would like to tag each plugin with its corresponding IDA version, but it will take me a long time to test. If you can help there, please do.

If a plugin is only a source repo with no description or documentation, I am not adding it.

TODO

  • Add more plugins
  • Categorize plugins
@truemongo
truemongo / gist:7aea60f80f6aa9b79cc9509b633557c9
Last active December 8, 2024 20:27
Infineon TPM fake buggy key generator
#!/usr/bin/python2
from random import randint, choice
from gmpy2 import is_prime # pip install gmpy2
import operator
### Code from ROCA
primes = [3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101,
103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167]
prints = [6, 30, 126, 1026, 5658, 107286, 199410, 8388606, 536870910, 2147483646, 67109890, 2199023255550,
@Cr4sh
Cr4sh / DmaHvBackdoor.c
Last active January 23, 2024 22:31
Hyper-V backdoor for UEFI
/*
*********************************************************************
Part of UEFI DXE driver code that injects Hyper-V VM exit handler
backdoor into the Device Guard enabled Windows 10 Enterprise.
Execution starts from new_ExitBootServices() -- a hook handler
for EFI_BOOT_SERVICES.ExitBootServices() which being called by
winload!OslFwpKernelSetupPhase1(). After DXE phase exit winload.efi
transfers exeution to previously loaded Hyper-V kernel (hvix64.sys)
@Velocet
Velocet / EDK2_2015_GUIDs-2017-04-27.csv
Last active October 11, 2020 10:30
EDK2 2015 GUIDs - Consolidated list of all *.dec/*.inf files as of 2017-04-27 (some duplicates removed)
00000000-0000-0000-0000-000000000000 Zero
00000000-0000-0000-0000-000000000000 EfiPartTypeUnused
00000000-0000-0000-0000-000000000000 EfiTpmDeviceInstanceNone
00160F8D-2B35-4DF2-BBE0-B272A8D631F0 FirmwarePerformanceDxe
00214CC1-06D1-45FE-9700-DCA5726AD7BF ArmVirtPlatformLib
0049858F-8CA7-4CCD-918B-D952CBF32975 VirtioFdtDxe
0053D9D6-2659-4599-A26B-EF4536E631A9 ShellAlias
0065D394-9951-4144-82A3-0AFC8579C251 EfiPeiRscHandlerPpi
00720665-67EB-4A99-BAF7-D3C33A1C7CC9 EfiTcp4ServiceBindingProtocol
00C86DB8-013B-4FF4-B8E9-208F4FCF1C00 LibSignal
@moshekaplan
moshekaplan / PatchExtract125.ps1
Created November 15, 2016 23:27 — forked from anonymous/PatchExtract125.ps1
Patch Extract v1.25 by Greg Linares (@Laughing_Mantis)
<#
================
PATCHEXTRACT.PS1
=================
Version 1.25 Microsoft MSU Patch Extraction and Patch Organization Utility by Greg Linares (@Laughing_Mantis)
This Powershell script will extract a Microsoft MSU update file and then organize the output of extracted files and folders.
Organization of the output files is based on the patch's files and will organize them based on their archicture (x86, x64, or wow64)
as well as their content-type, ie: resource and catalog files will be moved to a JUNK subfolder and patch binaries and index files will
@jaybosamiya
jaybosamiya / IDAPython_on_IDADemo.md
Last active November 25, 2023 14:40
How to get IDA Python to work with IDA Demo

How to get IDA Python to work with IDA Demo

Go to the IDAPython binaries page. Download the latest _linux.zip file and extract it. In my case, it was idapython-6.9.0-python2.7-linux.zip. Follow the instructions in its README.txt.

For simplicity, I have copy pasted the relevant portions here:

@rozifus
rozifus / Python SimpleHTTPServer with SSL
Last active October 9, 2022 22:40
Python SimpleHTTPServer with SSL
# useful for running ssl server on localhost
# which in turn is useful for working with WebSocket Secure (wss)
# copied from http://www.piware.de/2011/01/creating-an-https-server-in-python/