import sys
sys.path.append('..')
from mmfparser.data.exe import ExecutableData
from mmfparser.data.gamedata import GameData
from mmfparser.data.mfa import MFA
from mmfparser.translators.pame2mfa import translate
from mmfparser.bytereader import ByteReader
import sys
import os
def main():
print 'welcome'
print 'prepare your duckshells'
print ''
input = sys.argv[1]
output = sys.argv[2]
fp = ByteReader(open(input, 'rb'))
if input.endswith('.ccn'):
newGame = GameData(fp)
else:
newExe = ExecutableData(fp)
for file in newExe.packData.items:
name = file.filename.split('\\')[-1]
print 'Writing pack file %r' % name
open(os.path.join(output, name), 'wb').write(file.data)
newGame = newExe.gameData
if newGame.files is not None:
for file in newGame.files.items:
name = file.name.split('\\')[-1]
print 'Writing embedded file %r' % name
open(os.path.join(output, name), 'wb').write(str(file.data))
newGame.files = None
def out(value):
print value
newMfa = translate(newGame, print_func = out)
out_path = os.path.join(output, 'out.mfa')
newMfa.write(ByteReader(open(out_path, 'wb')))
# newMfa = MFA(ByteReader(open(out_path, 'rb')))
print 'Finished!'
if __name__ == '__main__':
main()
我收到错误IndentationError:打开时会出现缩进块?有什么建议?它是从2012年开始的。我使用的是python 2.7,它是MultiMedia Fusion的反编译器