feat(memhub): [DET] 越界写打印块内容前16字节 - 定位 size=7 块被越界写的写入者(扫描 includes 阶段,后标记被写 0x0000)
This commit is contained in:
1 parent
fe98b5048e
commit
e48f2104ff
1 file changed
+7
-1
+7
-1
@@ -883,8 +883,14 @@ class MemBuddy(MemManager):
|
||||
m16: t.CUInt16T | t.CPtr = (t.CUInt16T | t.CPtr)(t.CVoid(p + s, t.CPtr))
|
||||
mv: t.CUInt16T = m16[0]
|
||||
if mv != t.CUInt16T(MEMBUDDY_DET_MARKER):
|
||||
stdio.printf("[DET] 越界写: ptr=%llu size=%llu 后标记=0x%04X(期望 0xCDCD)\n",
|
||||
stdio.printf("[DET] 越界写: ptr=%llu size=%llu 后标记=0x%04X(期望 0xCDCD)块内容前16B: ",
|
||||
p, s, t.CUInt32T(mv))
|
||||
bi3: t.CInt = 0
|
||||
while bi3 < 16:
|
||||
bv3: t.CUInt8T = (t.CUInt8T | t.CPtr)(t.CVoid(p + t.CUInt64T(bi3), t.CPtr))[0]
|
||||
stdio.printf("%02X ", t.CUInt32T(bv3))
|
||||
bi3 += 1
|
||||
stdio.printf("\n")
|
||||
stdlib.exit(1)
|
||||
i += 1
|
||||
|
||||
|
||||
Reference in new issue
Block a user