mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 13:53:55 -07:00
commit
599b4f6e73
5 changed files with 31 additions and 7 deletions
|
@ -19,6 +19,7 @@ This project uses the changelog in accordance with [keepchangelog](http://keepac
|
|||
- Changed `hf 14a info` - now reads and prints QL88 sigantures (@iceman1001)
|
||||
- Fixed `hf iclass dump` truncating AA2 blocks and improve reliability (@nvx)
|
||||
- Added some info about UMC in "doc/magic_cards_notes.md" (@temskiy)
|
||||
- Added `hw bootloader` to reboot to the bootloader mode (@wh201906)
|
||||
|
||||
## [Faraday.4.17511][2023-11-13]
|
||||
- Fixed Python support of `experimental_client_with_swig` (@doegox)
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
#include "cmdflashmem.h" // get_signature..
|
||||
#include "uart/uart.h" // configure timeout
|
||||
#include "util_posix.h"
|
||||
#include "flash.h" // reboot to bootloader mode
|
||||
|
||||
static int CmdHelp(const char *Cmd);
|
||||
|
||||
|
@ -1100,6 +1101,25 @@ static int CmdBreak(const char *Cmd) {
|
|||
return PM3_SUCCESS;
|
||||
}
|
||||
|
||||
static int CmdBootloader(const char *Cmd) {
|
||||
|
||||
CLIParserContext *ctx;
|
||||
CLIParserInit(&ctx, "hw bootloader",
|
||||
"Reboot Proxmark3 into bootloader mode",
|
||||
"hw bootloader\n"
|
||||
);
|
||||
|
||||
void *argtable[] = {
|
||||
arg_param_begin,
|
||||
arg_param_end
|
||||
};
|
||||
CLIExecWithReturn(ctx, Cmd, argtable, true);
|
||||
CLIParserFree(ctx);
|
||||
clearCommandBuffer();
|
||||
flash_reboot_bootloader(g_conn.serial_port_name, false);
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
|
||||
int set_fpga_mode(uint8_t mode) {
|
||||
if (mode < FPGA_BITSTREAM_LF || mode > FPGA_BITSTREAM_HF_15) {
|
||||
return PM3_EINVARG;
|
||||
|
@ -1122,6 +1142,7 @@ static command_t CommandTable[] = {
|
|||
{"-------------", CmdHelp, AlwaysAvailable, "----------------------- " _CYAN_("Hardware") " -----------------------"},
|
||||
{"help", CmdHelp, AlwaysAvailable, "This help"},
|
||||
{"break", CmdBreak, IfPm3Present, "Send break loop usb command"},
|
||||
{"bootloader", CmdBootloader, IfPm3Present, "Reboot Proxmark3 into bootloader mode"},
|
||||
{"connect", CmdConnect, AlwaysAvailable, "Connect Proxmark3 to serial port"},
|
||||
{"dbg", CmdDbg, IfPm3Present, "Set Proxmark3 debug level"},
|
||||
{"detectreader", CmdDetectReader, IfPm3Present, "Detect external reader field"},
|
||||
|
|
|
@ -427,7 +427,7 @@ static int get_proxmark_state(uint32_t *state) {
|
|||
}
|
||||
|
||||
// Enter the bootloader to be able to start flashing
|
||||
static int enter_bootloader(char *serial_port_name) {
|
||||
static int enter_bootloader(char *serial_port_name, bool wait_appear) {
|
||||
uint32_t state;
|
||||
int ret;
|
||||
|
||||
|
@ -457,7 +457,9 @@ static int enter_bootloader(char *serial_port_name) {
|
|||
// Let time to OS to make the port disappear
|
||||
msleep(1000);
|
||||
|
||||
if (OpenProxmark(&g_session.current_device, serial_port_name, true, 60, true, FLASHMODE_SPEED)) {
|
||||
if (wait_appear == false) {
|
||||
return PM3_SUCCESS;
|
||||
} else if (OpenProxmark(&g_session.current_device, serial_port_name, true, 60, true, FLASHMODE_SPEED)) {
|
||||
PrintAndLogEx(NORMAL, _GREEN_(" found"));
|
||||
return PM3_SUCCESS;
|
||||
} else {
|
||||
|
@ -512,7 +514,7 @@ int flash_start_flashing(int enable_bl_writes, char *serial_port_name, uint32_t
|
|||
uint32_t chipinfo = 0;
|
||||
int ret;
|
||||
|
||||
ret = enter_bootloader(serial_port_name);
|
||||
ret = enter_bootloader(serial_port_name, true);
|
||||
if (ret != PM3_SUCCESS)
|
||||
return ret;
|
||||
|
||||
|
@ -601,8 +603,8 @@ int flash_start_flashing(int enable_bl_writes, char *serial_port_name, uint32_t
|
|||
}
|
||||
|
||||
// Reboot into bootloader
|
||||
int flash_reboot_bootloader(char *serial_port_name) {
|
||||
return enter_bootloader(serial_port_name);
|
||||
int flash_reboot_bootloader(char *serial_port_name, bool wait_appear) {
|
||||
return enter_bootloader(serial_port_name, wait_appear);
|
||||
}
|
||||
|
||||
static int write_block(uint32_t address, uint8_t *data, uint32_t length) {
|
||||
|
|
|
@ -44,7 +44,7 @@ typedef struct {
|
|||
int flash_load(flash_file_t *ctx, bool force);
|
||||
int flash_prepare(flash_file_t *ctx, int can_write_bl, int flash_size);
|
||||
int flash_start_flashing(int enable_bl_writes, char *serial_port_name, uint32_t *max_allowed);
|
||||
int flash_reboot_bootloader(char *serial_port_name);
|
||||
int flash_reboot_bootloader(char *serial_port_name, bool wait_appear);
|
||||
int flash_write(flash_file_t *ctx);
|
||||
void flash_free(flash_file_t *ctx);
|
||||
int flash_stop_flashing(void);
|
||||
|
|
|
@ -733,7 +733,7 @@ static int reboot_bootloader_pm3(char *serial_port_name) {
|
|||
}
|
||||
|
||||
PrintAndLogEx(NORMAL, _GREEN_(" found"));
|
||||
return flash_reboot_bootloader(serial_port_name);
|
||||
return flash_reboot_bootloader(serial_port_name, true);
|
||||
}
|
||||
|
||||
#endif //LIBPM3
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue