Instantly share code, notes, and snippets.

View uboot-image.bt
//
// quick 010 Editor template for u-boot images
// darell tan 2018.12.08
//
enum <uchar> IH_TYPES {
TYPE_INVALID,
TYPE_STANDALONE,
TYPE_KERNEL,
TYPE_RAMDISK,
View ren_dated_file.py
#!/usr/bin/env python
#
# renames files with date JAN_18 to "<prefix> 2018-01"
# darell tan 2018.09.14
#
from __future__ import print_function
import sys
import os
import re
View boot.cmd
part uuid ${devtype} ${devnum}:${bootpart} uuid
setenv bootargs console=${console} root=PARTUUID=${uuid} rw rootwait
if load ${devtype} ${devnum}:${bootpart} ${kernel_addr_r} /boot/zImage; then
if load ${devtype} ${devnum}:${bootpart} ${fdt_addr_r} /boot/dtbs/${fdtfile}; then
fdt addr ${fdt_addr_r}
fdt resize
setexpr fdtovaddr ${fdt_addr_r} + F000
View fixer.js
document.querySelector('.SUMMARY').childNodes.forEach(function(e) {
if (e.nodeType == Node.TEXT_NODE && (e.textContent.match(/[+|-]/g) || []).length > 2) {
var n = document.createElement('code');
n.textContent = e.textContent.replace(/^[\r\n]*(.*)[\r\n]*$/, '$1');
n.style = 'white-space:pre-wrap';
e.parentNode.replaceChild(n, e);
}
});
View script.ps1
# to verify, use `route print` and check the order in which the interfaces are listed
Get-NetAdapter | Where-Object {$_.InterfaceDescription -like '*USB*'} | Set-NetIPInterface -InterfaceMetric 9999
View moveup.py
# moves up file data at current pos to specified to_offset
def moveup(f, to_offset, block_size=4096):
while True:
data = f.read(block_size)
newpos = f.tell()
f.seek(to_offset)
to_offset += len(data)
if len(data) == 0: break
View GetProfileOwner.ps1
[CmdletBinding()]
Param(
[Parameter(Mandatory=$True,Position=1)]
[string] $Path
)
# Usually the profile owner has full control, but is not a well-known SID
# References:
# https://support.microsoft.com/en-us/help/243330/well-known-security-identifiers-in-windows-operating-systems
# https://technet.microsoft.com/en-us/library/ff730940.aspx
View dragNdrop.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>drag &amp; drop</title>
<style>
html, body {
margin: 0;
padding: 0;
View maze1.txt
###########
#> #
# # ##### #
# # # #
# # #X### #
# # # # # #
# ### # # #
# # # #
# # ### ###
# # #
View pew.js
//
// solver script for flare-on #5 pewpewboat.exe
// run with frida -l pew.js -f pewpewboat.exe --no-pause -o pew.log
//
var mainProgLoop = ptr(0x403c05);
var getInput = ptr(0x40377D);
var clearScreen = ptr(0x4031E1);
var notMd5Prompt = ptr(0x403530);