From 238e39f415c425273c16ba931428947b6215f2aa Mon Sep 17 00:00:00 2001 From: Kevin Trocolli Date: Wed, 6 Sep 2023 22:47:37 -0400 Subject: [PATCH] adb: properly handle an incorrect adb status value --- core/adb_handlers/base.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/adb_handlers/base.py b/core/adb_handlers/base.py index 5523a29..0f208dd 100644 --- a/core/adb_handlers/base.py +++ b/core/adb_handlers/base.py @@ -78,7 +78,10 @@ class ADBHeader: self.protocol_ver = protocol_ver # u16 self.cmd = cmd # u16 self.length = length # u16 - self.status = ADBStatus(status) # u16 + try: + self.status = ADBStatus(status) # u16 + except ValueError as e: + raise ADBHeaderException(f"Status is incorrect! {e}") self.game_id = game_id # 4 char + \x00 self.store_id = store_id # u32 self.keychip_id = keychip_id# 11 char + \x00