#!/usr/bin/env python 
# Solving Codebreaker2 Tier 1
# Robert A. Baykov 04.28.15
import sys,os

# Append the root project folder to the system path
# for imports. (you can also use an absolute path)
sys.path.append('../../../')

from core import core

print core.message
print core.version
print core.ioversion

from plugins.utils import strings
from plugins.utils import file
from plugins.utils import ldd
from plugins.disassemblers import objdump

# path to binary file
codebin = 'elf'

string_dump =  strings.strings().run(codebin)
# split new line seperated (NSL) output to list
string_dump = string_dump.split('\n')

for string in string_dump:
	#strip whitespace front+back
	string = string.strip()
	# if the line has characters
	if len(string) > 0:
		# if the first char is '-' its a linux style argument (likely)
		if string[0] == '-':
			# print all such matches
			print string

results = objdump.objdump().find_dll(codebin)
# the user deals with it
for r in results:
	print r

