Skip to content

Commit 11748d6

Browse files
committed
m1n1.hv: Make xnu_mode reflect if we used a macho or not
Signed-off-by: Hector Martin <[email protected]>
1 parent 0b1c9d9 commit 11748d6

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

proxyclient/m1n1/hv/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1769,13 +1769,14 @@ def load_macho(self, data, symfile=None):
17691769
if isinstance(data, str):
17701770
data = open(data, "rb")
17711771

1772+
self.xnu_mode = True
1773+
17721774
self.macho = macho = MachO(data)
17731775
if symfile is not None:
17741776
if isinstance(symfile, str):
17751777
symfile = open(symfile, "rb")
17761778
syms = MachO(symfile)
17771779
macho.add_symbols("com.apple.kernel", syms)
1778-
self.xnu_mode = True
17791780

17801781
self._load_macho_symbols()
17811782

@@ -1808,8 +1809,7 @@ def load_hook(data, segname, size, fileoff, dest):
18081809

18091810
#image = macho.prepare_image(load_hook)
18101811
image = macho.prepare_image()
1811-
self.load_raw(image, entryoffset=(macho.entry - macho.vmin), use_xnu_symbols=self.xnu_mode, vmin=macho.vmin)
1812-
1812+
self.load_raw(image, entryoffset=(macho.entry - macho.vmin), use_xnu_symbols=self.xnu_mode and symfile is not None, vmin=macho.vmin)
18131813

18141814
def update_pac_mask(self):
18151815
tcr = TCR(self.u.mrs(TCR_EL12))

0 commit comments

Comments
 (0)