mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-01-22 16:09:53 +08:00
last update askip
This commit is contained in:
parent
c5aaa3f83f
commit
f7c4336645
3 changed files with 8 additions and 18 deletions
|
@ -24,6 +24,7 @@
|
|||
#include "cmdlft55xx.h" // clone..
|
||||
#include "cmdlfem4x05.h" //
|
||||
#include "cliparser.h"
|
||||
#include "util.h"
|
||||
|
||||
|
||||
typedef enum {
|
||||
|
@ -110,9 +111,8 @@ static int nexwatch_scamble(NexWatchScramble_t action, uint32_t *id, uint32_t *s
|
|||
}
|
||||
|
||||
static int nexwatch_magic_bruteforce(uint32_t cn, uint8_t calc_parity, uint8_t chk) {
|
||||
uint8_t magic = 0;
|
||||
for (uint8_t magic = 0; magic < 255; magic++) {
|
||||
uint8_t temp_checksum;
|
||||
for (; magic < 255; magic++) {
|
||||
temp_checksum = nexwatch_checksum(magic, cn, calc_parity);
|
||||
if (temp_checksum == chk) {
|
||||
PrintAndLogEx(SUCCESS, " Magic number : " _GREEN_("0x%X"), magic);
|
||||
|
@ -409,12 +409,14 @@ static int CmdNexWatchClone(const char *Cmd) {
|
|||
|
||||
if (use_psk2) {
|
||||
blocks[0] = 270464;
|
||||
uint8_t * res_shifted = malloc(96 * sizeof(uint8_t));
|
||||
uint8_t * res = byte_to_bytebits(raw, 12);
|
||||
uint8_t * res_shifted = calloc(96, sizeof(uint8_t));
|
||||
uint8_t * res = calloc(96, sizeof(uint8_t));
|
||||
bytes_to_bytebits(raw, 12, res);
|
||||
psk1TOpsk2(res, 96);
|
||||
memcpy(res_shifted, &res[1], 95 * sizeof(uint8_t));
|
||||
res_shifted[95] = 0;
|
||||
free(res);
|
||||
bits_to_array(res_shifted, 96, raw);
|
||||
free(res_shifted);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -295,17 +295,6 @@ int bits_to_array(const uint8_t *bits, size_t size, uint8_t *dest) {
|
|||
return PM3_SUCCESS;
|
||||
}
|
||||
|
||||
// Ex: 0x56 and numbytes = 1 ==> return res = {0,1,0,1,0,1,1,0}
|
||||
uint8_t * byte_to_bytebits(uint8_t * bits, size_t numbytes){
|
||||
uint8_t * result = malloc(numbytes * 8 * (sizeof(uint8_t)));
|
||||
for(int i=0;i<numbytes;i++){
|
||||
for(int j=0;j<8;j++){
|
||||
result[j + i*8] = ((bits[i] & 1<<(7-j))!=0);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
uint32_t bytebits_to_byte(uint8_t *src, size_t numbits) {
|
||||
uint32_t num = 0;
|
||||
for (int i = 0 ; i < numbits ; i++) {
|
||||
|
|
|
@ -48,7 +48,6 @@ int BiphaseRawDecode(uint8_t *bits, size_t *size, int *offset, int invert);
|
|||
int bits_to_array(const uint8_t *bits, size_t size, uint8_t *dest);
|
||||
uint32_t bytebits_to_byte(uint8_t *src, size_t numbits);
|
||||
uint32_t bytebits_to_byteLSBF(uint8_t *src, size_t numbits);
|
||||
uint8_t * byte_to_bytebits(uint8_t * bits, size_t numbits);
|
||||
uint16_t countFC(uint8_t *bits, size_t size, bool fskAdj);
|
||||
int DetectASKClock(uint8_t *dest, size_t size, int *clock, int maxErr);
|
||||
bool DetectCleanAskWave(uint8_t *dest, size_t size, uint8_t high, uint8_t low);
|
||||
|
|
Loading…
Reference in a new issue