From da40a6d843d1d0aedd5ca88d7cf515dc34aa3c1d Mon Sep 17 00:00:00 2001 From: Asahi Lina Date: Wed, 17 Aug 2022 12:49:32 +0900 Subject: [PATCH] m1n1.constructutils: Add ZPadding type Like Padding, but actually asserts that the contents are zeroed. Signed-off-by: Asahi Lina --- proxyclient/m1n1/constructutils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/proxyclient/m1n1/constructutils.py b/proxyclient/m1n1/constructutils.py index bbc7279e..2da89159 100644 --- a/proxyclient/m1n1/constructutils.py +++ b/proxyclient/m1n1/constructutils.py @@ -11,6 +11,9 @@ g_struct_trace = set() g_struct_addrmap = {} g_depth = 0 +def ZPadding(size): + return Const(bytes(size), Bytes(size)) + def recusive_reload(obj, token=None): global g_depth @@ -659,4 +662,4 @@ def show_struct_trace(log=print): for addr, desc in sorted(list(g_struct_trace)): log(f"{addr:>#18x}: {desc}") -__all__ = ["ConstructClass", "ConstructValueClass", "Dec", "ROPointer", "show_struct_trace"] +__all__ = ["ConstructClass", "ConstructValueClass", "Dec", "ROPointer", "show_struct_trace", "ZPadding"]