#!/usr/bin/env python3 # SPDX-License-Identifier: MIT import runpy import struct import unittest from pathlib import Path M=runpy.run_path(str(Path(__file__).with_name('process-initial-arguments.py'))) class InitialArguments(unittest.TestCase): def setUp(self): self.proc=0xfffffe1000000000;self.pid=54;self.top=0x16ffff000 self.words=dict(M['WITNESSES']) for offset in range(0,len(M['PREFIX']),4): self.words[0xfffffe00070be0b2+offset]=int.from_bytes(M['PREFIX'][offset:offset+4],'little') self.identity=struct.pack('>14,(self.begin+len(self.block)-1)>>14) self.assertEqual(self.collect()['argv'],['xpcproxy','','x'*120]) def test_counts_sizes_and_stack_bounds(self): good=self.fields;size,argc,top=struct.unpack('