From 92567504f4251ee5c365d61cdf40029a2d162404 Mon Sep 17 00:00:00 2001 From: Hay1tsme Date: Tue, 15 Aug 2023 10:43:49 -0400 Subject: [PATCH] adb: fix for felica_lookup_ex, for #32 --- core/adb_handlers/felica.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/adb_handlers/felica.py b/core/adb_handlers/felica.py index 7e659d4..04a8961 100644 --- a/core/adb_handlers/felica.py +++ b/core/adb_handlers/felica.py @@ -36,7 +36,7 @@ class ADBFelicaLookup2Request(ADBBaseRequest): self.card_key_ver, self.write_ct, self.maca, company, fw_ver, self.dfc = struct.unpack_from("<16s16sQccH", data, 0x40) self.idm = hex(idm)[2:].upper() self.pmm = hex(pmm)[2:].upper() - self.company = CompanyCodes(company) + self.company = CompanyCodes(int.from_bytes(company, 'little')) self.fw_ver = ReaderFwVer.from_byte(fw_ver) class ADBFelicaLookup2Response(ADBBaseResponse): @@ -50,8 +50,8 @@ class ADBFelicaLookup2Response(ADBBaseResponse): def make(self) -> bytes: resp_struct = Struct( "user_id" / Int32sl, - "relation1" / Int16sl, - "relation2" / Int16sl, + "relation1" / Int32sl, + "relation2" / Int32sl, "access_code" / Int8ub[10], "portal_status" / Int8ub, "company_code" / Int8ub,