1 //-----------------------------------------------------------------------------
2 // Copyright (C) Proxmark3 contributors. See AUTHORS.md for details.
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // See LICENSE.txt for the text of the license.
15 //-----------------------------------------------------------------------------
16 // Low frequency EM4x50 structs
17 //-----------------------------------------------------------------------------
23 #include "bruteforce.h"
25 #define EM4X50_NO_WORDS 34
26 #define EM4X50_SIZE_WORD 4
29 #define EM4X50_DEVICE_PASSWORD 0
30 #define EM4X50_PROTECTION 1
31 #define EM4X50_CONTROL 2
32 #define EM4X50_DEVICE_SERIAL 32
33 #define EM4X50_DEVICE_ID 33
35 // control word (word = 4 bytes)
36 #define FIRST_WORD_READ 0 // first byte
37 #define LAST_WORD_READ 1 // second byte
38 #define CONFIG_BLOCK 2 // third byte
39 #define PASSWORD_CHECK 0x80 // first bit in third byte
40 #define READ_AFTER_WRITE 0x40 // second bit in third byte
43 #define FIRST_WORD_READ_PROTECTED 0 // first byte
44 #define LAST_WORD_READ_PROTECTED 1 // second byte
45 #define FIRST_WORD_WRITE_INHIBITED 2 // third byte
46 #define LAST_WORD_WRITE_INHIBITED 3 // fourth byte
49 #define EM4X50_COMMAND_LOGIN 0x01
50 #define EM4X50_COMMAND_RESET 0x80
51 #define EM4X50_COMMAND_WRITE 0x12
52 #define EM4X50_COMMAND_WRITE_PASSWORD 0x11
53 #define EM4X50_COMMAND_SELECTIVE_READ 0x0A
54 #define EM4X50_COMMAND_STANDARD_READ 0x02 // virtual command
57 #define EM4X50_TIMEOUT_CMD 3000
58 #define EM4X50_DUMP_FILESIZE 136
67 bruteforce_mode_t bruteforce_mode
;
68 bruteforce_charset_t bruteforce_charset
;
69 } PACKED em4x50_data_t
;
73 } PACKED em4x50_word_t
;
78 } PACKED em4x50_read_data_response_t
;
80 // Global variables...
82 extern bool g_WritePasswordProcess
;
83 extern uint32_t g_Password
;
85 #endif /* EM4X50_H__ */