A Mortal Kombat 11 item unlocker
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

data_grabber.py 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import argparse
  2. import re
  3. import os
  4. def check_runtime_folder():
  5. if os.path.dirname(os.path.abspath(__file__)) == os.getcwd():
  6. return True
  7. else:
  8. return False
  9. def check_for_dump_file():
  10. return os.path.isfile(r'%s' % args.dump_location)
  11. if __name__ == "__main__":
  12. parser = argparse.ArgumentParser(description = 'Data Grabber for MK11Unlocker', add_help = False)
  13. parser.description = "Stop asking for help, here you have it !"
  14. required = parser.add_argument_group('Required arguments')
  15. required.add_argument('-d', '--dump_location', required = True)
  16. optional = parser.add_argument_group('Optional arguments')
  17. optional.add_argument("-h", "--help", action = "help")
  18. args = parser.parse_args()
  19. if check_runtime_folder()!= True:
  20. print("\nPlease start the script from its directory.")
  21. exit()
  22. if check_for_dump_file()!= True:
  23. print("\nWe could not locate your dump file.")
  24. exit()
  25. input_data = open(args.dump_location, 'rb')
  26. data_raw = open("data_raw", "w")
  27. print("\nThe script is now extracting data from your dump file.")
  28. print("Don't panic if it looks stuck, this will take a while to finish.")
  29. for line in input_data:
  30. result = re.findall(rb'(?<=\x00)([A-F0-9]{32})(?=\x00)', line)
  31. for item in result:
  32. data_raw.write(item.decode("ascii"))
  33. data_raw.write("\n")
  34. input_data.close()
  35. data_raw.close()
  36. open("data_sorted",'w').writelines(set(open("data_raw",'r').readlines()))
  37. print("\nJob finished")