mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-03-19 11:33:51 +08:00
fixes
This commit is contained in:
parent
e8015142cd
commit
195102e9ae
12 changed files with 38 additions and 33 deletions
|
@ -521,13 +521,13 @@ int CmdAnalyseHid(const char *Cmd){
|
|||
uint8_t key_std_format[8] = {0};
|
||||
uint8_t key_iclass_format[8] = {0};
|
||||
uint8_t data[16] = {0};
|
||||
bool isReverse = FALSE;
|
||||
bool isReverse = false;
|
||||
int len = 0;
|
||||
char cmdp = param_getchar(Cmd, 0);
|
||||
if (strlen(Cmd) == 0|| cmdp == 'h' || cmdp == 'H') return usage_analyse_hid();
|
||||
|
||||
if ( cmdp == 'r' || cmdp == 'R' )
|
||||
isReverse = TRUE;
|
||||
isReverse = true;
|
||||
|
||||
param_gethex_ex(Cmd, 1, data, &len);
|
||||
if ( len%2 ) return usage_analyse_hid();
|
||||
|
|
|
@ -604,13 +604,13 @@ int Cmdaskmandemod(const char *Cmd)
|
|||
char cmdp = param_getchar(Cmd, 0);
|
||||
if (strlen(Cmd) > 45 || cmdp == 'h' || cmdp == 'H') return usage_data_rawdemod_am();
|
||||
|
||||
bool st = TRUE;
|
||||
bool st = true;
|
||||
if (Cmd[0]=='s')
|
||||
return ASKDemod_ext(Cmd++, TRUE, TRUE, 1, &st);
|
||||
return ASKDemod_ext(Cmd++, true, true, 1, &st);
|
||||
else if (Cmd[1] == 's')
|
||||
return ASKDemod_ext(Cmd+=2, TRUE, TRUE, 1, &st);
|
||||
return ASKDemod_ext(Cmd+=2, true, true, 1, &st);
|
||||
|
||||
return ASKDemod(Cmd, TRUE, TRUE, 1);
|
||||
return ASKDemod(Cmd, true, true, 1);
|
||||
}
|
||||
|
||||
//by marshmellow
|
||||
|
@ -857,7 +857,7 @@ int Cmdaskrawdemod(const char *Cmd)
|
|||
char cmdp = param_getchar(Cmd, 0);
|
||||
if (strlen(Cmd) > 25 || cmdp == 'h' || cmdp == 'H') return usage_data_rawdemod_ar();
|
||||
|
||||
return ASKDemod(Cmd, TRUE, FALSE, 0);
|
||||
return ASKDemod(Cmd, true, false, 0);
|
||||
}
|
||||
|
||||
int AutoCorrelate(int window, bool SaveGrph, bool verbose)
|
||||
|
@ -910,7 +910,7 @@ int CmdAutoCorr(const char *Cmd)
|
|||
if (cmdp == 'h' || cmdp == 'H') return usage_data_autocorr();
|
||||
int window = 4000; //set default
|
||||
char grph = 0;
|
||||
bool updateGrph = FALSE;
|
||||
bool updateGrph = false;
|
||||
sscanf(Cmd, "%i %c", &window, &grph);
|
||||
|
||||
if (window >= GraphTraceLen) {
|
||||
|
@ -955,10 +955,9 @@ int CmdBuffClear(const char *Cmd)
|
|||
|
||||
int CmdDec(const char *Cmd)
|
||||
{
|
||||
for (int i = 0; i < (GraphTraceLen >> 2); ++i)
|
||||
for (int i = 0; i < (GraphTraceLen / 2); ++i)
|
||||
GraphBuffer[i] = GraphBuffer[i * 2];
|
||||
|
||||
GraphTraceLen >>= 2;
|
||||
GraphTraceLen /= 2;
|
||||
PrintAndLog("decimated by 2");
|
||||
RepaintGraphWindow();
|
||||
return 0;
|
||||
|
@ -1968,7 +1967,7 @@ int CmdNRZrawDemod(const char *Cmd)
|
|||
char cmdp = param_getchar(Cmd, 0);
|
||||
if (strlen(Cmd) > 16 || cmdp == 'h' || cmdp == 'H') return usage_data_rawdemod_nr();
|
||||
|
||||
return NRZrawDemod(Cmd, TRUE);
|
||||
return NRZrawDemod(Cmd, true);
|
||||
}
|
||||
|
||||
// by marshmellow
|
||||
|
@ -1981,7 +1980,7 @@ int CmdPSK1rawDemod(const char *Cmd)
|
|||
char cmdp = param_getchar(Cmd, 0);
|
||||
if (strlen(Cmd) > 16 || cmdp == 'h' || cmdp == 'H') return usage_data_rawdemod_p1();
|
||||
|
||||
ans = PSKDemod(Cmd, TRUE);
|
||||
ans = PSKDemod(Cmd, true);
|
||||
//output
|
||||
if (!ans){
|
||||
if (g_debugMode) PrintAndLog("Error demoding: %d",ans);
|
||||
|
@ -2001,7 +2000,7 @@ int CmdPSK2rawDemod(const char *Cmd)
|
|||
char cmdp = param_getchar(Cmd, 0);
|
||||
if (strlen(Cmd) > 16 || cmdp == 'h' || cmdp == 'H') return usage_data_rawdemod_p2();
|
||||
|
||||
ans = PSKDemod(Cmd, TRUE);
|
||||
ans = PSKDemod(Cmd, true);
|
||||
if (!ans){
|
||||
if (g_debugMode) PrintAndLog("Error demoding: %d",ans);
|
||||
return 0;
|
||||
|
|
|
@ -221,10 +221,10 @@ int CmdHF14BCmdRaw (const char *Cmd) {
|
|||
bool success = true;
|
||||
// get back iso14b_card_select_t, don't print it.
|
||||
if (select)
|
||||
success = waitCmd(FALSE);
|
||||
success = waitCmd(false);
|
||||
|
||||
// get back response from the raw bytes you sent.
|
||||
if (success && datalen>0) waitCmd(TRUE);
|
||||
if (success && datalen>0) waitCmd(true);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -831,7 +831,7 @@ int HFLegicReader(const char *Cmd, bool verbose) {
|
|||
return 0;
|
||||
}
|
||||
int CmdLegicReader(const char *Cmd){
|
||||
return HFLegicReader(Cmd, TRUE);
|
||||
return HFLegicReader(Cmd, true);
|
||||
}
|
||||
|
||||
int CmdLegicDump(const char *Cmd){
|
||||
|
@ -1267,4 +1267,4 @@ int CmdHFLegic(const char *Cmd) {
|
|||
int CmdHelp(const char *Cmd) {
|
||||
CmdsHelp(CommandTable);
|
||||
return 0;
|
||||
}
|
||||
}
|
|
@ -101,7 +101,7 @@ static bool sendTry(uint8_t fmtlen, uint32_t fc, uint32_t cn, uint32_t delay, ui
|
|||
PrintAndLog("Trying FC: %u; CN: %u", fc, cn);
|
||||
if ( !getAWIDBits(fmtlen, fc, cn, bs)) {
|
||||
PrintAndLog("Error with tag bitstream generation.");
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
uint64_t arg1 = (10<<8) + 8; // fcHigh = 10, fcLow = 8
|
||||
|
@ -112,7 +112,7 @@ static bool sendTry(uint8_t fmtlen, uint32_t fc, uint32_t cn, uint32_t delay, ui
|
|||
SendCommand(&c);
|
||||
msleep(delay);
|
||||
sendPing();
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
int CmdAWIDDemodFSK(const char *Cmd) {
|
||||
|
|
|
@ -97,7 +97,7 @@ static bool sendTry(uint8_t fmtlen, uint32_t fc, uint32_t cn, uint32_t delay, ui
|
|||
SendCommand(&c);
|
||||
msleep(delay);
|
||||
sendPing();
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
int CmdHIDDemodFSK(const char *Cmd) {
|
||||
|
@ -393,11 +393,11 @@ int CmdHIDBrute(const char *Cmd){
|
|||
case 'A':
|
||||
fmtlen = param_get8(Cmd, cmdp+1);
|
||||
cmdp += 2;
|
||||
bool is_ftm_ok = FALSE;
|
||||
bool is_ftm_ok = false;
|
||||
uint8_t ftms[] = {26,33,34,35,37};
|
||||
for ( uint8_t i = 0; i < sizeof(ftms); i++){
|
||||
if ( ftms[i] == fmtlen ) {
|
||||
is_ftm_ok = TRUE;
|
||||
is_ftm_ok = true;
|
||||
}
|
||||
}
|
||||
// negated
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
// at your option, any later version. See the LICENSE.txt file for the text of
|
||||
// the license.
|
||||
//-----------------------------------------------------------------------------
|
||||
// Low frequency Presco tag commands
|
||||
// Low frequency Jablotron tag commands
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include "cmdlfjablotron.h"
|
||||
|
@ -74,7 +74,7 @@ int CmdJablotronDemod(const char *Cmd) {
|
|||
|
||||
//Differential Biphase / di-phase (inverted biphase)
|
||||
//get binary from ask wave
|
||||
if (!ASKbiphaseDemod("0 64 1 0", FALSE)) {
|
||||
if (!ASKbiphaseDemod("0 64 1 0", false)) {
|
||||
if (g_debugMode) PrintAndLog("DEBUG: Error - Jablotron ASKbiphaseDemod failed");
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -84,7 +84,7 @@ int GetNedapBits(uint32_t cn, uint8_t *nedapBits) {
|
|||
|
||||
int CmdLFNedapDemod(const char *Cmd) {
|
||||
//raw ask demod no start bit finding just get binary from wave
|
||||
if (!ASKbiphaseDemod("0 64 0 0", FALSE)) {
|
||||
if (!ASKbiphaseDemod("0 64 0 0", false)) {
|
||||
if (g_debugMode) PrintAndLog("DEBUG: Error - Nedap ASKbiphaseDemod failed");
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
// the license.
|
||||
//-----------------------------------------------------------------------------
|
||||
// Low frequency Noralsy tag commands
|
||||
// ASK/Manchester, STT, RF/32, 96 bits long (some bits unknown)
|
||||
//-----------------------------------------------------------------------------
|
||||
#include "cmdlfnoralsy.h"
|
||||
|
||||
|
@ -73,13 +74,14 @@ int getnoralsyBits(uint32_t id, uint16_t year, uint8_t *bits) {
|
|||
|
||||
/*
|
||||
*
|
||||
* 2520116 | BB0314FF2529900116360000 | 10111011 00000011 00010100 11111111 00100101 00101001 10010000 00000001 00010110 00110110 00000000 00000000
|
||||
* aaaaaaaaiii***iiiicc---- iiiiiiii iiiiYYYY YYYY**** iiiiiiii iiiiiiii cccccccc
|
||||
* 2520116 | BB0214FF2529900116360000 | 10111011 00000011 00010100 11111111 00100101 00101001 10010000 00000001 00010110 00110110 00000000 00000000
|
||||
* aaa*aaaaiiiYY*iiiicc---- **** iiiiiiii iiiiYYYY YYYY**** iiiiiiii iiiiiiii cccccccc
|
||||
*
|
||||
* a = fixed value BB0314FF
|
||||
* a = fixed value BB0*14FF
|
||||
* i = printed id, BCD-format
|
||||
* Y = year
|
||||
* c = checksum
|
||||
* * = unknown
|
||||
*
|
||||
**/
|
||||
|
||||
|
@ -88,10 +90,12 @@ int CmdNoralsyDemod(const char *Cmd) {
|
|||
|
||||
//ASK / Manchester
|
||||
bool st = true;
|
||||
if (!ASKDemod_ext("32 0 0", FALSE, FALSE, 1, &st)) {
|
||||
if (!ASKDemod_ext("32 0 0", false, false, 1, &st)) {
|
||||
if (g_debugMode) PrintAndLog("DEBUG: Error - Noralsy: ASK/Manchester Demod failed");
|
||||
return 0;
|
||||
}
|
||||
if (!st) return 0;
|
||||
|
||||
size_t size = DemodBufferLen;
|
||||
int ans = NoralsyDemod_AM(DemodBuffer, &size);
|
||||
if (ans < 0){
|
||||
|
|
|
@ -112,7 +112,7 @@ int GetPrescoBits(uint32_t fullcode, uint8_t *prescoBits) {
|
|||
//see ASKDemod for what args are accepted
|
||||
int CmdPrescoDemod(const char *Cmd) {
|
||||
bool st = true;
|
||||
if (!ASKDemod_ext("32 0 0 0 0 a", FALSE, FALSE, 1, &st)) {
|
||||
if (!ASKDemod_ext("32 0 0 0 0 a", false, false, 1, &st)) {
|
||||
if (g_debugMode) PrintAndLog("DEBUG: Error Presco ASKDemod failed");
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
// the license.
|
||||
//-----------------------------------------------------------------------------
|
||||
// Low frequency Farpoint / Pyramid tag commands
|
||||
// FSK2a, rf/50, 128 bits (complete)
|
||||
//-----------------------------------------------------------------------------
|
||||
#include <string.h>
|
||||
#include <inttypes.h>
|
||||
|
@ -14,7 +15,7 @@ static int CmdHelp(const char *Cmd);
|
|||
int usage_lf_pyramid_clone(void){
|
||||
PrintAndLog("clone a Farpointe/Pyramid tag to a T55x7 tag.");
|
||||
PrintAndLog("The facility-code is 8-bit and the card number is 16-bit. Larger values are truncated. ");
|
||||
PrintAndLog("Currently work only on 26bit");
|
||||
PrintAndLog("Currently only works on 26bit");
|
||||
PrintAndLog("");
|
||||
PrintAndLog("Usage: lf pyramid clone <Facility-Code> <Card-Number>");
|
||||
PrintAndLog("Options :");
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <inttypes.h>
|
||||
#include "crc16.h"
|
||||
#include "proxmark3.h"
|
||||
#include "data.h"
|
||||
|
@ -280,7 +281,7 @@ int CmdTIWrite(const char *Cmd)
|
|||
{
|
||||
int res = 0;
|
||||
UsbCommand c = {CMD_WRITE_TI_TYPE};
|
||||
res = sscanf(Cmd, "%012" SCNx64 " %012" SCNx64 " %012" SCNx64, &c.arg[0], &c.arg[1], &c.arg[2]);
|
||||
res = sscanf(Cmd, "%012" SCNx64 " %012" SCNx64 " %012" SCNx64 "", &c.arg[0], &c.arg[1], &c.arg[2]);
|
||||
|
||||
if (res == 2) c.arg[2]=0;
|
||||
if (res < 2) {
|
||||
|
|
Loading…
Add table
Reference in a new issue