mirror of
https://github.com/RfidResearchGroup/ChameleonUltra.git
synced 2026-08-28 02:14:06 +00:00
Add hf mfu eview command.
This commit is contained in:
@@ -1752,6 +1752,33 @@ class HFMFUWRPG(MFUAuthArgsUnit):
|
||||
print(f" - Ok")
|
||||
|
||||
|
||||
@hf_mfu.command('eview')
|
||||
class HFMFUEVIEW(DeviceRequiredUnit):
|
||||
def args_parser(self) -> ArgumentParserNoExit:
|
||||
parser = ArgumentParserNoExit()
|
||||
parser.description = 'MIFARE Ultralight / NTAG view emulator data'
|
||||
return parser
|
||||
|
||||
def get_param(self, args):
|
||||
class Param:
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
return Param()
|
||||
|
||||
def on_exec(self, args: argparse.Namespace):
|
||||
param = self.get_param(args)
|
||||
|
||||
nr_pages = self.cmd.mfu_get_emu_pages_count()
|
||||
page = 0
|
||||
while page < nr_pages:
|
||||
count = min(nr_pages - page, 16)
|
||||
data = self.cmd.mfu_read_emu_page_data(page, count)
|
||||
for i in range(0, len(data), 4):
|
||||
print(f"#{page+(i>>2):02x}: {data[i:i+4].hex()}")
|
||||
page += count
|
||||
|
||||
|
||||
@hf_mfu.command('rcnt')
|
||||
class HFMFURCNT(MFUAuthArgsUnit):
|
||||
def args_parser(self) -> ArgumentParserNoExit:
|
||||
|
||||
@@ -582,7 +582,6 @@ class ChameleonCMD:
|
||||
resp = self.device.send_cmd_sync(Command.MF0_NTAG_READ_EMU_PAGE_DATA, data)
|
||||
if len(resp.data) > 0:
|
||||
resp.parsed = resp.data[0]
|
||||
print(resp.data)
|
||||
return resp
|
||||
|
||||
@expect_response(Status.SUCCESS)
|
||||
|
||||
Reference in New Issue
Block a user