Skip to content

Instantly share code, notes, and snippets.

@droogie
droogie / e1000.patch
Created September 30, 2020 05:59
QEMU 5.0.0 e1000 device patch to view leaked uninitialized memory from DMA mappings
--- orig_qemu/qemu-5.0.0/hw/net/e1000.c 2020-04-28 09:49:24.000000000 -0700
+++ qemu-5.0.0/hw/net/e1000.c 2020-09-28 00:31:20.000000000 -0700
@@ -42,8 +42,16 @@
static const uint8_t bcast[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
-/* #define E1000_DEBUG */
+#define PAGE_SHIFT 12
+#define PAGE_SIZE (1UL << PAGE_SHIFT)
+#define PAGE_MASK (~(PAGE_SIZE-1))
#include <stdio.h>
#include <math.h>
#include <Windows.h>
#define MAX_THREADS 32
typedef struct PrimeData {
unsigned long min;
unsigned long max;
unsigned long count;
// basic program to grab if a PE binary was compiled with ASLR or DEP
#include <stdio.h>
#include <stdlib.h>
#define BYTE unsigned char
#define WORD unsigned short
#define DWORD unsigned int
#define LONG long
#define ULONGLONG unsigned long long
@droogie
droogie / driver-trace.py
Last active June 4, 2020 06:11
pykd windbg driver trace script
# 'sxe ld driver.sys' to breakpoint when driver loads
# probably want to manually breakpoint DriverEntry then trace...
# or find a better solution than this ghetto script
# modified to use pykd api more and increase the speed significantly
import pykd
PATH = "C:\\Users\\droogie\\Desktop\\trace.txt"
MODULE_NAME = "driver.sys"
@droogie
droogie / binder-fuzzer.cpp
Created December 11, 2019 17:57
binder transaction dumb fuzz
#include <stdlib.h>
#include <utils/RefBase.h>
#include <utils/Log.h>
#include <binder/TextOutput.h>
#include <binder/IInterface.h>
#include <binder/IBinder.h>
#include <binder/ProcessState.h>
#include <binder/IServiceManager.h>
@droogie
droogie / main.js
Created February 7, 2019 22:15
WinJS code execution outside app sandbox
(function () {
var app = WinJS.Application;
var activation = Windows.ApplicationModel.Activation;
var isFirstActivation = true;
app.onactivated = function (args) {
if (isFirstActivation) {
// execute system command via lua
Windows.Storage.DownloadsFolder.createFileAsync("escape.lua").then(function (file) {
@droogie
droogie / uefi-symbols.py
Last active December 11, 2018 07:58
UEFI driver gdb symbol loading script
# This quick and dirty script will print a chunk that you can copy into gdb for loading of UEFI driver symbols
# requires objdump to be in your env path
# Expects a debug.log file which it will parse for all loaded drivers
import glob, os
import sys
import subprocess
DEBUG_FILE = "debug.log"
UEFI_PATH = "/home/droogie/src/edk2/Build/OvmfX64/DEBUG_GCC5/X64/"
@droogie
droogie / opengrok-crawl.py
Last active May 26, 2018 07:12
quick and dirty opengrok project crawl+downlaod
#my ghetto soluton until this feature is implemented, https://github.com/oracle/opengrok/issues/2000
from BeautifulSoup import BeautifulSoup
import urllib2
import re
import os
import argparse
parser = argparse.ArgumentParser()
requiredNamed = parser.add_argument_group("required named arguments")
@droogie
droogie / gist:a24fe6cdd288ee346aa1766f81ab4357
Created November 23, 2016 00:43
PS4 Enabled UART -> Shutdown
I/PSM UI : UI system timer elap
sed 00:06:00
[VSMALLOC] Video: Free=67257492, FreeChunk=87; System: Free=10024944, FreeChunk=6; Heap: Free=5101824
Shader=10;VertexBuffer=71;PixelBuffer=320;FrameBuffer=4;Image=6
W/PSM UI : ##### exit value = psexit: #####
I/PSM UI : ** Unload enqueue: WebBrowserPlugin : WebBrowserPlugin
@droogie
droogie / gist:8dedcb6d9b69b5203d9e9613f50d881c
Created November 22, 2016 23:44
Misc UART dump when using UI/Attempting to launch Playroom
I/PSM UI : OnFocusActiveSceneChanged [BrowserMain : MainScene] -> [ContentAreaScene : ContentAreaScene]
I/PSM UI : Scene [ContentAreaScene : ContentAreaScene] : Alive
[SystemLogger][ClickThrough][EVT21]: s:[MainScene]s:[Sce.Vsh.ShellUI.AppSystem.LayerManager.RootScene:ShellApp:ShellAppScreen:WebBrowserScene:BrowserMain]s:[ContentAreaScene]s:[
Sce.Vsh.ShellUI.AppSystem.LayerManager.RootScene:TopMenu:Navigation:TopMenuFrameScene:ContentsArea:ContentAreaScene]s:[NULL]s:[NULL]s:[NULL]
EVT22 is empty
EVT_invalid_ is empty