Skip to content

Instantly share code, notes, and snippets.

View gabonator's full-sized avatar
👨‍🏭
at work

Gabriel Valky gabonator

👨‍🏭
at work
View GitHub Profile
@gabonator
gabonator / loader.js
Created June 14, 2017 12:02
json-p javascript loader
function loadScript(url, handler)
{
window.collected = [];
window._ = function(json)
{
window.collected.push(json);
}
var head = document.getElementsByTagName('head')[0];
@gabonator
gabonator / index.html
Last active October 26, 2017 17:24
CDN performance and average response times monitor
<html>
<head>
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/highcharts-more.js"></script>
</head>
<body>
<div id="chart" style="width:100%; height:100%;"></div>
</body>
@gabonator
gabonator / titcodez.cpp
Created July 9, 2017 08:35
Titus the fox game codes
#include <stdio.h>
int levs[15] ={1,0,4,5,6,7,8,9,10,11,}
int levcode(int i)
{
_ES=0xf000;
asm mov bx, i
asm mov ax, es:[bx]
asm add al, es:[bx+0f000h]
asm sub ah, es:[bx+0f002h]
@gabonator
gabonator / varlenint.cpp
Created August 15, 2017 09:57
variable length integer coding
// Reader
template<typename T> T GetVlc(const char*& p, const char* pChunkEnd)
{
uint8_t b;
int nBit = 0;
uint32_t i = 0;
do
{
if (p > pChunkEnd)
{
@gabonator
gabonator / index.html
Last active July 20, 2018 04:54
Driver na radiacny kotol ORK 100
<html>
<head>
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/highcharts-more.js"></script>
</head>
<style>
#schemecontainer {width:600px; height:580px; float:left; margin-right:20px;}
@gabonator
gabonator / mylog.js
Created September 28, 2017 14:52
nodejs logging with ip/hostname and timestamp
var dateTime = require("node-datetime");
var dns = require("dns");
function currentTime()
{
return dateTime.create().format('Y-m-d H:M:S');
}
function hostname(ip, handler)
{
@gabonator
gabonator / tunnelclient.js
Created November 18, 2017 15:43
simple IP tunneling using public server in nodejs
var net = require('net');
var tunnel = null;
var target = null;
// tunnel server
var serverInfo = {port:8811, host:"public.server.com"};
// target device we want to access on network where this script is running
var targetInfo = {port:1001, host:"ip.local.network"};
function listen()
@gabonator
gabonator / abcom_protocol.js
Created November 26, 2017 20:05
ABcom satellite settop box protocol reverse engineering
/*
reverse engineering of ABcom Cryptobox 600HD mini dvbs box protocol
Firstly I examined android package (since it was easier to get it) "g-mscreen-2-3-11.apk". It
uses C++ library for implementing control protocol. Then I was trying to capture UPnP communication
from iphone connected to OSX running wireshark. But without luck. GMScreen allowed to connection
to box using ip address and port. This traffic was easier to caputre and analyse. Requests by
client application are human readable json/xml code. Some response packets are compressed using
zlib.
@gabonator
gabonator / runlength.js
Created November 28, 2017 14:13
RLE compression javascript
function getNonconstantLength(buffer, i)
{
for (var l = 0; l < buffer.length - i; l++)
{
if (buffer[i+l] == buffer[i+l+1] && buffer[i+l+1] == buffer[i+l+2])
return l;
}
return buffer.length - i;
}
@gabonator
gabonator / alifeng.js
Created December 2, 2017 12:01
Ali tech stb (abcom cryptobox) protocol including RTSP video streaming to VLC
var net = require('net');
const zlib = require('zlib');
Ali =
{
_decompress: (buffer, handler) => zlib.unzip(buffer, {}, (err, buffer) => err ? handler() : handler(buffer.toString())),
_alibuffer: (buffer) => "Start" + ("0000000" + buffer.length).substr(-7) + "End" + buffer,
_alijson: (json) => Ali._alibuffer(JSON.stringify(json)),
_requestBytes: 0,
_responseBuffers: [],