Skip to content

Instantly share code, notes, and snippets.

Andrew Cook ariscop

Block or report user

Report or block ariscop

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View stream.sh
#!/bin/bash
url="[url]"
stream="[key]"
vb=200
ab=128
width=640
height=480
threads=4
@ariscop
ariscop / dump.py
Created Jun 14, 2014
Quick script for extracting the firmware of an Hi351C based ip camera
View dump.py
import struct
import binascii
with open("firmware_HI3518C-V5-ONVIF-V2.5.0.6_20140126124709.bin", "rb") as f:
print(" Magic:", f.read(8))
print(" Unknown:", binascii.hexlify(f.read(4)))
length = struct.unpack("<L", f.read(4))[0]
print(" Length:", length)
print(" Flags?:", struct.unpack("<L", f.read(4))[0])
hdr_len = struct.unpack("<L", f.read(4))[0]
@ariscop
ariscop / blocklist.de.php
Created Jul 6, 2014
Apply blocklist.de to shorewall, intended for use as a cron script
View blocklist.de.php
<?php
$url = 'http://api.blocklist.de/getlast.php?time=';
$cachefile = '/tmp/blocklist.de.cache';
$cachetime = 0 + @filemtime($cachefile);
$url = $url . $cachetime;
$result = file_get_contents($url);
if (is_string($result)) {
file_put_contents($cachefile, $result, FILE_APPEND);
$arr = explode("\n", $result);
@ariscop
ariscop / isTerminal.c
Created Jul 19, 2014
Function to check if a program was launched from cmd/powershell/so on
View isTerminal.c
/* Detect if we're launched outside of cmd by checking for other processes on our console */
BOOL isTerminal(void) {
DWORD pid;
return GetConsoleProcessList(&pid, 1) != 1;
}
@ariscop
ariscop / metroid_record.lua
Created Jul 22, 2014
Vba script for metroid fusion, pauses avi recording with the in game timer
View metroid_record.lua
prevframes = 0
recording = false
while 1 do
minutes = memory.readbyte(0x3000139)
seconds = memory.readbyte(0x300013A)
frames = memory.readbyte(0x300013B)
if prevframes ~= frames then
avi.resume()
if recording == true then
View keybase.md

Keybase proof

I hereby claim:

  • I am ariscop on github.
  • I am ariscop (https://keybase.io/ariscop) on keybase.
  • I have a public key whose fingerprint is BDC0 7E53 3055 BFCF 57EC 2914 F812 A837 9BC0 EE2F

To claim this, I am signing this object:

@ariscop
ariscop / ctdump.py
Last active Aug 29, 2015
Tool for dumping schema and data from old ctree databases (works with myob .myo files) (beware the ugly)
View ctdump.py
#!/usr/bin/python3
import sys
import os
import mmap
from binascii import hexlify
from io import BytesIO
from struct import calcsize, unpack, unpack_from, iter_unpack
from collections import namedtuple, OrderedDict
from pprint import pprint
@ariscop
ariscop / gist:45d662258e93b4a607ef
Created Dec 1, 2014
MYOB table/index records, schema is elsewhere
View gist:45d662258e93b4a607ef
0x81f Record 0xfafa 0x191 0x17f 0x0 0x0 b'\xff\xff*' ffffffff 00000000 ffffffff 00000000 00000000 00000000 60000000 12180000 00000000 00000000 8100ee07 00000000 03000000 2206dc07 000c0001 20020204 0100ff00 00000000 12180000 01000000 30090000 00000000 00000000 0600fb01 ff000000 28000000 00000000 80030000 00000000 00000000 00000000 00000000
0x11b0 Record 0xfafa 0x191 0x17f 0x0 0x0 b'misc.dat ' ffffffff 00000000 ffffffff 00200000 0200da0c 4d000000 43000000 00000000 00000000 00000000 81000000 10030000 83000000 00000000 00000100 00020204 00000000 00000000 00000000 02000000 c1120000 00000000 00000000 02000000 ff000000 2f000000 00000000 cf000000 00000000 00000000 00000000 00000000
0x201f Record 0xfafa 0x291 0x27f 0x0 0x0 b'misc.idx ' ffffffff 00000000 ffffffff 00280000 00000000 00000000 43000000 12800800 00000000 00000000 8100ee07 00000000 83000000 d407dc07 00000000 20020204 01000400 02000000 12800800 03000000 30210000 00000000 00000000 0200fb01 ff000000 28000000 00000000 ce000000 00000000 00000000 00000000 00
@ariscop
ariscop / extract.py
Created Jan 1, 2015
Tool for extracting .lmp files from "The Elder Scrolls Travels - Dawnstar"
View extract.py
#!/usr/bin/env python3
import sys, struct
fd = open(sys.argv[1], "rb")
while(True):
byte = fd.read(1)
if byte != b'-':
break
View bits.py
def _bits(byte):
return [(byte >> 0) & 1,
(byte >> 1) & 1,
(byte >> 2) & 1,
(byte >> 3) & 1,
(byte >> 4) & 1,
(byte >> 5) & 1,
(byte >> 6) & 1,
(byte >> 7) & 1]
You can’t perform that action at this time.