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
|
--- a/hydra-gtk/src/callbacks.c
+++ b/hydra-gtk/src/callbacks.c
@@ -66,7 +66,7 @@ int hydra_get_options(char *options[]) {
gchar *tmp;
GString *a;
- options[0] = HYDRA_BIN;
+ options[0] = hydra_bin;
/* get the port */
widget = lookup_widget(GTK_WIDGET(wndMain), "spnPort");
@@ -599,7 +599,7 @@ int *popen_re_unbuffered(char *command) {
(void) hydra_get_options(options);
- execv(HYDRA_BIN, options);
+ execv(hydra_bin, options);
g_warning("%s %i: popen_rw_unbuffered: execv() returned", __FILE__, __LINE__);
--- a/hydra-gtk/src/main.c
+++ b/hydra-gtk/src/main.c
@@ -17,12 +17,12 @@
char *hydra_path1 = "./hydra";
char *hydra_path2 = "/usr/local/bin/hydra";
char *hydra_path3 = "/usr/bin/hydra";
-
+char *hydra_bin;
+GtkWidget *wndMain;
+guint message_id;
int main(int argc, char *argv[]) {
- extern GtkWidget *wndMain;
int i;
- extern guint message_id;
GtkWidget *output;
GtkTextBuffer *outputbuf;
@@ -35,22 +35,22 @@ int main(int argc, char *argv[]) {
message_id = 0;
/* locate the hydra binary */
- HYDRA_BIN = NULL;
+ hydra_bin = NULL;
for (i = 0; i < argc - 1; i++) {
if (!strcmp(argv[i], "--hydra-path")) {
- HYDRA_BIN = argv[i + 1];
+ hydra_bin = argv[i + 1];
break;
}
}
- if ((HYDRA_BIN != NULL) && (g_file_test(HYDRA_BIN, G_FILE_TEST_IS_EXECUTABLE))) {
+ if ((hydra_bin != NULL) && (g_file_test(hydra_bin, G_FILE_TEST_IS_EXECUTABLE))) {
/* just for obfuscation *g* */
} else if (g_file_test(hydra_path1, G_FILE_TEST_IS_EXECUTABLE)) {
- HYDRA_BIN = hydra_path1;
+ hydra_bin = hydra_path1;
} else if (g_file_test(hydra_path2, G_FILE_TEST_IS_EXECUTABLE)) {
- HYDRA_BIN = hydra_path2;
+ hydra_bin = hydra_path2;
} else if (g_file_test(hydra_path3, G_FILE_TEST_IS_EXECUTABLE)) {
- HYDRA_BIN = hydra_path3;
+ hydra_bin = hydra_path3;
} else {
g_error("Please tell me where hydra is, use --hydra-path\n");
return -1;
--- a/hydra-gtk/src/support.h
+++ b/hydra-gtk/src/support.h
@@ -40,6 +40,6 @@ GdkPixbuf *create_pixbuf(const gchar * filename);
void glade_set_atk_action_description(AtkAction * action, const gchar * action_name, const gchar * description);
-GtkWidget *wndMain;
-char *HYDRA_BIN;
-guint message_id;
+extern GtkWidget *wndMain;
+extern char *hydra_bin;
+extern guint message_id;
|