Skip to content

Instantly share code, notes, and snippets.

András Veres-Szentkirályi dnet

Block or report user

Report or block dnet

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
dnet /
Created Aug 31, 2016
Extracting main icon from 64-bit PE (Windows EXE) files in Python 2.x using 7z (p7zip)
#!/usr/bin/env python
import subprocess, tempfile, struct, shutil, os
HDR_FMT = '<hhh'
HDR_LEN = struct.calcsize(HDR_FMT)
def extract_64bit_ico(exefn, icofn):
d = tempfile.mkdtemp()
gis = os.path.join(d, '.rsrc', 'GROUP_ICON')
dnet / Decode ARM64
Created Feb 1, 2016
ARM64 CFString decoder script for Hopper
View Decode ARM64
import struct, re
doc = Document.getCurrentDocument()
sg = doc.getCurrentSegment()
addr = doc.getCurrentAddress()
i1 = sg.getInstructionAtAddress(addr)
if i1.getInstructionString() == 'adrp':
dnet /
Created Nov 27, 2015
Partial implementation of the interface provided by zipfile.ZipFile using the unzip command
from subprocess import Popen, PIPE
from tempfile import TemporaryFile
from os import devnull
class ZipFile(object):
def __init__(self, filename):
self.filename = filename
def __enter__(self):
dnet / gist:9505053
Created Mar 12, 2014
Erlang workshop code from 2013-11-21 see
View gist:9505053
-export([init/1, handle_call/3, q/1, init/0]).
init() ->
gen_server:start_link(?MODULE, [], []).
q(Pid) -> gen_server:call(Pid, q).
init([]) -> {ok, 0}.
handle_call(q, _, N) -> {reply, N, N + 1}.
dnet / gist:8568440
Created Jan 22, 2014
Test module created on an Erlang workshop for HSBXL
View gist:8568440
-export([foo/1, proc/0, price/1]).
-export([init_queue/0, queue_server/1, srv_enqueue/2, srv_dequeue/1]).
%% A function that returns a function, demonstrating that functions are
%% first-class citizens in the Erlang world.
%% Example:
%% > SixMultiplier = test:foo(6).
%% #Fun<test.0.23908741>
dnet / searx.erl
Created Oct 23, 2013
Searx module for dnet's fork of jimm-erlang-bot
View searx.erl
-export([ircmain/1, ircproc/1, reload/2]).
ircmain(Contact) ->
Pid = spawn(?MODULE, ircproc, [Contact]),
Contact ! {subscribe, Pid},
reload(Contact, Pid) ->
dnet / tickets.erl
Created Sep 22, 2013
Ticket number reporter for dnet's fork of jimm-erlang-bot
View tickets.erl
-export([ircmain/1, ircproc/1, reload/2]).
-define(TICKETS_DIR, "path/to/campzer0").
tickets() ->
NumTickets = filelib:fold_files(?TICKETS_DIR,
"\\.json$", false, fun (_, A) -> A + 1 end, 0),
dnet /
Created Aug 9, 2013
PGP keysigning e-mail address verification generator
# reads e-mail addresses (one per row) from `mails.txt` and writes
# e-mail bodies into files inside the `mails` directory, putting the
# e-mail address in the filename, with a `.txt` extension -- these
# can be changed below
# author: András Veres-Szentkirályi <>
# source code is licensed under MIT, textual content under CC-BY-SA
dnet / tweet.erl
Last active Dec 19, 2015
Twitter module for Erlang IRC bot
View tweet.erl
% depends:
% depends:
-export([ircmain/1, ircproc/1, reload/2]).
-define(CONSUMER_KEY, "...").
-define(CONSUMER_SECRET, "...").
-define(ACCESS_TOKEN, "...").
-define(TOKEN_SECRET, "...").
dnet /
Created Feb 12, 2013
Simple web file sharing script using SHA-256 hash as file name to avoid brute force attacks
if [ $# -lt 1 ]; then
echo "Usage: $0 <filename>" >&2
exit 1
HASH=$(sha256sum $1 | cut -c -64)
EXT=$(echo "$1" | sed 's/^.*\.//')
scp "$1" remote_host:directory_available_from_web/$HASH.$EXT
You can’t perform that action at this time.