Closed 0xPetra closed 10 months ago
Hello @0xPetra,
the output of the grep command should be 155224, if the firmware is untouched.
Two possible issues, if this doesn't work:
Kind regards, Danny
I'm using zsh
, so it should work.
Sorry to ask such a simple question, but where should I download it from?
Besides compiling my own version I also downloaded from here:
https://github.com/acalatrava/openhaystack-firmware/tree/main/apps/openhaystack-alternative/compiled
Thanks! Cheers, Petra
I'm using zsh, so it should work.
Do you use it on Linux or Mac? It seems Mac has an issue with grep. Please try to set the LC_CTYPE env variable before the command, i.e.:
LC_CTYPE=C grep -oba OFFLINEFINDINGPUBLICKEYHERE! nrf52_firmware.bin | cut -d ':' -f 1
resp.
LC_CTYPE=C xxd -p -c 100000 PREFIX_keyfile | xxd -r -p | dd of=nrf52_firmware.bin skip=1 bs=1 seek=$(grep -oba OFFLINEFINDINGPUBLICKEYHERE! nrf52_firmware.bin | cut -d ':' -f 1) conv=notrunc
Sorry to ask such a simple question, but where should I download it from?
You should use the version from this project at the release page
Oh, I didn't realize about releases. After making sure everything works, I can update the Readme with some notes.
Indeed I'm using a Mac. LC_CTYPE=C
does work for grep, printing 155224
, which is the expected value as you mentioned. But the second command still throws an error with the new .bin:
dd: no value specified for seek
Tried this (LC_CTYPE=C
in seek):
LC_CTYPE=C xxd -p -c 100000 PREFIX_keyfile | xxd -r -p | dd of=nrf52_firmware.bin skip=1 bs=1 seek=$(LC_CTYPE=C grep -oba OFFLINEFINDINGPUBLICKEYHERE! nrf52_firmware.bin | cut -d ':' -f 1) conv=notrunc
And got this response:
28+0 records in
28+0 records out
28 bytes transferred in 0.000152 secs (184211 bytes/sec)
Now, time to flash and see!
I've updated the README, to execute the command on non -GNU shells. The changes should work for Linux and Mac.
It does seem to work.
I also needed to make it a .hex with this command:
arm-none-eabi-objcopy -I binary -O ihex nrf52_firmware.bin nrf52_firmware.hex
I still can't flash my nRF52 Dongle, though. I'm using the Programmer app from nRF Connect, and "Write" is disabled with the patched firmware.
I thought maybe SoftDevice was missing and tried to add it separately. But it overlaps with the firmware, so I guess it was indeed included while compiling.
Any idea what might be going on?
Thanks in advance! Really appreciate the responses!
arm-none-eabi-objcopy -I binary -O ihex nrf52_firmware.bin nrf52_firmware.hex
I'm not familar with the programmer app, you are using, but this shouldn't be needed normally. I flash the firmware with opeonocd, that works really well. The commands and the openocd.cfg file is in the docs. Maybe you have to change the last line openocd.cfg from
source [find target/nrf51.cfg]
to
source [find target/nrf52.cfg]
, but I don't think this is really needed.
Can you try it with openocd?
I thought maybe SoftDevice was missing and tried to add it separately. But it overlaps with the firmware, so I guess it was indeed included while compiling.
You are right, the softdevice is already included.
I'm getting this error while trying to run this command:
xxd -p -c 100000 PREFIX_keyfile | xxd -r -p | dd of=nrf52_firmware.bin skip=1 bs=1 seek=$(grep -oba OFFLINEFINDINGPUBLICKEYHERE! nrf52_firmware.bin | cut -d ':' -f 1) conv=notrunc
I also tried running grep and got nothing as a response:
I compiled the
.bin
files again. Something that I need clarification on is how this command would look for a string in a binary file.I tried replacing
OFFLINEFINDINGPUBLICKEYHERE!
with the actual PUB KEY (which doesn't make sense), but I still did it.What could be happening? Appreciate the repo!