Skip to content

Instantly share code, notes, and snippets.

@mkrautz
mkrautz / gist:5200115
Last active December 15, 2015 04:18
MSI reassembler
import os
import sys
import subprocess
import tempfile
import shutil
MSIDB_EXE = 'C:\\Program Files (x86)\\Windows Kits\\8.0\\bin\\x86\\msidb.exe'
def cmd(args, cwd=None):
ret = subprocess.Popen(args, cwd=cwd).wait()
#!/usr/bin/env python
import os
def main():
f = open('murmur.x86', 'r')
all = f.read()
f.close()
elfMagic = '\x7fELF'
statfs("/usr/lib/qt4/plugins/sqldrivers", 0xffaebccc) = -1 ENOENT (No such file or directory)
close(11) = 0
lstat64("/usr", {st_dev=makedev(8, 1), st_ino=786435, st_mode=S_IFDIR|0755, st_nlink=11, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=8, st_size=4096, st_atime=2013/03/23-17:58:59, st_mtime=2013/01/05-23:52:11, st_ctime=2013/01/05-23:52:11}) = 0
lstat64("/usr/lib", {st_dev=makedev(8, 1), st_ino=918956, st_mode=S_IFDIR|0755, st_nlink=193, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=80, st_size=36864, st_atime=2013/03/23-17:59:00, st_mtime=2013/03/23-16:31:12, st_ctime=2013/03/23-16:31:12}) = 0
lstat64("/usr/lib/qt4", 0xffaeadac) = -1 ENOENT (No such file or directory)
stat64("/usr", {st_dev=makedev(8, 1), st_ino=786435, st_mode=S_IFDIR|0755, st_nlink=11, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=8, st_size=4096, st_atime=2013/03/23-17:58:59, st_mtime=2013/01/05-23:52:11, st_ctime=2013/01/05-23:52:11}) = 0
lstat64("/usr", {st_dev=makedev(8, 1), st_ino=786435, st
openat(AT_FDCWD, "/usr/lib/i386-linux-gnu/qt4/plugins/sqldrivers", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat64("/home/mkrautz/mumble/release/sqldrivers/.", 0xff91c8d8) = -1 ENOENT (No such file or directory)
gettimeofday({1364072373, 305474}, NULL) = 0
stat64("/etc/localtime", {st_dev=makedev(8, 1), st_ino=131249, st_mode=S_IFREG|0644, st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=8, st_size=2134, st_atime=2013/03/23-14:21:53, st_mtime=2012/11/08-18:49:15, st_ctime=2012/11/08-18:49:15}) = 0
write(2, "<F>2013-03-23 21:59:33.305 Serve"..., 75<F>2013-03-23 21:59:33.305 ServerDB: Database driver QSQLITE not available
) = 75
write(5, "@", 1) = 1
close(5) = 0
close(4) = 0
rt_sigaction(SIGCHLD, NULL, {0xf6dd5450, [], SA_NOCLDSTOP}, 8) = 0
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Mumble\Mumble]
"winhooks"="false"
$ gdb ./release/mumble
GNU gdb (GDB) 7.5-ubuntu
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Thread 20 (Thread 0x7fffacdf2700 (LWP 23724)):
#0 __lll_lock_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:135
No locals.
#1 0x00007ffff5956197 in _L_lock_1035 () from /lib/x86_64-linux-gnu/libpthread.so.0
No symbol table info available.
#2 0x00007ffff5956029 in __GI___pthread_mutex_lock (mutex=0x140b428) at pthread_mutex_lock.c:85
__PRETTY_FUNCTION__ = "__pthread_mutex_lock"
type = 4294966784
#3 0x00007ffff5b6bace in poll_func (ufds=<optimized out>, nfds=2, timeout=-1, userdata=0x140b400) at compat.c:300
$ gdb ./release/mumble
GNU gdb (GDB) 7.5-ubuntu
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
mkrautz@mkrautz-raring ~/osslsigncode $ gsf list selfsigned.msi
selfsigned.msi:
d 0 *root*
f 8 ???
f 1780 ???
d 0 1028
f 282 1028/????
f 126 1028/????
f 954 1028/????
f 16 1028/?????
@mkrautz
mkrautz / gist:5478464
Created April 28, 2013 21:21
filetime to unix epoch
def to_unix(ft):
epoch_1601 = 11644473600
secs_to_100nsec = 10000000
return (ft/secs_to_100nsec) - epoch_1601
if __name__ == '__main__':
ft = 0x01ce3ed71e0221b0
print to_unix(ft)