mirror of
https://github.com/geohot/qira
synced 2025-03-13 10:33:30 +03:00
half builds at home, missing meteor dir
This commit is contained in:
parent
ddd45201fc
commit
da6b7a5332
1
.gitignore
vendored
1
.gitignore
vendored
@ -8,4 +8,5 @@ ida_plugin/qira.plx
|
||||
tests/idb
|
||||
qiradb/qiradb
|
||||
db/
|
||||
qemu/
|
||||
|
||||
|
4
deps.sh
Executable file
4
deps.sh
Executable file
@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
sudo pip install pymongo
|
||||
curl -k https://install.meteor.com | /bin/sh
|
||||
|
12
fetchqemu.sh
Executable file
12
fetchqemu.sh
Executable 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
|
||||
|
@ -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:
|
||||
|
@ -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
|
||||
|
@ -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*
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user