Skip to content

Instantly share code, notes, and snippets.

@brandon15811
Created February 1, 2013 18:34
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save brandon15811/4693146 to your computer and use it in GitHub Desktop.
Save brandon15811/4693146 to your computer and use it in GitHub Desktop.
libminecraftpe.so dumper
#!/usr/bin/python
import subprocess
import sys
functions = subprocess.check_output(['./arm-eabi-nm', '-DCnS', 'libminecraftpe.so']).splitlines()
for functions_line in functions:
if "MobFactory::CreateMob" in functions_line:#if "Packet::write" in functions_line:
functions_line_split = functions_line.split(' ')
stop_address = hex(int(functions_line_split[0], 16) + int(functions_line_split[1], 16))
function = subprocess.check_output(['./arm-eabi-objdump',
'-CD',
'--start-address=0x' + functions_line_split[0],
'--stop-address=' + stop_address,
'libminecraftpe.so']).splitlines()[6:]
print function[0].split(' ', 1)[1]
function = function[1:]
for function_line in function:
if not function_line.strip():
continue
function_line_split = function_line.split('\t')
#print function_line
if function_line_split[2] == "bl" and not "<operator new(unsigned int)>" in function_line:
print "\t" + function_line_split[3].split(' ', 1)[1]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment