Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
加一个根据从网易阴阳师中libclient.so逆向出来的redirect.pyc的解密方法重写的解密阴阳师(其他游戏暂未尝试)scrip…
…t.npk中脚本的脚本
  • Loading branch information
YJBeetle committed Oct 30, 2017
1 parent 139b848 commit 6bcfbdc
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions tools/script redirect.py
@@ -0,0 +1,38 @@
import zlib
import argparse

def _reverse_string(s):
l = list(s)
l = map(lambda x: chr(ord(x) ^ 154), l[0:128]) + l[128:]
l.reverse()
return ''.join(l)


def unnpk(data):
asdf_dn = 'j2h56ogodh3se'
asdf_dt = '=dziaq.'
asdf_df = '|os=5v7!"-234'
asdf_tm = asdf_dn * 4 + (asdf_dt + asdf_dn + asdf_df) * 5 + '!' + '#' + asdf_dt * 7 + asdf_df * 2 + '*' + '&' + "'"
import rotor
rotor = rotor.newrotor(asdf_tm)
data = rotor.decrypt(data)
data = zlib.decompress(data)
data = _reverse_string(data)
return data

def main():
parser = argparse.ArgumentParser(description='unnpk tool')
parser.add_argument("INPUT_NAME", help='input file')
# parser.add_argument("OUTPUT_NAME", help='output file')
args = parser.parse_args()
input_file = args.INPUT_NAME
# output_file = args.OUTPUT_NAME
# if not output_file:
# output_file = input_file + '.unnpk'
data = unnpk(open(input_file).read())
# with open(output_file, 'wb') as fd:
# fd.write(data)
print(data)

if __name__ == '__main__':
main()

0 comments on commit 6bcfbdc

Please sign in to comment.