mirror of
https://github.com/vanhauser-thc/thc-hydra.git
synced 2025-07-05 20:41:39 -07:00
big int to stdint switch
This commit is contained in:
parent
74931e3b58
commit
f124c26fc6
73 changed files with 1364 additions and 1235 deletions
26
hydra-irc.c
26
hydra-irc.c
|
@ -9,12 +9,12 @@ RFC 1459: Internet Relay Chat Protocol
|
|||
extern char *HYDRA_EXIT;
|
||||
char *buf;
|
||||
char buffer[300] = "";
|
||||
int myport = PORT_IRC, mysslport = PORT_IRC_SSL;
|
||||
int32_t myport = PORT_IRC, mysslport = PORT_IRC_SSL;
|
||||
|
||||
int start_oper_irc(int s, char *ip, int port, unsigned char options, char *miscptr, FILE * fp) {
|
||||
int32_t start_oper_irc(int32_t s, char *ip, int32_t port, unsigned char options, char *miscptr, FILE * fp) {
|
||||
char *empty = "";
|
||||
char *login, *pass;
|
||||
int ret;
|
||||
int32_t ret;
|
||||
|
||||
if (strlen(login = hydra_get_next_login()) == 0)
|
||||
login = empty;
|
||||
|
@ -42,7 +42,7 @@ int start_oper_irc(int s, char *ip, int port, unsigned char options, char *miscp
|
|||
return 2;
|
||||
}
|
||||
|
||||
int send_nick(int s, char *ip, char *pass) {
|
||||
int32_t send_nick(int32_t s, char *ip, char *pass) {
|
||||
if (strlen(pass) > 0) {
|
||||
sprintf(buffer, "PASS %s\r\n", pass);
|
||||
if (hydra_send(s, buffer, strlen(buffer), 0) < 0) {
|
||||
|
@ -53,14 +53,14 @@ int send_nick(int s, char *ip, char *pass) {
|
|||
if (hydra_send(s, buffer, strlen(buffer), 0) < 0) {
|
||||
return -1;
|
||||
}
|
||||
sprintf(buffer, "NICK hydra%d\r\nUSER hydra%d hydra %s :hydra\r\n", (int) getpid(), (int) getpid(), hydra_address2string(ip));
|
||||
sprintf(buffer, "NICK hydra%d\r\nUSER hydra%d hydra %s :hydra\r\n", (int32_t) getpid(), (int32_t) getpid(), hydra_address2string(ip));
|
||||
if (hydra_send(s, buffer, strlen(buffer), 0) < 0) {
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int irc_server_connect(char *ip, int sock, int port, unsigned char options, char *hostname) {
|
||||
int32_t irc_server_connect(char *ip, int32_t sock, int32_t port, unsigned char options, char *hostname) {
|
||||
if (sock >= 0)
|
||||
sock = hydra_disconnect(sock);
|
||||
// usleepn(275);
|
||||
|
@ -78,17 +78,17 @@ int irc_server_connect(char *ip, int sock, int port, unsigned char options, char
|
|||
return sock;
|
||||
}
|
||||
|
||||
int start_pass_irc(int s, char *ip, int port, unsigned char options, char *miscptr, FILE * fp, char *hostname) {
|
||||
int32_t start_pass_irc(int32_t s, char *ip, int32_t port, unsigned char options, char *miscptr, FILE * fp, char *hostname) {
|
||||
char *empty = "";
|
||||
char *pass;
|
||||
int ret;
|
||||
int32_t ret;
|
||||
|
||||
if (strlen(pass = hydra_get_next_password()) == 0)
|
||||
pass = empty;
|
||||
|
||||
s = irc_server_connect(ip, s, port, options, hostname);
|
||||
if (s < 0) {
|
||||
hydra_report(stderr, "[ERROR] Child with pid %d terminating, can not connect\n", (int) getpid());
|
||||
hydra_report(stderr, "[ERROR] Child with pid %d terminating, can not connect\n", (int32_t) getpid());
|
||||
return 3;
|
||||
}
|
||||
|
||||
|
@ -118,8 +118,8 @@ int start_pass_irc(int s, char *ip, int port, unsigned char options, char *miscp
|
|||
return 4;
|
||||
}
|
||||
|
||||
void service_irc(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
int run = 1, next_run = 1, sock = -1, ret;
|
||||
void service_irc(char *ip, int32_t sp, unsigned char options, char *miscptr, FILE * fp, int32_t port, char *hostname) {
|
||||
int32_t run = 1, next_run = 1, sock = -1, ret;
|
||||
char *buf;
|
||||
|
||||
hydra_register_socket(sp);
|
||||
|
@ -133,7 +133,7 @@ void service_irc(char *ip, int sp, unsigned char options, char *miscptr, FILE *
|
|||
|
||||
sock = irc_server_connect(ip, sock, port, options, hostname);
|
||||
if (sock < 0) {
|
||||
hydra_report(stderr, "[ERROR] Child with pid %d terminating, can not connect\n", (int) getpid());
|
||||
hydra_report(stderr, "[ERROR] Child with pid %d terminating, can not connect\n", (int32_t) getpid());
|
||||
hydra_child_exit(1);
|
||||
}
|
||||
|
||||
|
@ -209,7 +209,7 @@ void service_irc(char *ip, int sp, unsigned char options, char *miscptr, FILE *
|
|||
}
|
||||
}
|
||||
|
||||
int service_irc_init(char *ip, int sp, unsigned char options, char *miscptr, FILE * fp, int port, char *hostname) {
|
||||
int32_t service_irc_init(char *ip, int32_t sp, unsigned char options, char *miscptr, FILE * fp, int32_t port, char *hostname) {
|
||||
// called before the childrens are forked off, so this is the function
|
||||
// which should be filled if initial connections and service setup has to be
|
||||
// performed once only.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue