setpib(1)
โจ setpib โ the Qualcomm Atheros PIB File Editor, bestie edition โจ
okay so real talk, this is setpib(1) from the Qualcomm Atheros Open Powerline Toolkit, and she is powerful in a slightly scary way. buckle up. ๐
๐ NAME
setpib โ Qualcomm Atheros PIB File Editor ๐
๐ฆ SYNOPSIS
setpib [options] file base [type data] [type data] [...]
๐ธ DESCRIPTION
So basically: setpib replaces one or more values inside a Qualcomm Atheros powerline parameter file (a.k.a. a PIB file) and then re-computes the checksum. slay. โจ
The way you tell it what to change is by handing it a whole lil sequence of type/data pairs. and here's the thing, bestie โ you have to already know the offset, the length, and the type of every value you're touching. if you don't? problems. certain problems. ๐ญ this program makes absolutely no effort to validate offsets or values. none. zero. not even a little vibe check.
ngl this program can change any PIB value, and yes that includes the ones that should not be changed. ๐ฉ be warned: some PIB values are derived from, or interact with, other PIB values. if you ignore those dependencies, you may diminish performance or straight-up render a device inoperable. ๐
Atheros does not recommend using this program to edit PIB parameters, because small mistakes can cause big problems. Also, Atheros is under no obligation to give customers the offset, length or type of any PIB file parameter. so likeโฆ you're on your own, girlie. ๐
Atheros recommends using program modpib to change device identity parameters, and the Windows Device Manager to change other parameters, whenever possible. that's the โจ responsible โจ route. ๐
This program handles the older Thunderbolt/Lightning parameter files and the newer Panther/Lynx parameter files โ but it has a larger footprint that may not be acceptable for embedded systems. so if you only ever use the older ones, or only ever use the newer ones, consider:
setpib1โ an older Thunderbolt/Lightning only version ๐ฉ๏ธsetpib2โ a newer Panther/Lynx only version ๐
This program is part of the Qualcomm Atheros Powerline Toolkit. see the AMP man page for an overview and installation instructions. ๐ซถ
๐ OPTIONS ๐
-qโ Enable quiet mode, which has no effect. that's it. that's the whole option. iconic behaviour honestly. ๐-vโ Print a hexdump of the edited region. if this option appears twice, print hexdump headers too. the region window can be changed with option-w. ๐-wwindow โ The display window, in bytes. when option-vis present, PIB information surrounding the edited region gets displayed to provide some sort of context, and the edited region appears in the middle of this window. default window is 32 bytes. that means the 32 bytes before and the 32 bytes after the edited region are included in the display. ๐ช-xโ Repair the checksum. by default, this program does not modify files that fail the size or checksum test on input. on top of that, it does not re-compute the checksum on output if no data has changed. this option skips the size and checksum test on input and re-computes the checksum on output even if no data has changed. ๐ฉน
โ ๏ธ This option only works on legacy PIB files. It does not work on PIB files having NVM file format. no cap.
-?,--helpโ Print the program help summary on stdout. this option takes precedence over other options on the command line. ๐-!,--versionโ Print program version information on stdout. this option takes precedence over other options on the command line. use this option when sending screen dumps to Atheros Technical Support so they know exactly which version of the Linux Toolkit you're running. ๐ธ
๐ ARGUMENTS
fileโ The PIB filename. the file must exist and it will be re-written. no assumptions are made based on the filename and no filename conventions are enforced. this argument is required and it must come before thebaseargument. ๐baseโ The byte offset where changes will start. the offset is expressed in hexadecimal, with (or without) the leading"0x". changes are applied in order, left to right, and the offset automatically increments by the correct amount after each change is applied. this lets you change consecutive PIB locations with just one command. ๐ฏ this argument is required, must follow thefileargument, and must also precede all format/data pairs. normally you'd need multiplesetpibcommands to change non-consecutive PIB locations โ but careful use of formatskipcan achieve the same results with one command. iykyk. โจtypeโ The implied length and encoding of the data. valid types arebyte,word,long,dataandhfid. a valid format must precede each data item. abyteis 8 bits, awordis 16 bits, alongis 32 bits and ahugeis 64 bits. the format implies the maximum data value, except for formatdata, which is limited by the number of octets entered on the command line. ๐งฎdataโ The information written to the current PIB offset. integer data may be expressed in binary, decimal or hexadecimal, but must not exceed the type minimum or maximum. string data may contain any ASCII characters that can be entered via keyboard, but must be enclosed in quotes when spaces are included. binary values start with0bor0B, and hexadecimal values start with0xor0X. ๐ข
๐ FORMATS ๐
byte integer
A signed or unsigned integer stored as 8 bits or 1 byte. the value is expressed in decimal by default. a binary value may be expressed with a 0b prefix. a hexadecimal value may be expressed using a 0x prefix. negative type/data values must appear at the end of the command line, after option "--", to avoid parsing errors. the offset increments by 1 prior to the next insertion. ๐
word integer
A signed or unsigned integer stored as 16 bits or 2 bytes. the value is expressed in decimal by default. a binary value may be expressed with a 0b prefix. a hexadecimal value may be expressed using a 0x prefix. negative type/data values must appear at the end of the command line, after option "--", to avoid parsing errors. the offset increments by 2 prior to the next insertion. ๐
long integer
A signed or unsigned integer stored as 32 bits or 4 bytes. the value is expressed in decimal by default. a binary value may be expressed with a 0b prefix. a hexadecimal value may be expressed using a 0x prefix. negative type/data values must appear at the end of the command line, after option "--", to avoid parsing errors. the offset increments by 4 prior to the next insertions. ๐
huge integer
A signed or unsigned integer stored as 64 bits or 8 bytes. the value is expressed in decimal by default. a binary value may be expressed with a 0b prefix. a hexadecimal value may be expressed using a 0x prefix. the offset increments by 8 prior to the next insertion. negative type/data values must appear at the end of the command line, after option "--", to avoid parsing errors.
โญ This format is only available on hosts that support 64 bit data values. know your machine, bestie.
data hex
A sequence of hexadecimal octets. octets may be separated by a colon for clarity. the number of octets determines the number of bytes written. the offset increments by the number of bytes written. this is similar to "key" and "mac" below, but it accepts variable length input. ๐ฆ
key hex
A sequence of hexadecimal octets. octets may be separated by a colon for clarity. the number of octets must convert to 16 bytes or an error will occur. the offset increments by 16 prior to the next insertion. this is similar "data" above but accepts only fixed length input. this option may be used to set the DAK, NMK or NVAK values. ๐
mac hex
A sequence of hexadecimal octets. octets may be separated by a colon for clarity. the number of octets must convert to 6 bytes or an error will occur. the offset increments by 6 prior to the next insertion. this is similar "data" above but accepts only fixed length input. this option may be used to set the DAK, NMK or NVAK values. ๐ซง
text string
An ASCII character string. the string length determines the number of bytes stored. the string is stored with a NUL terminator included. it is not padded or truncated. the offset increments by the number of bytes stored prior to the next insertion. this option may be used to enter a variable length string. ๐
hfid string
An ASCII character string. the string is always stored as 64 bytes. short strings are padded on the right with NUL characters. long strings are truncated on the right and the last byte is forced to NUL. the offset increments by 64 bytes prior to the next insertion. this option may be used to enter user, network and manufacturer identification strings. ๐ท๏ธ
zero count
An unsigned integer representing the number of consecutive bytes to fill with 0x00. the offset increments by the number of bytes written. this option may be used to erase regions of the PIB. ๐งผ
fill count
An unsigned integer representing the number of consecutive bytes to fill with 0xFF. the offset increments by the number of bytes written. this option may be used to erase regions of the PIB. ๐๏ธ
skip count
An unsigned integer indicating the number of bytes to skip over before starting another change. intervening data locations are unchanged. ๐ฆ
to be continued, bestieโฆ part 2 is coming ๐
โจ TR69 DATA TYPES โจ
okay so these are the special TR-69 flavored string types and bestie, they do not play about their fixed sizes. every single one of them is a fixed-width ASCII situation: too short and it gets padded, too long and it gets chopped. no cap. ๐
accesspasswordโ string energy. it's an ASCII character string, and it is always stored as257bytes. short strings get padded on the right with NUL characters, long strings get truncated on the right and that last byte gets forced to NUL. the offset increments by257prior to the next insertion.accessusernameโ ASCII character string, always stored as33bytes. short ones get padded on the right with NULs, long ones get truncated on the right with the last byte forced to NUL. the offset increments by33prior to the next insertion.adminpasswordโ ASCII character string, always stored as33bytes. short โ right-padded with NULs, long โ truncated on the right with the last byte forced to NUL. offset increments by33prior to the next insertion.adminusernameโ ASCII character string, always stored as33bytes. short โ right-padded with NULs, long โ truncated on the right with the last byte forced to NUL. offset increments by33prior to the next insertion.passwordโ ASCII character string, always stored as257bytes. short โ right-padded with NULs, long โ truncated on the right with the last byte forced to NUL. offset increments by257prior to the next insertion.urlโ ASCII character string, always stored as257bytes. short โ right-padded with NULs, long โ truncated on the right with the last byte forced to NUL. offset increments by257prior to the next insertion.usernameโ ASCII character string, always stored as257bytes. short โ right-padded with NULs, long โ truncated on the right with the last byte forced to NUL. offset increments by257prior to the next insertion.
๐ EXAMPLES ๐
example the first โ this one edits the file abc.pib by writing decimal value 1 at offset 01F7 followed by hexadecimal value 00B052BABE01. a partial dump gets printed showing 16 bytes before and 16 bytes after the changed data because the default display windows is 16 bytes. unless the change lands right at the start or end of the file, it'll show up in the center of the display window. iconique behavior honestly ๐
# setpib -v abc.pib 01F7 byte 1 data 00:B0:52:BA:BE:01
000001D0 00 00 00 00 00 00 00 00 00
.........
000001E0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
................
000001F0 00 00 00 00 00 00 00 01 00 B0 52 BA BE 01 00 00
..........R.....
00000200 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
................
00000210 00 00 00 00 00 00 00 00 00 00 00 00 00 00
..............
example the second โ this one sets the manufacturer HFID string in PIB file def.pib. HFID strings are 64 characters long and either truncated or padded on the right with NUL characters. and heads up bestie, you may need to enclose the string in quotes if it contains spaces. ๐ซถ
# setpib -v def.pib 24 hfid "Galactic Software Pirates, Inc."
00000000 38 1F 00 00 30 1B EB 04 00 B0 52 00
8...0.....R.
00000010 00 66 50 D3 E4 93 3F 85 5B 70 40 78 4D F8 15 AA
.fP...?.[p@xM...
00000020 8D B7 00 00 47 61 6C 61 63 74 69 63 20 53 6F 66
....Galactic Sof
00000030 74 77 61 72 65 20 50 69 72 61 74 65 73 2C 20 49 tware
Pirates, I
00000040 6E 63 2E 00 00 00 00 00 00 00 00 00 00 00 00 00
nc..............
00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
................
00000060 00 00 00 00 50 D3 E4 93 3F 85 5B 70 40 78 4D F8
....P...?.[p@xM.
00000070 15 AA 8D B7 49 6E 74 65 6C 6C 6F 6E 20 45 6E 61
....Atheros Ena
00000080 62 6C 65 64 bled
example the third โ this one displays the contents of PIB file abc.pib without changing any data. the region displayed is 24 bytes starting at offset 0x24. the format skip specifies the region but does not change it. by default, the 32 bytes before and 32 bytes after are included in the display. this technique can be used to inspect a specific portion of a PIB file. lowkey a little peek, no touch, we respect boundaries here ๐
# setpib -v abc.pib 24 skip 64
00000000 38 1F 00 00 30 1B EB 04 00 B0 52 00
8...0.....R.
00000010 00 66 50 D3 E4 93 3F 85 5B 70 40 78 4D F8 15 AA
.fP...?.[p@xM...
00000020 8D B7 00 00 47 61 6C 61 63 74 69 63 20 53 6F 66
....Galactic Sof
00000030 74 77 61 72 65 20 50 69 72 61 74 65 73 2C 20 49 tware
Pirates, I
00000040 6E 63 2E 00 00 00 00 00 00 00 00 00 00 00 00 00
nc..............
00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
................
00000060 00 00 00 00 50 D3 E4 93 3F 85 5B 70 40 78 4D F8
....P...?.[p@xM.
00000070 15 AA 8D B7 49 6E 74 65 6C 6C 6F 6E 20 45 6E 61
....Atheros Ena
00000080 62 6C 65 64 bled
example the fourth โ same vibe, but for a negative value. and this one is tricky because that minus sign is gonna get interpreted as the start of another option ๐ญ so we must use -- to end normal option parsing. it's a POSIX standard feature, bestie โ see IEEE Std 1002.1-2001, Section 12.2, Utility Syntax Guidelines for more an explanation.
# setpib -v abc.pib 1471 -- long -50
00001450 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
...............
00001460 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
................
00001470 00 CE FF FF FF 00 00 00 00 00 00 00 00 00 00 00
................
00001480 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
................
00001490 00 00 00 00 00 .....
example the fifth โ this one computes a new checksum without changing any data. the filename and an offset are required but no other values are needed. this technique can be used to compute a new checksum after modifying the file using software that does not update the checksum. the glow-up is internal, you won't even see it โจ
# setpib abc.pib 0 -x
โ ๏ธ DISCLAIMER โ ๏ธ
PIB file structure and content is proprietary to Qualcomm Atheros, Ocala FL USA. consequently, public information is not available. Qualcomm Atheros reserves the right to modify PIB file structure or content in future firmware releases without any obligation to notify or compensate users of this program. so likeโฆ don't come for us, okay? ๐
๐ SEE ALSO ๐
chkpib(7), chkpib2(7), getpib(7), modpib(1), pib2xml(1), pibcomp(1), pibdump(1), xml2pib(1)
the whole friend group fr fr ๐ซถ go say hi
๐ CREDITS ๐
Charles Maier ]
and that's the whole page bestie, we ate and left absolutely no crumbs ๐๐
this lil gem is open-plc-utils-0.0.3 from November 2013, and it's the setpib(1) manual page โ iconic, timeless, and still serving. mwah ๐โจ
๐ฆ where this page comes from
- alpine 3.24: open-plc-utils-doc 0_git20250712-r1 ยท BSD-3-Clause-Clear
- debian bookworm: plc-utils-extra 0.0.6+git20230504.1ba7d5a0-1 ยท BSD-3
- debian trixie: plc-utils-extra 0.0.6+git20250517.7fb8ac5-1 ยท BSD-3
- ubuntu noble: plc-utils-extra 0.0.6+git20230504.1ba7d5a0-1 ยท BSD-3
- ubuntu questing: plc-utils-extra 0.0.6+git20250517.7fb8ac5-1
- ubuntu resolute: plc-utils-extra 0.0.6+git20250712.46c3506-1 ยท BSD-3
- ubuntu stonking: plc-utils-extra 0.0.6+git20250712.46c3506-1 ยท BSD-3
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms