-- lua sciprt
-- ...
local data = string.dump(test) -- dump
local new_op = {}
-- 用目标 lua 和正常 lua 的 dump 数据对比
for i = 1, #data do
local by_ori = string.byte(ori_data,i)
local by_new = string.byte(data,i)
if by_ori ~= by_new then
local op_name = ori_op_name[bit:_and(0x3F,by_ori) + 1]
local op_idx = bit:_and(0x3F,by_new)
new_op[op_name] = op_idx
end
end
print("old \t new \t name")
for idx, op_name in pairs(ori_op_name) do
local tmp = ''
if new_op[op_name] ~= nil then
tmp = new_op[op_name]
end
print((idx - 1) .. "\t" .. tmp .. "\t" .. op_name )
end
dofile("C:\\Users\\hello\\Desktop\\Check_OpCode\\check_opcode.lua") C:\Users\hello\Desktop\Check_OpCode\check_opcode.lua:64: table index is nil stack traceback: C:\Users\hello\Desktop\Check_OpCode\check_opcode.lua:64: in main chunk [C]: in function 'dofile' stdin:1: in main chunk [C]: ?