Skip to content

Instantly share code, notes, and snippets.

View thebabush's full-sized avatar
🎹
Hammer time

thebabush thebabush

🎹
Hammer time
View GitHub Profile
import glob
import os
import lief
def main(drivers_path):
drivers = sorted(glob.glob(os.path.join(drivers_path, '*.sys')))
for driver in drivers:
pe = lief.parse(driver)
@thebabush
thebabush / crx.py
Created January 23, 2016 15:42
Get ZIP file from Chrome CRX extension format
# Because I was on Windows, without dd :)
import os
import struct
import sys
if len(sys.argv) != 3:
print "Usage:", sys.argv[0], "<crx file> <zip file>"
exit(0)
@thebabush
thebabush / xp.js
Last active March 15, 2021 21:42
Javascript XPath Helper
/**
* Helper to make Javascript's XPath calls simpler.
* Basically you just need to give a query to the xp function.
* Especially useful in manual testing of XPath strings inside a browser's console.
*
* Example:
* xp("//body/text()")
*
* Author: Paolo Montesel
* License: https://opensource.org/licenses/MIT
@thebabush
thebabush / fix-drawio-svg.py
Created November 25, 2020 16:44
If you created a diagram using draw.io and now only web browsers can display it somewhat correctly, use this script + manual inkscape editing to fix them.
#!/usr/bin/env python3
"""
draw.io uses foreignObject tags to put fancy text on SVGs.
The structure it creates is like this:
```
<switch>
<foreignObject>...</foreignObject>
<text>...</text>
@thebabush
thebabush / merge.sh
Last active June 10, 2020 09:21
bash/python one-liner to merge all compile_commands.json files in a directory tree
python3 -c 'import json; import glob; import itertools; print(json.dumps(list(itertools.chain(*[json.load(open(f, "rb")) for f in glob.glob("**/compile_commands.json", recursive=True)])), indent=4))' > ../compile_commands.json
@thebabush
thebabush / 00 contents
Created April 3, 2020 15:02 — forked from jasonk000/00 contents
improve jitdump support when mmap'd jit region expands for kdab hotspot & perf
Linux perf fixes
01 overview
02 patch to make linux perf report work cleanly with jitdump remap
03 perf script for sample input file showing mmap overwrite
04 perf report before example
05 perf report after example
--
KDAB Hotspot specific fixes
06 patch to make linux perf output output program headers for KDAB hotspot
07 patch to make hotspot UI load cleanly with jitdump remap
@thebabush
thebabush / vigorun.py
Created March 28, 2020 19:10
Vigorun Python Example
#!/usr/bin/env python3
import pygatt
"""
adc <= 1000
age <= 120
heigth <= 269
weight <= 220
@thebabush
thebabush / CVE-2019-16160.txt
Created December 17, 2019 14:25
CVE-2019-16160
[Suggested description]
An integer underflow in the SMB server of MikroTik RouterOS 6.43.16
(x86 and CHR) allows remote unauthenticated attackers to crash the
service.
------------------------------------------
[Additional Information]
The vulnerability likely affects other versions too.
The vulnerability might be exploitable to achieve RCE.
@thebabush
thebabush / spidermonkey.yml
Last active September 27, 2019 16:17
Firefox/SpiderMonkey Code Cache Parser
meta:
id: spidermonkey
endian: le
seq:
- id: build_id_length
type: u4
- id: build_id
type: str
#!/usr/bin/env python3
"""
Quick'n'dirty script to translate subs using Yandex.
It all started because I didn't have enough time to finish a Japanese movie
that I was watching heading back home from DEF CON 27.
Anyway, I managed to get a copy of the movie (**cough cough**) but my 日本語
is really bad and the only subs I could find were in Chinese.
So I decided to bear the automatic translation for the remaining 30 minutes