-
Notifications
You must be signed in to change notification settings - Fork 127
Expand file tree
/
Copy pathlogitacker.h
More file actions
83 lines (52 loc) · 2.97 KB
/
logitacker.h
File metadata and controls
83 lines (52 loc) · 2.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#ifndef LOGITACKER_H__
#define LOGITACKER_H__
#ifdef __cplusplus
extern "C" {
#endif
#include "app_usbd_types.h"
#include "app_usbd_hid.h"
#include "stdint.h"
#include "nrf_cli.h"
#include "nrf_esb_illegalmod.h"
#include "logitacker_keyboard_map.h"
#include "logitacker_processor_covert_channel.h"
#define VERSION_STRING "v0.2.3-beta"
//#define PAIRING_REQ_MARKER_BYTE 0xee // byte used as device ID in pairing requests
#define ACTIVE_ENUM_INNER_LOOP_MAX 20 //how many CAPS presses / key releases get send
#define ACTIVE_ENUM_TX_DELAY_MS 2 //delay in ms between successful transmits in active enum mode (below 8 ms re-tx delay of real devices, to allow collecting ack payloads before device does)
#define LOGITACKER_DISCOVERY_STAY_ON_CHANNEL_AFTER_RX_MS 500 // time in ms to stop channel hopping in discovery mode, once a valid ESB frame is received
#define LOGITACKER_DISCOVERY_CHANNEL_HOP_INTERVAL_MS 50 // channel hop interval in discovery mode
#define LOGITACKER_PASSIVE_ENUM_STAY_ON_CHANNEL_AFTER_RX_MS 1300 // time in ms to stop channel hopping in passive mode, once a valid ESB frame is received
#define LOGITACKER_PASSIVE_ENUM_CHANNEL_HOP_INTERVAL_MS 30 // channel hop interval in passive enum mode
#define LOGITACKER_PRX_STAY_ON_CHANNEL_AFTER_RX_MS 1300 // time in ms to stop channel hopping in passive mode, once a valid ESB frame is received
#define LOGITACKER_PRX_ENUM_CHANNEL_HOP_INTERVAL_MS 30 // channel hop interval in passive enum mode
#define LOGITACKER_SNIFF_PAIR_STAY_ON_CHANNEL_AFTER_RX_MS 1300
#define LOGITACKER_SNIFF_PAIR_CHANNEL_HOP_INTERVAL_MS 10
typedef enum {
LOGITACKER_MODE_DISCOVERY, // radio in promiscuous mode, logs devices
LOGITACKER_MODE_ACTIVE_ENUMERATION, // radio in PTX mode, actively collecting dongle info
LOGITACKER_MODE_COVERT_CHANNEL, // radio in PTX mode, actively collecting dongle info
LOGITACKER_MODE_PASSIVE_ENUMERATION, // radio in SNIFF mode, collecting device frames to determin caps
LOGITACKER_MODE_SNIFF_PAIRING,
LOGITACKER_MODE_PAIR_DEVICE,
LOGITACKER_MODE_PRX,
LOGITACKER_MODE_INJECT,
LOGITACKER_MODE_IDLE
} logitacker_mode_t;
extern char g_logitacker_cli_name[32];
uint32_t logitacker_init();
void logitacker_enter_mode_discovery();
void logitacker_enter_mode_prx(uint8_t *rf_address);
void logitacker_enter_mode_passive_enum(uint8_t *rf_address);
void logitacker_enter_mode_active_enum(uint8_t *rf_address);
void logitacker_enter_mode_covert_channel(uint8_t *rf_address, nrf_cli_t const * p_cli);
void logitacker_enter_mode_pair_device(uint8_t const *rf_address);
void logitacker_enter_mode_pair_sniff();
void logitacker_enter_mode_injection(uint8_t const *rf_address);
void logitacker_injection_start_execution(bool execute);
void main_usbd_hid_keyboard_event_handler(app_usbd_class_inst_t const *p_inst, app_usbd_hid_user_event_t event); //for pass-through in logitacker_usb.c
uint32_t logitacker_covert_channel_push_data(covert_channel_payload_data_t const * p_tx_data);
#ifdef __cplusplus
}
#endif
#endif