half builds at home, missing meteor dir

This commit is contained in:
George Hotz 2014-07-02 00:19:44 -07:00
parent ddd45201fc
commit da6b7a5332
7 changed files with 54 additions and 30 deletions

1
.gitignore vendored
View File

@ -8,4 +8,5 @@ ida_plugin/qira.plx
tests/idb
qiradb/qiradb
db/
qemu/

4
deps.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash
sudo pip install pymongo
curl -k https://install.meteor.com | /bin/sh

12
fetchqemu.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/bash
rm -rf qemu
mkdir -p qemu
cd qemu
wget http://wiki.qemu-project.org/download/qemu-2.0.0.tar.bz2
tar xf qemu-2.0.0.tar.bz2
cd qemu-2.0.0
mv tci.c tci.c.bak
ln -s ../../qemu_mods/tci.c tci.c
./configure --target-list=i386-linux-user
make -j32

2
go.sh
View File

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
set -e
BIN=../tests/ctf/ezhp

View File

@ -1,5 +1,4 @@
from pymongo import MongoClient
from elftools.elf.elffile import ELFFile
import sys
db = MongoClient('localhost', 3001).meteor
@ -8,31 +7,39 @@ ds = []
sdict = {}
cdict = {}
elf = ELFFile(open(sys.argv[1]))
for section in elf.iter_sections():
try:
for symbol in section.iter_symbols():
if len(symbol.name) > 0:
sdict[symbol['st_value']] = symbol.name
except:
pass
has_elf_tools = 0
try:
from elftools.elf.elffile import ELFFile
has_elf_tools = 1
except:
print "no elf tools found"
if elf.has_dwarf_info() and len(sys.argv) > 2:
src = open(sys.argv[2]).read().split("\n")
di = elf.get_dwarf_info()
for CU in di.iter_CUs():
for DIE in CU.iter_DIEs():
#print DIE
if DIE.tag == 'DW_TAG_subprogram':
try:
lowpc = DIE.attributes['DW_AT_low_pc'].value
highpc = DIE.attributes['DW_AT_high_pc'].value
fil = DIE.attributes['DW_AT_decl_file']
line = DIE.attributes['DW_AT_decl_line'].value
except:
pass
print lowpc, highpc, fil, line, src[line]
cdict[lowpc] = src[line]
if has_elf_tools:
elf = ELFFile(open(sys.argv[1]))
for section in elf.iter_sections():
try:
for symbol in section.iter_symbols():
if len(symbol.name) > 0:
sdict[symbol['st_value']] = symbol.name
except:
pass
if elf.has_dwarf_info() and len(sys.argv) > 2:
src = open(sys.argv[2]).read().split("\n")
di = elf.get_dwarf_info()
for CU in di.iter_CUs():
for DIE in CU.iter_DIEs():
#print DIE
if DIE.tag == 'DW_TAG_subprogram':
try:
lowpc = DIE.attributes['DW_AT_low_pc'].value
highpc = DIE.attributes['DW_AT_high_pc'].value
fil = DIE.attributes['DW_AT_decl_file']
line = DIE.attributes['DW_AT_decl_line'].value
except:
pass
print lowpc, highpc, fil, line, src[line]
cdict[lowpc] = src[line]
dat = open("/tmp/qira_disasm").read().split("\n")
for d in dat:

View File

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
set -e
numactl --interleave=all ~/build/mongodb-linux-x86_64-2.6.3/bin/mongod --dbpath=$(pwd)/db --bind_ip 127.0.0.1

View File

@ -1,12 +1,12 @@
#!/bin/sh
#!/bin/bash
set -e
pushd .
cd ~/build/qemu
cd ../qemu/qemu-2.0.0/
make -j32
popd
#rm -rf /tmp/qira*
~/build/qemu/i386-linux-user/qemu-i386 -singlestep -d in_asm $@ 2> /tmp/qira_disasm
../qemu/qemu-2.0.0/i386-linux-user/qemu-i386 -singlestep -d in_asm $@ 2> /tmp/qira_disasm
ls -l /tmp/qira*