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'


  • 相关阅读:
    用C语言画个简单表格
    魔方阵 奇数偶数都成立
    HDU 1527 取石子游戏
    HDU 2669 Romantic
    21位花朵数(详解)
    博弈论总结(1)
    qsort排序(即快排)
    POJ 1061 青蛙的约会
    HDU 2176 取(m堆)石子游戏
    HDU1061 求n^n的最低位
  • 原文地址:https://www.cnblogs.com/keanuyaoo/p/3359780.html
Copyright © 2011-2022 走看看