zoukankan      html  css  js  c++  java
  • ios 游戏《魂斗罗》 AL文件素材破解

    
    

    1、破解原理非常简单就是找png的8字节的前缀(baidu png 文件编码格式)。

         

      2、破解就图就可以看见了

          

    3、这样一个个个的改是不是非常麻烦,所有我专门写了个py脚本在干这事!大笑一步搞定!

     源码如下:

    import sys
    import os
    
    sys.path.append('.')
    currDir = os.getcwd()
    
    print currDir
    
    toSearchPngHead = [0x89,0x50,0x4e,0x47,0x0d,0x0a,0x1a,0x0a]
    
    def doFileRead(file_):
       """
       Find 89 50 4e 47 0d 0a 1a 0a and write
       """
       
       sourceFile = file_
     
       targetFile = os.path.splitext(file_)[0]+'.png'
       print  sourceFile + ' targetFile = ' +targetFile
       fr = open(file_,'rb')
       sourceFile = file_
    
       data = fr.read()
       offset = 0
       tmpBuf = []
       for byte in data:
          offset+=1
          #print byte.encode('hex')
          tmpBuf.append(int(byte.encode('hex'),16))
          if len(tmpBuf) == len(toSearchPngHead):
              if tmpBuf == toSearchPngHead:
                 print offset-8
                 fr.seek(offset-8)
                 open(targetFile, "wb").write(fr.read())
                 break
              else:
                 tmpBuf.pop(0)
    
       fr.close()
    
    
    def listAll(path):
       for f in os.listdir(path):
           #print f
           if os.path.isdir(f) :
               listAll(path+"/"+f)
           else:
               if os.path.splitext(f)[1]=='.AL':
                   doFileRead(path + os.sep + f)
    
    listAll(currDir)
    print '----------- all dir'


  • 相关阅读:
    事件循环(Event Loop)promise、setTimeout、async的先后执行顺序
    计算机网络方面
    深拷贝与浅拷贝
    从输入url到页面加载发生了什么?
    手写jQuery插件
    vue与微信小程序的区别
    Webpack打包工具
    SpringCloud Feign的分析
    SpringCloud Ribbon的分析(二)
    SpringCloud Ribbon的分析
  • 原文地址:https://www.cnblogs.com/keanuyaoo/p/3359780.html
Copyright © 2011-2022 走看看