Merge remote-tracking branch 'upstream/master'
This commit is contained in:
@@ -596,8 +596,10 @@ int CmdLFSim(const char *Cmd) {
|
||||
// convert to bitstream if necessary
|
||||
ChkBitstream(Cmd);
|
||||
|
||||
if (g_debugMode)
|
||||
printf("DEBUG: Sending [%d bytes]\n", GraphTraceLen);
|
||||
|
||||
//can send only 512 bits at a time (1 byte sent per bit...)
|
||||
printf("Sending [%d bytes]", GraphTraceLen);
|
||||
for (i = 0; i < GraphTraceLen; i += USB_CMD_DATA_SIZE) {
|
||||
UsbCommand c = {CMD_DOWNLOADED_SIM_SAMPLES_125K, {i, 0, 0}};
|
||||
|
||||
@@ -606,11 +608,12 @@ int CmdLFSim(const char *Cmd) {
|
||||
}
|
||||
clearCommandBuffer();
|
||||
SendCommand(&c);
|
||||
WaitForResponse(CMD_ACK,NULL);
|
||||
WaitForResponse(CMD_ACK, NULL);
|
||||
printf(".");
|
||||
}
|
||||
|
||||
PrintAndLog("\nStarting to simulate");
|
||||
PrintAndLog("Starting to simulate");
|
||||
|
||||
UsbCommand c = {CMD_SIMULATE_TAG_125K, {GraphTraceLen, gap, 0}};
|
||||
clearCommandBuffer();
|
||||
SendCommand(&c);
|
||||
@@ -730,6 +733,7 @@ int CmdLFaskSim(const char *Cmd)
|
||||
|
||||
while(param_getchar(Cmd, cmdp) != 0x00) {
|
||||
switch(param_getchar(Cmd, cmdp)) {
|
||||
case 'H':
|
||||
case 'h': return usage_lf_simask();
|
||||
case 'i':
|
||||
invert = 1;
|
||||
@@ -788,7 +792,7 @@ int CmdLFaskSim(const char *Cmd)
|
||||
setDemodBuf(data, dataLen, 0);
|
||||
}
|
||||
if (clk == 0) clk = 64;
|
||||
if (encoding == 0) clk = clk/2; //askraw needs to double the clock speed
|
||||
if (encoding == 0) clk >>= 2; //askraw needs to double the clock speed
|
||||
|
||||
size_t size = DemodBufferLen;
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include <inttypes.h>
|
||||
#include "cmdlfem4x.h"
|
||||
|
||||
char *global_em410xId;
|
||||
uint64_t g_em410xid = 0;
|
||||
|
||||
static int CmdHelp(const char *Cmd);
|
||||
|
||||
@@ -47,11 +47,7 @@ int CmdEM410xRead(const char *Cmd)
|
||||
PrintAndLog ("EM410x XL pattern found");
|
||||
return 0;
|
||||
}
|
||||
char id[12] = {0x00};
|
||||
//sprintf(id, "%010llx",lo);
|
||||
sprintf(id, "%010"PRIu64, lo);
|
||||
|
||||
global_em410xId = id;
|
||||
g_em410xid = lo;
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -59,10 +55,9 @@ int CmdEM410xRead(const char *Cmd)
|
||||
int CmdEM410xSim(const char *Cmd)
|
||||
{
|
||||
int i, n, j, binary[4], parity[4];
|
||||
|
||||
char cmdp = param_getchar(Cmd, 0);
|
||||
uint8_t uid[5] = {0x00};
|
||||
|
||||
char cmdp = param_getchar(Cmd, 0);
|
||||
if (cmdp == 'h' || cmdp == 'H') {
|
||||
PrintAndLog("Usage: lf em4x em410xsim <UID> <clock>");
|
||||
PrintAndLog("");
|
||||
@@ -81,46 +76,45 @@ int CmdEM410xSim(const char *Cmd)
|
||||
PrintAndLog("Starting simulating UID %02X%02X%02X%02X%02X clock: %d", uid[0],uid[1],uid[2],uid[3],uid[4],clock);
|
||||
PrintAndLog("Press pm3-button to about simulation");
|
||||
|
||||
|
||||
/* clear our graph */
|
||||
ClearGraph(0);
|
||||
|
||||
/* write 9 start bits */
|
||||
for (i = 0; i < 9; i++)
|
||||
AppendGraph(0, clock, 1);
|
||||
/* write 9 start bits */
|
||||
for (i = 0; i < 9; i++)
|
||||
AppendGraph(0, clock, 1);
|
||||
|
||||
/* for each hex char */
|
||||
parity[0] = parity[1] = parity[2] = parity[3] = 0;
|
||||
for (i = 0; i < 10; i++)
|
||||
{
|
||||
/* read each hex char */
|
||||
sscanf(&Cmd[i], "%1x", &n);
|
||||
for (j = 3; j >= 0; j--, n/= 2)
|
||||
binary[j] = n % 2;
|
||||
/* for each hex char */
|
||||
parity[0] = parity[1] = parity[2] = parity[3] = 0;
|
||||
for (i = 0; i < 10; i++)
|
||||
{
|
||||
/* read each hex char */
|
||||
sscanf(&Cmd[i], "%1x", &n);
|
||||
for (j = 3; j >= 0; j--, n/= 2)
|
||||
binary[j] = n % 2;
|
||||
|
||||
/* append each bit */
|
||||
AppendGraph(0, clock, binary[0]);
|
||||
AppendGraph(0, clock, binary[1]);
|
||||
AppendGraph(0, clock, binary[2]);
|
||||
AppendGraph(0, clock, binary[3]);
|
||||
/* append each bit */
|
||||
AppendGraph(0, clock, binary[0]);
|
||||
AppendGraph(0, clock, binary[1]);
|
||||
AppendGraph(0, clock, binary[2]);
|
||||
AppendGraph(0, clock, binary[3]);
|
||||
|
||||
/* append parity bit */
|
||||
AppendGraph(0, clock, binary[0] ^ binary[1] ^ binary[2] ^ binary[3]);
|
||||
/* append parity bit */
|
||||
AppendGraph(0, clock, binary[0] ^ binary[1] ^ binary[2] ^ binary[3]);
|
||||
|
||||
/* keep track of column parity */
|
||||
parity[0] ^= binary[0];
|
||||
parity[1] ^= binary[1];
|
||||
parity[2] ^= binary[2];
|
||||
parity[3] ^= binary[3];
|
||||
}
|
||||
/* keep track of column parity */
|
||||
parity[0] ^= binary[0];
|
||||
parity[1] ^= binary[1];
|
||||
parity[2] ^= binary[2];
|
||||
parity[3] ^= binary[3];
|
||||
}
|
||||
|
||||
/* parity columns */
|
||||
AppendGraph(0, clock, parity[0]);
|
||||
AppendGraph(0, clock, parity[1]);
|
||||
AppendGraph(0, clock, parity[2]);
|
||||
AppendGraph(0, clock, parity[3]);
|
||||
/* parity columns */
|
||||
AppendGraph(0, clock, parity[0]);
|
||||
AppendGraph(0, clock, parity[1]);
|
||||
AppendGraph(0, clock, parity[2]);
|
||||
AppendGraph(0, clock, parity[3]);
|
||||
|
||||
/* stop bit */
|
||||
/* stop bit */
|
||||
AppendGraph(1, clock, 0);
|
||||
|
||||
CmdLFSim("0"); //240 start_gap.
|
||||
@@ -152,10 +146,12 @@ int CmdEM410xWatch(const char *Cmd)
|
||||
}
|
||||
|
||||
//currently only supports manchester modulations
|
||||
// todo: helptext
|
||||
int CmdEM410xWatchnSpoof(const char *Cmd)
|
||||
{
|
||||
// loops if the captured ID was in XL-format.
|
||||
CmdEM410xWatch(Cmd);
|
||||
PrintAndLog("# Replaying captured ID: %s",global_em410xId);
|
||||
PrintAndLog("# Replaying captured ID: %llu", g_em410xid);
|
||||
CmdLFaskSim("");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -246,4 +246,42 @@ c2b7ec7d4eb1,
|
||||
71f3a315ad26,
|
||||
51044efb5aab,
|
||||
ac70ca327a04,
|
||||
eb0a8ff88ade
|
||||
eb0a8ff88ade,
|
||||
#
|
||||
# Data from: https://github.com/RadioWar/NFCGUI
|
||||
44dd5a385aaf,
|
||||
21a600056cb0,
|
||||
b1aca33180a5,
|
||||
dd61eb6bce22,
|
||||
1565a172770f,
|
||||
3e84d2612e2a,
|
||||
f23442436765,
|
||||
79674f96c771,
|
||||
87df99d496cb,
|
||||
c5132c8980bc,
|
||||
a21680c27773,
|
||||
f26e21edcee2,
|
||||
675557ecc92e,
|
||||
f4396e468114,
|
||||
6db17c16b35b,
|
||||
4186562a5bb2,
|
||||
2feae851c199,
|
||||
db1a3338b2eb,
|
||||
157b10d84c6b,
|
||||
a643f952ea57,
|
||||
df37dcb6afb3,
|
||||
4c32baf326e0,
|
||||
91ce16c07ac5,
|
||||
3c5d1c2bcd18,
|
||||
c3f19ec592a2,
|
||||
f72a29005459,
|
||||
185fa3438949,
|
||||
321a695bd266,
|
||||
d327083a60a7,
|
||||
45635ef66ef3,
|
||||
5481986d2d62,
|
||||
cba6ae869ad5,
|
||||
645a166b1eeb,
|
||||
a7abbc77cc9e,
|
||||
f792c4c76a5c,
|
||||
bfb6796a11db
|
||||
@@ -370,6 +370,45 @@ local _keys = {
|
||||
--]]
|
||||
'668770666644',
|
||||
'003003003003',
|
||||
--[[
|
||||
Data from: https://github.com/RadioWar/NFCGUI
|
||||
--]]
|
||||
'44dd5a385aaf',
|
||||
'21a600056cb0',
|
||||
'b1aca33180a5',
|
||||
'dd61eb6bce22',
|
||||
'1565a172770f',
|
||||
'3e84d2612e2a',
|
||||
'f23442436765',
|
||||
'79674f96c771',
|
||||
'87df99d496cb',
|
||||
'c5132c8980bc',
|
||||
'a21680c27773',
|
||||
'f26e21edcee2',
|
||||
'675557ecc92e',
|
||||
'f4396e468114',
|
||||
'6db17c16b35b',
|
||||
'4186562a5bb2',
|
||||
'2feae851c199',
|
||||
'db1a3338b2eb',
|
||||
'157b10d84c6b',
|
||||
'a643f952ea57',
|
||||
'df37dcb6afb3',
|
||||
'4c32baf326e0',
|
||||
'91ce16c07ac5',
|
||||
'3c5d1c2bcd18',
|
||||
'c3f19ec592a2',
|
||||
'f72a29005459',
|
||||
'185fa3438949',
|
||||
'321a695bd266',
|
||||
'd327083a60a7',
|
||||
'45635ef66ef3',
|
||||
'5481986d2d62',
|
||||
'cba6ae869ad5',
|
||||
'645a166b1eeb',
|
||||
'a7abbc77cc9e',
|
||||
'f792c4c76a5c',
|
||||
'bfb6796a11db',
|
||||
}
|
||||
|
||||
---
|
||||
|
||||
@@ -4,8 +4,6 @@ local cmds = require('commands')
|
||||
|
||||
example = "script run mifare_autopwn"
|
||||
author = "Martin Holst Swende"
|
||||
|
||||
|
||||
desc =
|
||||
[[
|
||||
This is a which automates cracking and dumping mifare classic cards. It sets itself into
|
||||
|
||||
Reference in New Issue
Block a user