Skip to content

Commit

Permalink
client: fix raw register accesses
Browse files Browse the repository at this point in the history
  • Loading branch information
doronz88 committed Jan 17, 2024
1 parent 9ef4301 commit 9986ff6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions src/rpcclient/rpcclient/darwin/processes.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,10 +357,10 @@ def poke(self, address: int, buf: bytes):
def get_symbol_name(self, address: int) -> str:
if self._client.arch != ARCH_ARM64:
raise NotImplementedError('implemented only on ARCH_ARM64')
x = self.vmu_object_identifier.objc_call('symbolForAddress:', address, return_raw=True).x
if x[0] == 0 and x[1] == 0:
result = self.vmu_object_identifier.objc_call('symbolForAddress:', address, return_raw=True)
if result.x0 == 0 and result.x1 == 0:
raise SymbolAbsentError()
return self._client.symbols.CSSymbolGetName(x[0], x[1]).peek_str()
return self._client.symbols.CSSymbolGetName(result.x0, result.x1).peek_str()

def get_symbol_image(self, name: str) -> Image:
for image in self.images:
Expand Down Expand Up @@ -624,8 +624,8 @@ def start_time(self) -> datetime:
if self._client.arch != ARCH_ARM64:
raise NotImplementedError('implemented only on ARCH_ARM64')
val = self.vmu_proc_info.objc_call('startTime', return_raw=True)
tv_sec = val.x[0]
tv_nsec = val.x[1]
tv_sec = val.x0
tv_nsec = val.x1
return datetime.fromtimestamp(tv_sec + (tv_nsec / (10 ** 9)))

@property
Expand Down
4 changes: 2 additions & 2 deletions src/rpcclient/rpcclient/ios/accessibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ def path(self) -> DarwinSymbol:
@property
def frame(self) -> CGRect:
""" get element's frame """
d = self.objc_call('frame', return_raw=True).d
return CGRect(origin=CGPoint(x=d[0], y=d[1]), size=CGSize(width=d[2], height=d[3]))
result = self.objc_call('frame', return_raw=True)
return CGRect(origin=CGPoint(x=result.d0, y=result.d1), size=CGSize(width=result.d2, height=result.d3))

@property
def label(self) -> Optional[str]:
Expand Down
4 changes: 2 additions & 2 deletions src/rpcclient/rpcclient/ios/screen_capture.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ def main_display(self) -> DarwinSymbol:

@property
def bounds(self) -> CGRect:
d = self.main_display.objc_call('bounds', return_raw=True).d
return CGRect(x0=d[0], y0=d[1], x1=d[2], y1=d[3])
result = self.main_display.objc_call('bounds', return_raw=True)
return CGRect(x0=result.d0, y0=result.d1, x1=result.d2, y1=result.d3)

@property
def screenshot(self) -> bytes:
Expand Down

0 comments on commit 9986ff6

Please sign in to comment.