Lines 1-86
Link Here
|
1 |
--- hydra-gtk/src/callbacks.c.orig 2011-04-30 22:28:12.000000000 +0400 |
|
|
2 |
+++ hydra-gtk/src/callbacks.c 2011-05-31 21:02:22.000000000 +0400 |
3 |
@@ -71,21 +71,6 @@ |
4 |
|
5 |
options[0] = HYDRA_BIN; |
6 |
|
7 |
- /* get the target, or target list */ |
8 |
- widget = lookup_widget(GTK_WIDGET(wndMain), "radioTarget1"); |
9 |
- if (gtk_toggle_button_get_active((GtkToggleButton *) widget)) { |
10 |
- widget = lookup_widget(GTK_WIDGET(wndMain), "entTarget"); |
11 |
- options[i++] = (char *) gtk_entry_get_text((GtkEntry *) widget); |
12 |
- } else { |
13 |
- options[i++] = "-M"; |
14 |
- widget = lookup_widget(GTK_WIDGET(wndMain), "entTargetFile"); |
15 |
- options[i++] = (char *) gtk_entry_get_text((GtkEntry *) widget); |
16 |
- } |
17 |
- |
18 |
- /* get the service */ |
19 |
- widget = lookup_widget(GTK_WIDGET(wndMain), "entProtocol"); |
20 |
- options[i++] = (char *) gtk_entry_get_text((GtkEntry *) widget); |
21 |
- |
22 |
/* get the port */ |
23 |
widget = lookup_widget(GTK_WIDGET(wndMain), "spnPort"); |
24 |
j = gtk_spin_button_get_value_as_int((GtkSpinButton *) widget); |
25 |
@@ -325,6 +310,21 @@ |
26 |
} |
27 |
} |
28 |
|
29 |
+ /* get the target, or target list */ |
30 |
+ widget = lookup_widget(GTK_WIDGET(wndMain), "radioTarget1"); |
31 |
+ if (gtk_toggle_button_get_active((GtkToggleButton *) widget)) { |
32 |
+ widget = lookup_widget(GTK_WIDGET(wndMain), "entTarget"); |
33 |
+ options[i++] = (char *) gtk_entry_get_text((GtkEntry *) widget); |
34 |
+ } else { |
35 |
+ options[i++] = "-M"; |
36 |
+ widget = lookup_widget(GTK_WIDGET(wndMain), "entTargetFile"); |
37 |
+ options[i++] = (char *) gtk_entry_get_text((GtkEntry *) widget); |
38 |
+ } |
39 |
+ |
40 |
+ /* get the service */ |
41 |
+ widget = lookup_widget(GTK_WIDGET(wndMain), "entProtocol"); |
42 |
+ options[i++] = (char *) gtk_entry_get_text((GtkEntry *) widget); |
43 |
+ |
44 |
options[i] = NULL; |
45 |
return i; |
46 |
} |
47 |
@@ -495,8 +495,8 @@ |
48 |
-1, -1}; |
49 |
static int *pfd = NULL; |
50 |
|
51 |
- hydra_pid = 0; |
52 |
char *options[128]; |
53 |
+ hydra_pid = 0; |
54 |
|
55 |
update_statusbar(); |
56 |
|
57 |
@@ -517,6 +517,7 @@ |
58 |
g_warning("popen_rw_unbuffered: Error forking!"); |
59 |
return NULL; |
60 |
} else if (hydra_pid == 0) { /* child */ |
61 |
+ int k; |
62 |
if (setpgid(getpid(), getpid()) < 0) |
63 |
g_warning("popen_rw_unbuffered: setpgid() failed"); |
64 |
if (close(p_r[0]) < 0) |
65 |
@@ -540,8 +541,7 @@ |
66 |
execv(HYDRA_BIN, options); |
67 |
|
68 |
g_warning("%s %i: popen_rw_unbuffered: execv() returned", __FILE__, __LINE__); |
69 |
- int k; |
70 |
- |
71 |
+ |
72 |
for (k = 0; options[k] != NULL; k++) { |
73 |
g_warning("%s", options[k]); |
74 |
} |
75 |
@@ -667,8 +667,9 @@ |
76 |
|
77 |
void |
78 |
on_chkColon_toggled(GtkToggleButton * togglebutton, gpointer user_data) { |
79 |
- GtkWidget *user = lookup_widget(GTK_WIDGET(wndMain), "frmUsername");; |
80 |
- GtkWidget *pass = lookup_widget(GTK_WIDGET(wndMain), "frmPass"); |
81 |
+ GtkWidget *user, *pass; |
82 |
+ user = lookup_widget(GTK_WIDGET(wndMain), "frmUsername"); |
83 |
+ pass = lookup_widget(GTK_WIDGET(wndMain), "frmPass"); |
84 |
|
85 |
if (gtk_toggle_button_get_active(togglebutton)) { |
86 |
gtk_widget_set_sensitive(user, FALSE); |