develop #11

Merged
Kayori merged 7 commits from Hay1tsme/artemis:develop into develop 2024-07-19 12:22:25 +00:00
Showing only changes of commit 68bbde209a - Show all commits

View File

@ -177,6 +177,7 @@ class AimedbServlette():
async def handle_lookup(self, data: bytes, resp_code: int) -> ADBBaseResponse: async def handle_lookup(self, data: bytes, resp_code: int) -> ADBBaseResponse:
req = ADBLookupRequest(data) req = ADBLookupRequest(data)
if req.access_code == "00000000000000000000": if req.access_code == "00000000000000000000":
self.logger.warn(f"All-zero access code from {req.head.keychip_id}")
ret = ADBLookupResponse.from_req(req.head, -1) ret = ADBLookupResponse.from_req(req.head, -1)
ret.head.status = ADBStatus.BAN_SYS ret.head.status = ADBStatus.BAN_SYS
return ret return ret
@ -207,6 +208,7 @@ class AimedbServlette():
async def handle_lookup_ex(self, data: bytes, resp_code: int) -> ADBBaseResponse: async def handle_lookup_ex(self, data: bytes, resp_code: int) -> ADBBaseResponse:
req = ADBLookupRequest(data) req = ADBLookupRequest(data)
if req.access_code == "00000000000000000000": if req.access_code == "00000000000000000000":
self.logger.warn(f"All-zero access code from {req.head.keychip_id}")
ret = ADBLookupExResponse.from_req(req.head, -1) ret = ADBLookupExResponse.from_req(req.head, -1)
ret.head.status = ADBStatus.BAN_SYS ret.head.status = ADBStatus.BAN_SYS
return ret return ret
@ -252,6 +254,7 @@ class AimedbServlette():
req = ADBFelicaLookupRequest(data) req = ADBFelicaLookupRequest(data)
idm = req.idm.zfill(16) idm = req.idm.zfill(16)
if idm == "0000000000000000": if idm == "0000000000000000":
self.logger.warn(f"All-zero IDm from {req.head.keychip_id}")
ret = ADBFelicaLookupResponse.from_req(req.head, "00000000000000000000") ret = ADBFelicaLookupResponse.from_req(req.head, "00000000000000000000")
ret.head.status = ADBStatus.BAN_SYS ret.head.status = ADBStatus.BAN_SYS
return ret return ret
@ -280,6 +283,7 @@ class AimedbServlette():
idm = req.idm.zfill(16) idm = req.idm.zfill(16)
if idm == "0000000000000000": if idm == "0000000000000000":
self.logger.warn(f"All-zero IDm from {req.head.keychip_id}")
ret = ADBFelicaLookupResponse.from_req(req.head, "00000000000000000000") ret = ADBFelicaLookupResponse.from_req(req.head, "00000000000000000000")
ret.head.status = ADBStatus.BAN_SYS ret.head.status = ADBStatus.BAN_SYS
return ret return ret
@ -319,6 +323,7 @@ class AimedbServlette():
idm = req.idm.zfill(16) idm = req.idm.zfill(16)
if idm == "0000000000000000": if idm == "0000000000000000":
self.logger.warn(f"All-zero IDm from {req.head.keychip_id}")
ret = ADBFelicaLookupExResponse.from_req(req.head, -1, "00000000000000000000") ret = ADBFelicaLookupExResponse.from_req(req.head, -1, "00000000000000000000")
ret.head.status = ADBStatus.BAN_SYS ret.head.status = ADBStatus.BAN_SYS
return ret return ret
@ -377,6 +382,7 @@ class AimedbServlette():
user_id = -1 user_id = -1
if req.access_code == "00000000000000000000": if req.access_code == "00000000000000000000":
self.logger.warn(f"All-zero access code from {req.head.keychip_id}")
ret = ADBLookupResponse.from_req(req.head, -1) ret = ADBLookupResponse.from_req(req.head, -1)
ret.head.status = ADBStatus.BAN_SYS ret.head.status = ADBStatus.BAN_SYS
return ret return ret