Skip to content

Instantly share code, notes, and snippets.

@revolunet
revolunet / lzw_encoder.js
Created February 25, 2011 14:55
LZW javascript compress/decompress
// LZW-compress a string
function lzw_encode(s) {
var dict = {};
var data = (s + "").split("");
var out = [];
var currChar;
var phrase = data[0];
var code = 256;
for (var i=1; i<data.length; i++) {
currChar=data[i];
@faisalman
faisalman / baseConverter.js
Last active January 11, 2023 14:43
Convert From/To Binary/Decimal/Hexadecimal in JavaScript
/**
* Convert From/To Binary/Decimal/Hexadecimal in JavaScript
* https://gist.github.com/faisalman
*
* Copyright 2012-2015, Faisalman <fyzlman@gmail.com>
* Licensed under The MIT License
* http://www.opensource.org/licenses/mit-license
*/
(function(){
<?xml version="1.0" encoding="utf-8"?>
<dns>
<retcode>0</retcode>
<domainlist>
<domain name="extshort.weixin.qq.com" timeout="1800">
<ip>101.226.76.175</ip>
<ip>101.227.131.102</ip>
</domain>
<domain name="long.weixin.qq.com" timeout="1800">
@oleavr
oleavr / 00-README.md
Last active April 26, 2024 11:18
Frida devkit examples

frida-gum-example.c

$ clang -Wall -Os -pipe -g3 frida-gum-example.c -o frida-gum-example -L. -lfrida-gum -lresolv -Wl,-dead_strip -Wl,-no_compact_unwind
$ ./frida-gum-example
[*] open("/etc/hosts")
[*] close(3)
[*] open("/etc/fstab")
[*] close(-1)
[*] listener got 4 calls

[*] listener still has 4 calls

Start GDB and execute the following commands:
catch syscall ptrace
commands 1
set ($eax) = 0
continue
end
Then, run the app and voilá! you can debug your program :)
@jcalabres
jcalabres / ld_preload.py
Last active June 18, 2023 14:35
Automatic LD_PRELOAD on Android
from adb.client import Client as AdbClient
from sys import *
import os
if __name__=="__main__":
print("[*] Simple script to automatize LD_PRELOAD process on android applications.")
if len(argv)!=3:
print("[-] Specify PACKAGE_NAME and PATH_LIB.")
exit(0)
package=argv[1]