Skip to content

Instantly share code, notes, and snippets.

View jacobrosenthal's full-sized avatar

Jacob Rosenthal jacobrosenthal

View GitHub Profile
#!/usr/bin/env python
#https://xlsxwriter.readthedocs.org/example_unicode_polish_utf8.html
##############################################################################
#
# A simple example of converting some Unicode text to an Excel file using
# the XlsxWriter Python module.
#
# This example generates a spreadsheet with some Polish text from a file
@jacobrosenthal
jacobrosenthal / app.js
Last active July 15, 2016 04:48
Ring Zero Webbluetooth
var canvas = document.querySelector('canvas');
var statusText = document.querySelector('#scanBtn');
statusText.addEventListener('click', function() {
statusText.textContent = 'scanning...';
ring.connect()
.then(() => ring.startNotificationsEvents().then(handleEvent))
.then(() => {
statusText.textContent = 'got one...';
@jacobrosenthal
jacobrosenthal / corebluetooth bindings
Last active July 16, 2016 22:39
bindings timing test
Jacobs-MacBook-Air:noble jacobrosenthal$ node examples/timetest.js
corebluetooth bindings
startScanning: 4.501ms
stopScanning: 0.555ms
^C
Jacobs-MacBook-Air:noble jacobrosenthal$ node examples/timetest.js
corebluetooth bindings
startScanning: 8.440ms
stopScanning: 0.465ms
^C
corebluetooth
Jacobs-MacBook-Air:noble jacobrosenthal$ node examples/advertisement-discovery.js
peripheral discovered (5de0dfa124b242ba8fdfa8eb6d9e3542 with address <00:22:d0:2a:e4:a3, unknown>, connectable true, RSSI -40:
hello my local name is:
undefined
can I interest you in any of the following advertised services:
["180d"]
here is my manufacturer data:
"6b00010000"
my TX power level is:
peripheralUuidString is a lower case string no dashes
serviceUuidString is a lower case string no dashes
characteristicUuidString is a lower case string no dashes
serviceUuidString is a lower case string no dashes
serviceUuidsArray, array of serviceUuidString
descriptorHandle TODO
propertyString one of ['broadcast', 'read', 'writeWithoutResponse', 'write', 'notify', 'indicate', 'authenticatedSignedWrites', 'extendedProperties']
propertiesArray containing one or more of propertyString
descriptorObject = {
var fs = require('fs');
var moment = require('moment-timezone');
moment().tz("America/Phoenix").format();
fs.readdir( process.argv[2], function (err, files) {
if (err){
console.log("error", err);
return;
}
/*
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
Copyright (c) 2016 Sandeep Mistry All right reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#!/usr/bin/env ruby
# Dump firmware from nrf51 and maybe other cortex-m devices
# The script thats missing from http://blog.includesecurity.com/2015/11/NordicSemi-ARM-SoC-Firmware-dumping-technique.html
# Also inspired by https://tasteless.eu/post/2015/12/32c3ctf-emb400/
# Requires seperate instace gdb server already running, for my jlink I use
# openocd -f interface/jlink.cfg -c "adapter_khz 2000; transport select swd;" -f target/nrf51.cfg
# uicr and ficr are always accessible so you might want to dump those externally and compare?
# openocd -f interface/jlink.cfg -c "adapter_khz 2000; transport select swd; set WORKAREASIZE 0;" -f target/nrf51.cfg -c "init; reset halt; flash read_bank 1 uicr-normal.bin 0x0 0x100; exit"
@jacobrosenthal
jacobrosenthal / gist:6f36eea3653bacaeae23152cb4941c48
Last active March 8, 2017 00:34
nrf51 packet sniffer wireshark pipe usage
https://www.nordicsemi.com/eng/Products/Bluetooth-low-energy/nRF-Sniffer
unpacks
Sniffer/Firmware/ble-sniffer_nRF51822_1.0.1_1111_Sniffer.hex
• JLinkExe -if SWD -device nrf51
• w4 0x4001e504, 0x2
• w4 0x4001e50c, 0x1
• loadbin ble-sniffer_nRF51822_1.0.1_1111_Sniffer.hex, 0
• r
@jacobrosenthal
jacobrosenthal / Badge103.hex.izz
Last active November 13, 2017 05:16
Hackaday Superconference Badge 2017 Radare Strings
[0x00000000]> izz
Do you want to print 2104 lines? (y/N)
vaddr=0x00000360 paddr=0x00000360 ordinal=000 sz=5 len=4 section=unknown type=ascii string=_`@\v
vaddr=0x00000ef2 paddr=0x00000ef2 ordinal=001 sz=6 len=5 section=unknown type=ascii string=\b%+\b\t
vaddr=0x00000f5e paddr=0x00000f5e ordinal=002 sz=6 len=5 section=unknown type=ascii string=\n$$@H
vaddr=0x00000f9e paddr=0x00000f9e ordinal=003 sz=7 len=6 section=unknown type=ascii string=\n< J%
vaddr=0x00000fb2 paddr=0x00000fb2 ordinal=004 sz=7 len=6 section=unknown type=ascii string=\n<0 J%
vaddr=0x00000fcd paddr=0x00000fcd ordinal=005 sz=7 len=6 section=unknown type=ascii string=`\n@%P\n
vaddr=0x00000ff2 paddr=0x00000ff2 ordinal=006 sz=7 len=6 section=unknown type=ascii string=\n$DI*}
vaddr=0x0000100a paddr=0x0000100a ordinal=007 sz=6 len=5 section=unknown type=ascii string=\t}@L\t