Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add specification for netgear .chk files #668

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions firmware/netgear_chk.ksy
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
meta:
id: netgear_chk
title: Netgear chk
license: GPL-2.0-or-later
endian: be
encoding: UTF-8
doc-ref:
- https://lxr.openwrt.org/source/firmware-utils/src/mkchkimg.c
- https://github.com/onekey-sec/unblob/blob/5d9fd6d8/unblob/handlers/archive/netgear/chk.py
seq:
- id: header
type: header
- id: kernel
size: header.rest_of_header.len_kernel
- id: rootfs
size: header.rest_of_header.len_rootfs
types:
header:
seq:
- id: magic
contents: [0x2a, 0x23, 0x24, 0x5e]
- id: len_header
type: u4
- id: rest_of_header
type: rest_of_header
size: len_header - len_header._sizeof - magic._sizeof
rest_of_header:
seq:
- id: region_code
type: u1
enum: region_codes
- id: reserved
size: 7
- id: kernel_checksum
type: u4
- id: rootfs_checksum
type: u4
- id: len_kernel
type: u4
- id: len_rootfs
type: u4
- id: image_checksum
type: u4
- id: header_checksum
type: u4
- id: board_id
size-eos: true
type: str
enums:
region_codes:
1: worldwide
2: north_america