28 lines
813 B
Python
28 lines
813 B
Python
# -*- coding: utf-8 -*-
|
|
"""临时分析脚本:解析 Generator 结构体布局,找 offset 25/26 字段"""
|
|
import re
|
|
|
|
s = open(r'd:\Users\TermiNexus\Desktop\TransPyC\TransPyV\output\f223ab7f90ee9c48.ll', encoding='utf-8').read()
|
|
m = re.search(r'%"f223ab7f90ee9c48\.Generator" = type \{(.*?)\}', s)
|
|
if m:
|
|
body = m.group(1)
|
|
parts = []
|
|
depth = 0
|
|
cur = ''
|
|
for ch in body:
|
|
if ch in '{[(':
|
|
depth += 1
|
|
elif ch in '}])':
|
|
depth -= 1
|
|
if ch == ',' and depth == 0:
|
|
parts.append(cur.strip())
|
|
cur = ''
|
|
else:
|
|
cur += ch
|
|
if cur.strip():
|
|
parts.append(cur.strip())
|
|
print('total fields:', len(parts))
|
|
for i in (24, 25, 26, 27, 28, 29, 30):
|
|
if i < len(parts):
|
|
print(i, parts[i])
|