|
使用脚本提取出game.dll里面注册的所有CJ函数(注:没有管AI函数),然后解析出common.j里所有声明的函数,两者对比,发现有7个函数在game.dll里注册过,但是common.j里没有声明,它们是:
DialogSetAsync
SetStackedSoundRect
SetStackedSound
ClearStackedSound
ClearStackedSoundRect
GetPlayerStartLocationY
GetPlayerStartLocationX
注:
1. 尚未确认这些函数确实是隐藏或者废弃函数,而不是另一个已知函数的别名,今天晚上我写一个新的脚本验证一下,有结果就更新帖子
2. 魔兽版本是1.21b
3.最后两个函数BJ也有,估计这两个函数本来是CJ,后来被废弃了,换BJ了
晚上编辑:
已经验证这些函数不是其他函数的别名
附验证脚本(python):- # coding: utf-8
- from __future__ import print_function
- import string
- import re
- from idaapi import *
- # 获取指令名称
- def get_op_name(opAddr):
- result = re.split('\W+', GetDisasm(opAddr))
- if result:
- return result[0]
- else:
- return ""
- # 从指令中解析CJ函数的名称
- def get_cj_name(opAddr):
- # 是mov edx, ????? 指令吗?
- if get_op_name(opAddr) == "mov" and GetOperandValue(opAddr, 0) == 2: # edx -> 2
- # 字符串地址:第2个操作数
- strAddr = GetOperandValue(opAddr, 1)
- return GetString(strAddr, -1, GetStringType(strAddr))
- else:
- # 不是
- return ""
-
- # 从指令中解析CJ函数的地址
- def get_cj_addr(opAddr):
- # 是mov ecx, ????? 指令吗?
- if get_op_name(opAddr) == "mov" and GetOperandValue(opAddr, 0) == 1: # ecx -> 1
- # 函数地址
- return GetOperandValue(opAddr, 1)
- else:
- # 不是
- return 0
- startAddr = 0x6F2AB155 # 开始分析地址
- nextFuncAddr = NextFunction(startAddr) # 搜索停止地址(下一个函数)
- # 当前指令
- curOp = startAddr
- # 7个隐藏函数名
- sensNameSet = set(["DialogSetAsync", "SetStackedSoundRect", "SetStackedSound", "ClearStackedSound","ClearStackedSoundRect", "GetPlayerStartLocationY", "GetPlayerStartLocationX"])
- sensFun = dict()
- otherFun = dict()
- while curOp < nextFuncAddr:
- cjName = get_cj_name(curOp)
- if cjName:
- curOp = NextHead(curOp, nextFuncAddr)
- cjAddr = get_cj_addr(curOp)
- if cjName in sensNameSet:
- sensFun[cjName] = cjAddr
- else:
- otherFun[cjName] = cjAddr
- curOp = NextHead(curOp, nextFuncAddr)
-
- with open(r"H:\TOBECR\cjextra.txt", "w") as f:
- for key in sensFun:
- print(key + " => " + hex(sensFun[key]), file = f)
- otherFunAddr = otherFun.values()
- for name in sensFun:
- if sensFun[name] in otherFunAddr:
- print("Address " + hex(sensFun[name]) + " already exists")
- else:
- print("Address " + hex(sensFun[name]) + " is unique")
-
- print("Done")
复制代码 |
评分
-
查看全部评分
|