mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-07-06 04:51:36 -07:00
Allow image conversion when offline
This commit is contained in:
parent
572bdbf727
commit
d27669f22c
4 changed files with 17 additions and 3 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -80,6 +80,7 @@ tools/jtag_openocd/openocd_configuration
|
|||
tools/mfd_aes_brute/mfd_aes_brute
|
||||
tools/mfd_aes_brute/mfd_multi_brute
|
||||
tools/mfd_aes_brute/brute_key
|
||||
!tools/lena.bmp
|
||||
|
||||
fpga/__build*
|
||||
|
||||
|
|
|
@ -618,6 +618,10 @@ static int CmdHF14AWSLoad(const char *Cmd) {
|
|||
PrintAndLogEx(WARNING, "Unknown model");
|
||||
return PM3_EINVARG;
|
||||
}
|
||||
if (!g_session.pm3_present && !outfilelen) {
|
||||
PrintAndLogEx(WARNING, "Offline - can only perform image conversion");
|
||||
return PM3_ENOTTY;
|
||||
}
|
||||
|
||||
bool model_has_red = model_nr == M1in54B || model_nr == M2in13B;
|
||||
|
||||
|
@ -653,8 +657,16 @@ static int CmdHF14AWSLoad(const char *Cmd) {
|
|||
return PM3_EMALLOC;
|
||||
}
|
||||
|
||||
if (outfilelen && !gdImageFile(pal_img, outfile)) {
|
||||
PrintAndLogEx(WARNING, "Could not save converted image");
|
||||
if (outfilelen) {
|
||||
if (gdImageFile(pal_img, outfile)) {
|
||||
PrintAndLogEx(INFO, "Save converted image to " _YELLOW_("%s"), outfile);
|
||||
gdImageDestroy(pal_img);
|
||||
return PM3_SUCCESS;
|
||||
} else {
|
||||
PrintAndLogEx(WARNING, "Could not save converted image", outfile);
|
||||
gdImageDestroy(pal_img);
|
||||
return PM3_EFILE;
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t * black_plane = map8to1(pal_img, 1);
|
||||
|
@ -684,7 +696,7 @@ static int CmdHF14AWSLoad(const char *Cmd) {
|
|||
|
||||
static command_t CommandTable[] = {
|
||||
{"help", CmdHelp, AlwaysAvailable, "This help"},
|
||||
{"load", CmdHF14AWSLoad, IfPm3Iso14443a, "Load image file to Waveshare NFC ePaper"},
|
||||
{"load", CmdHF14AWSLoad, AlwaysAvailable, "Load image file to Waveshare NFC ePaper"},
|
||||
{NULL, NULL, NULL, NULL}
|
||||
};
|
||||
|
||||
|
|
BIN
tools/lena.bmp
Normal file
BIN
tools/lena.bmp
Normal file
Binary file not shown.
After Width: | Height: | Size: 117 KiB |
|
@ -535,6 +535,7 @@ while true; do
|
|||
if ! CheckExecute "emv test" "$CLIENTBIN -c 'emv test'" "Test\(s\) \[ ok"; then break; fi
|
||||
if ! CheckExecute "hf cipurse test" "$CLIENTBIN -c 'hf cipurse test'" "Tests \[ ok"; then break; fi
|
||||
if ! CheckExecute "hf mfdes test" "$CLIENTBIN -c 'hf mfdes test'" "Tests \[ ok"; then break; fi
|
||||
if ! CheckExecute "hf waveshare load" "$CLIENTBIN -c 'hf waveshare load -m 6 -f tools/lena.bmp -s dither.bmp' && echo '9cee7dcc285f59f88c7cbc9de1dc02b4 dither.bmp' | md5sum -c" "dither.bmp: OK"; then break; fi
|
||||
fi
|
||||
echo -e "\n------------------------------------------------------------"
|
||||
echo -e "Tests [ ${C_GREEN}OK${C_NC} ] ${C_OK}\n"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue