mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 05:43:48 -07:00
Dynamic report of the chipID for flashing purposes
This commit is contained in:
parent
fce082db56
commit
4727ab96d7
5 changed files with 64 additions and 5 deletions
|
@ -347,7 +347,7 @@ static int wait_for_ack(PacketResponseNG *ack) {
|
|||
}
|
||||
|
||||
// Go into flashing mode
|
||||
int flash_start_flashing(int enable_bl_writes, char *serial_port_name) {
|
||||
int flash_start_flashing(int enable_bl_writes, char *serial_port_name, uint32_t * chipinfo) {
|
||||
uint32_t state;
|
||||
|
||||
if (enter_bootloader(serial_port_name) < 0)
|
||||
|
@ -356,6 +356,13 @@ int flash_start_flashing(int enable_bl_writes, char *serial_port_name) {
|
|||
if (get_proxmark_state(&state) < 0)
|
||||
return -1;
|
||||
|
||||
if (state & DEVICE_INFO_FLAG_UNDERSTANDS_CHIP_INFO) {
|
||||
SendCommandBL(CMD_CHIP_INFO, 0, 0, 0, NULL, 0);
|
||||
PacketResponseNG resp;
|
||||
WaitForResponse(CMD_CHIP_INFO, &resp);
|
||||
*chipinfo = resp.oldarg[0];
|
||||
}
|
||||
|
||||
if (state & DEVICE_INFO_FLAG_UNDERSTANDS_START_FLASH) {
|
||||
// This command is stupid. Why the heck does it care which area we're
|
||||
// flashing, as long as it's not the bootloader area? The mind boggles.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue