diff options
author | Evan Lojewski <github@meklort.com> | 2019-03-25 22:33:31 -0600 |
---|---|---|
committer | Evan Lojewski <github@meklort.com> | 2019-03-25 22:33:31 -0600 |
commit | 843fdd8d8ccca6b5ec91c6f4727a7046064802d2 (patch) | |
tree | 629cd77ae34305d2bacced731617819f693545d5 /utils | |
parent | 320b7795417515643e5680d2f6f8ea25fd3998a6 (diff) | |
download | bcm5719-ortega-843fdd8d8ccca6b5ec91c6f4727a7046064802d2.tar.gz bcm5719-ortega-843fdd8d8ccca6b5ec91c6f4727a7046064802d2.zip |
bcmflash: fix code directory extraction.
Diffstat (limited to 'utils')
-rw-r--r-- | utils/bcmflash/main.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/utils/bcmflash/main.cpp b/utils/bcmflash/main.cpp index 61b84e0..487ebd2 100644 --- a/utils/bcmflash/main.cpp +++ b/utils/bcmflash/main.cpp @@ -423,7 +423,7 @@ int main(int argc, char const *argv[]) uint32_t type = BCM_CODE_DIRECTORY_GET_TYPE(info); printf("Code Address: 0x%08X\n", be32toh(nvram.contents.directory[i].codeAddress)); - printf("Code Words: 0x%08X (%d bytes)\n", length, length); + printf("Code Words: 0x%08X (%ld bytes)\n", length, length * sizeof(uint32_t)); printf("Code Offset: 0x%08X\n", be32toh(nvram.contents.directory[i].directoryOffset)); printf("Code CPU: 0x%02X\n", cpu); @@ -435,7 +435,7 @@ int main(int argc, char const *argv[]) uint8_t* cd_loc = &nvram.bytes[be32toh(nvram.contents.directory[i].directoryOffset)]; char* cd_name = strdup("cdN.bin"); cd_name[2] = '0' + i; - if(!save_to_file(cd_name, cd_loc, length)) + if(!save_to_file(cd_name, cd_loc, length * sizeof(uint32_t))) { exit(-1); } |