felica_lookup_ex fails due to invalid company enum value #32

Closed
opened 2023-08-15 08:53:23 +00:00 by ASleepyCat · 4 comments
Contributor

When attempting to login in SDHD via my YubiDeck, my network status turns from green to yellow.

This is on develop (technically on my fix-worlds-end-id branch that's been rebased onto develop. I doubt the change I made there is relevant here). I don't encounter this error on master.

Oddly, it also detects that my company card type is NONE even though it's a KONAMI Amusement IC card.

[2023-08-15 18:37:04] Chunithm | INFO | v210 Ping request from 127.0.0.1
[2023-08-15 18:37:40] Aimedb | DEBUG | 192.168.50.102 Connected
[2023-08-15 18:37:40] Aimedb | DEBUG | 192.168.50.102 wrote 3ea12040110070000000534448440000230100004136394530314138383838007b975654593fe074fd83bf0fc69a669b012e48b1f6165ec400f10000000143000000000000000080d0e73571004f00800000000000000000e0410003000000000000000000000080009400f100000000
[2023-08-15 18:37:40] Aimedb | INFO | felica_lookup_ex from A69E01A8888 (SDHD) @ 192.168.50.102
Unhandled Error
Traceback (most recent call last):
  File "C:\Users\dyeom\AppData\Local\Programs\Python\Python311\Lib\site-packages\twisted\python\log.py", line 96, in callWithLogger
    return callWithContext({"system": lp}, func, *args, **kw)
  File "C:\Users\dyeom\AppData\Local\Programs\Python\Python311\Lib\site-packages\twisted\python\log.py", line 80, in callWithContext
    return context.call({ILogContext: newCtx}, func, *args, **kw)
  File "C:\Users\dyeom\AppData\Local\Programs\Python\Python311\Lib\site-packages\twisted\python\context.py", line 117, in callWithContext
    return self.currentContext().callWithContext(ctx, func, *args, **kw)
  File "C:\Users\dyeom\AppData\Local\Programs\Python\Python311\Lib\site-packages\twisted\python\context.py", line 82, in callWithContext
    return func(*args, **kw)
--- <exception caught here> ---
  File "C:\Users\dyeom\AppData\Local\Programs\Python\Python311\Lib\site-packages\twisted\internet\selectreactor.py", line 148, in _doReadOrWrite
    why = getattr(selectable, method)()
  File "C:\Users\dyeom\AppData\Local\Programs\Python\Python311\Lib\site-packages\twisted\internet\tcp.py", line 248, in doRead
    return self._dataReceived(data)
  File "C:\Users\dyeom\AppData\Local\Programs\Python\Python311\Lib\site-packages\twisted\internet\tcp.py", line 253, in _dataReceived
    rval = self.protocol.dataReceived(data)
  File "D:\Git\artemis\core\aimedb.py", line 96, in dataReceived
    resp = handler(decrypted, resp_code)
  File "D:\Git\artemis\core\aimedb.py", line 213, in handle_felica_lookup_ex
    req = ADBFelicaLookup2Request(data)
  File "D:\Git\artemis\core\adb_handlers\felica.py", line 39, in __init__
    self.company = CompanyCodes(company)
  File "C:\Users\dyeom\AppData\Local\Programs\Python\Python311\Lib\enum.py", line 711, in __call__
    return cls.__new__(cls, value)
  File "C:\Users\dyeom\AppData\Local\Programs\Python\Python311\Lib\enum.py", line 1128, in __new__
    raise ve_exc
builtins.ValueError: b'\x00' is not a valid CompanyCodes

[2023-08-15 18:37:40] Aimedb | DEBUG | 192.168.50.102 Disconnected - b'\x00' is not a valid CompanyCodes
When attempting to login in SDHD via my YubiDeck, my network status turns from green to yellow. This is on `develop` (technically on my `fix-worlds-end-id` branch that's been rebased onto `develop`. I doubt the change I made there is relevant here). I don't encounter this error on `master`. Oddly, it also detects that my company card type is `NONE` even though it's a KONAMI Amusement IC card. ``` [2023-08-15 18:37:04] Chunithm | INFO | v210 Ping request from 127.0.0.1 [2023-08-15 18:37:40] Aimedb | DEBUG | 192.168.50.102 Connected [2023-08-15 18:37:40] Aimedb | DEBUG | 192.168.50.102 wrote 3ea12040110070000000534448440000230100004136394530314138383838007b975654593fe074fd83bf0fc69a669b012e48b1f6165ec400f10000000143000000000000000080d0e73571004f00800000000000000000e0410003000000000000000000000080009400f100000000 [2023-08-15 18:37:40] Aimedb | INFO | felica_lookup_ex from A69E01A8888 (SDHD) @ 192.168.50.102 Unhandled Error Traceback (most recent call last): File "C:\Users\dyeom\AppData\Local\Programs\Python\Python311\Lib\site-packages\twisted\python\log.py", line 96, in callWithLogger return callWithContext({"system": lp}, func, *args, **kw) File "C:\Users\dyeom\AppData\Local\Programs\Python\Python311\Lib\site-packages\twisted\python\log.py", line 80, in callWithContext return context.call({ILogContext: newCtx}, func, *args, **kw) File "C:\Users\dyeom\AppData\Local\Programs\Python\Python311\Lib\site-packages\twisted\python\context.py", line 117, in callWithContext return self.currentContext().callWithContext(ctx, func, *args, **kw) File "C:\Users\dyeom\AppData\Local\Programs\Python\Python311\Lib\site-packages\twisted\python\context.py", line 82, in callWithContext return func(*args, **kw) --- <exception caught here> --- File "C:\Users\dyeom\AppData\Local\Programs\Python\Python311\Lib\site-packages\twisted\internet\selectreactor.py", line 148, in _doReadOrWrite why = getattr(selectable, method)() File "C:\Users\dyeom\AppData\Local\Programs\Python\Python311\Lib\site-packages\twisted\internet\tcp.py", line 248, in doRead return self._dataReceived(data) File "C:\Users\dyeom\AppData\Local\Programs\Python\Python311\Lib\site-packages\twisted\internet\tcp.py", line 253, in _dataReceived rval = self.protocol.dataReceived(data) File "D:\Git\artemis\core\aimedb.py", line 96, in dataReceived resp = handler(decrypted, resp_code) File "D:\Git\artemis\core\aimedb.py", line 213, in handle_felica_lookup_ex req = ADBFelicaLookup2Request(data) File "D:\Git\artemis\core\adb_handlers\felica.py", line 39, in __init__ self.company = CompanyCodes(company) File "C:\Users\dyeom\AppData\Local\Programs\Python\Python311\Lib\enum.py", line 711, in __call__ return cls.__new__(cls, value) File "C:\Users\dyeom\AppData\Local\Programs\Python\Python311\Lib\enum.py", line 1128, in __new__ raise ve_exc builtins.ValueError: b'\x00' is not a valid CompanyCodes [2023-08-15 18:37:40] Aimedb | DEBUG | 192.168.50.102 Disconnected - b'\x00' is not a valid CompanyCodes ```
Author
Contributor

Converting the byte sequence to an int causes another error further along:

[2023-08-15 18:55:31] Chunithm | INFO | v210 Ping request from 127.0.0.1
[2023-08-15 18:56:05] Aimedb | DEBUG | 192.168.50.102 Connected
[2023-08-15 18:56:05] Aimedb | DEBUG | 192.168.50.102 wrote 3ea1204011007000000053444844000023010000413639453031413838383800489245e7812707611891754ded8683a3012e48b1f6165ec400f10000000143000000000000000000a820aaf900410080000000000000000000000000000000000000000000000000009400f100000000
[2023-08-15 18:56:05] Aimedb | INFO | felica_lookup_ex from A69E01A8888 (SDHD) @ 192.168.50.102
[2023-08-15 18:56:05] INFO | Database | SQL Execute: SELECT aime_card.id, aime_card."user", aime_card.access_code, aime_card.created_date, aime_card.last_login_date, aime_card.is_locked, aime_card.is_banned FROM aime_card WHERE aime_card.access_code = :access_code_1
[2023-08-15 18:56:05] Aimedb | INFO | idm 12E48B1F6165EC4 ipm F1000000014300 -> access_code 00085085372141690564 user_id 10000
[2023-08-15 18:56:05] Aimedb | ERROR | Failed to encrypt 3ea1873012003c0101005344484400002301000041363945303141383838380010270000ffffffff000850853721416905640001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 because Data must be aligned to block boundary in ECB mode
[2023-08-15 18:56:10] Aimedb | DEBUG | 192.168.50.102 wrote 3ea1204066002000000000000000000000000000000000000000000000000000
[2023-08-15 18:56:10] Aimedb | INFO | goodbye from 192.168.50.102
[2023-08-15 18:56:10] Aimedb | DEBUG | 192.168.50.102 Disconnected - Connection was closed cleanly.
[2023-08-15 18:56:10] Aimedb | DEBUG | 192.168.50.102 Connected
[2023-08-15 18:56:10] Aimedb | DEBUG | 192.168.50.102 wrote 3ea120400b00300000005344484400002301000041363945303141383838380000000000000000000000000000000000
[2023-08-15 18:56:10] Aimedb | INFO | campaign from A69E01A8888 (SDHD) @ 192.168.50.102
[2023-08-15 18:56:10] Aimedb | DEBUG | Response 3ea187300c000002010053444844000023010000413639453031413838383800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
[2023-08-15 18:56:10] Aimedb | INFO | goodbye from 192.168.50.102
[2023-08-15 18:56:10] Aimedb | DEBUG | 192.168.50.102 Disconnected - Connection was closed cleanly.
Converting the `byte` sequence to an `int` causes another error further along: ``` [2023-08-15 18:55:31] Chunithm | INFO | v210 Ping request from 127.0.0.1 [2023-08-15 18:56:05] Aimedb | DEBUG | 192.168.50.102 Connected [2023-08-15 18:56:05] Aimedb | DEBUG | 192.168.50.102 wrote 3ea1204011007000000053444844000023010000413639453031413838383800489245e7812707611891754ded8683a3012e48b1f6165ec400f10000000143000000000000000000a820aaf900410080000000000000000000000000000000000000000000000000009400f100000000 [2023-08-15 18:56:05] Aimedb | INFO | felica_lookup_ex from A69E01A8888 (SDHD) @ 192.168.50.102 [2023-08-15 18:56:05] INFO | Database | SQL Execute: SELECT aime_card.id, aime_card."user", aime_card.access_code, aime_card.created_date, aime_card.last_login_date, aime_card.is_locked, aime_card.is_banned FROM aime_card WHERE aime_card.access_code = :access_code_1 [2023-08-15 18:56:05] Aimedb | INFO | idm 12E48B1F6165EC4 ipm F1000000014300 -> access_code 00085085372141690564 user_id 10000 [2023-08-15 18:56:05] Aimedb | ERROR | Failed to encrypt 3ea1873012003c0101005344484400002301000041363945303141383838380010270000ffffffff000850853721416905640001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 because Data must be aligned to block boundary in ECB mode [2023-08-15 18:56:10] Aimedb | DEBUG | 192.168.50.102 wrote 3ea1204066002000000000000000000000000000000000000000000000000000 [2023-08-15 18:56:10] Aimedb | INFO | goodbye from 192.168.50.102 [2023-08-15 18:56:10] Aimedb | DEBUG | 192.168.50.102 Disconnected - Connection was closed cleanly. [2023-08-15 18:56:10] Aimedb | DEBUG | 192.168.50.102 Connected [2023-08-15 18:56:10] Aimedb | DEBUG | 192.168.50.102 wrote 3ea120400b00300000005344484400002301000041363945303141383838380000000000000000000000000000000000 [2023-08-15 18:56:10] Aimedb | INFO | campaign from A69E01A8888 (SDHD) @ 192.168.50.102 [2023-08-15 18:56:10] Aimedb | DEBUG | Response 3ea187300c000002010053444844000023010000413639453031413838383800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 [2023-08-15 18:56:10] Aimedb | INFO | goodbye from 192.168.50.102 [2023-08-15 18:56:10] Aimedb | DEBUG | 192.168.50.102 Disconnected - Connection was closed cleanly. ```
Owner

Heya, this error is the result of me switching up some stuff with how AimeDB requests are handled. I didn't test felica_lookup_ex because none of the games I had on hand hit it. I'll push a fix shortly.

Heya, this error is the result of me switching up some stuff with how AimeDB requests are handled. I didn't test felica_lookup_ex because none of the games I had on hand hit it. I'll push a fix shortly.
Owner

Pushed a fix, please test at your convenience.

Pushed a fix, please test at your convenience.
Hay1tsme added the
bug
waiting
labels 2023-08-15 14:44:32 +00:00
Hay1tsme added reference develop 2023-08-15 14:44:44 +00:00
Author
Contributor

Confirmed fixed, closing issue.

Confirmed fixed, closing issue.
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Hay1tsme/artemis#32
No description provided.