Debian Codegraph @

src/core/fsm.h

raw symbols SCIP
1 /*
2 *
3 * Ophcrack is a Lanmanager/NTLM hash cracker based on the faster time-memory
4 * trade-off using rainbow tables.
5 *
6 * Created with the help of: Maxime Mueller, Luca Wullschleger, Claude
7 * Hochreutiner, Andreas Huber and Etienne Dysli.
8 *
9 * Copyright (c) 2008 Philippe Oechslin, Cedric Tissieres, Bertrand Mesot
10 *
11 * Ophcrack is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * Ophcrack is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with Ophcrack; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 *
25 * This program is released under the GPL with the additional exemption
26 * that compiling, linking, and/or using OpenSSL is allowed.
27 *
28 *
29 *
30 *
31 */
32 #ifndef STATE_H
33 #define STATE_H
34
35 #include <stdint.h>
36
37 #include "ophcrack.h"
38 #include "message.h"
39 #include "arg.h"
40
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44
45 typedef enum { st_wait = 0x01,
46 st_pause1 = 0x02,
47 st_pause2 = 0x04,
48 st_start = 0x08,
49 st_preload = 0x10,
50 st_work1 = 0x20,
51 st_work2 = 0x40 } state_t;
52
53 typedef struct fsm_t_ {
54 state_t oldstate;
55 state_t state;
56
57 ophcrack_t *crack;
58 arg_t *arg;
59
60 int preload;
61 int bforce;
62 int pwait;
63 int ssave;
64
65 uint64_t psize_curr;
66 uint64_t psize_total;
67 uint64_t bforce_curr;
68 uint64_t bforce_total;
69
70 list_t *pending_msg;
71 list_t *htoremove;
72 } fsm_t;
73
74 fsm_t *fsm_alloc(ophcrack_t *ophcrack);
75
76 message_t *fsm_next(fsm_t *fsm, message_t *msg);
77
78 void fsm_handle_start(fsm_t *fsm);
79 message_t *fsm_handle_preload(fsm_t *fsm, message_t *msg);
80 message_t *fsm_handle_pause1(fsm_t *fsm, message_t *msg);
81 message_t *fsm_handle_pause2(fsm_t *fsm, message_t *msg);
82 message_t *fsm_handle_work1(fsm_t *fsm, message_t *msg);
83 message_t *fsm_handle_work2(fsm_t *fsm, message_t *msg);
84
85 void fsm_reset_preload(fsm_t *fsm);
86 void fsm_reset_bforce(fsm_t *fsm);
87
88 void fsm_launch_preload(fsm_t *fsm);
89 void fsm_launch_bforce(fsm_t *fsm);
90
91 void fsm_ssave(fsm_t *fsm);
92 void fsm_pause(fsm_t *fsm);
93 void fsm_reset(fsm_t *fsm);
94
95 #ifdef __cplusplus
96 }
97 #endif
98 #endif