This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from crccheck.crc import Crc16Xmodem | |
DBFilePath = input("path to NFDB file: ") | |
DBFileHandle = open(DBFilePath, mode='r+b') | |
deviceID = bytearray.fromhex(input("deviceID (optional): ")) | |
crcOffset = 0x40 | |
entry_size = 0x44 | |
countAddr = 0x1a95 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys, argparse | |
entry_count_offset = 0x2FBC | |
entry_count_size = 4 | |
entry_list_offset = entry_count_offset + entry_count_size + 8 | |
entry_size = 0x800 | |
max_entries = 500 | |
def read_offset(file, offset, size): | |
file.seek(offset) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import struct | |
def round_up_to_multiple(value, multiple): | |
mod = value%multiple | |
if mod == 0: | |
return value | |
return value + multiple - mod | |
def read_offset(file, offset, size): | |
file.seek(offset) |