summaryrefslogtreecommitdiff
path: root/src/login/login.c
diff options
context:
space:
mode:
authorLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-05-31 05:14:55 +0000
committerLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-05-31 05:14:55 +0000
commit78b8c9896c2f4170e7fa0ea502ac1026525f8174 (patch)
tree4d70d71a71811ffca6b22f78bfa9b66a141401f9 /src/login/login.c
parentaf2d2bc89af950fe2b780ef72ac6b0f8561ac950 (diff)
downloadhercules-78b8c9896c2f4170e7fa0ea502ac1026525f8174.tar.gz
hercules-78b8c9896c2f4170e7fa0ea502ac1026525f8174.tar.bz2
hercules-78b8c9896c2f4170e7fa0ea502ac1026525f8174.tar.xz
hercules-78b8c9896c2f4170e7fa0ea502ac1026525f8174.zip
[Added]:
- Partial support for latest login packet. But it seems to have a new security module. [Lance] git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6874 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/login/login.c')
-rw-r--r--src/login/login.c28
1 files changed, 22 insertions, 6 deletions
diff --git a/src/login/login.c b/src/login/login.c
index 3979c64ce..0fbf03088 100644
--- a/src/login/login.c
+++ b/src/login/login.c
@@ -3045,6 +3045,7 @@ int parse_login(int fd) {
unsigned char *p = (unsigned char *) &session[fd]->client_addr.sin_addr;
char ip[16];
long subnet_char_ip;
+ int packet_len;
RFIFOHEAD(fd);
@@ -3082,16 +3083,31 @@ int parse_login(int fd) {
RFIFOSKIP(fd,18);
break;
- case 0x64: // Ask connection of a client
- case 0x01dd: // Ask connection of a client (encryption mode)
- if ((int)RFIFOREST(fd) < ((RFIFOW(fd,0) == 0x64) ? 55 : 47))
- return 0;
+ case 0x277: // New login packet
+ case 0x64: // request client login
+ case 0x01dd: // request client login with encrypt
+ packet_len = RFIFOREST(fd);
+
+ switch(RFIFOW(fd, 0)){
+ case 0x64:
+ if(packet_len < 55)
+ return 0;
+ break;
+ case 0x01dd:
+ if(packet_len < 47)
+ return 0;
+ break;
+ case 0x277:
+ if(packet_len < 84)
+ return 0;
+ break;
+ }
account.version = RFIFOL(fd, 2); //for exe version check [Sirius]
memcpy(account.userid,RFIFOP(fd,6),NAME_LENGTH);
account.userid[23] = '\0';
remove_control_chars((unsigned char *)account.userid);
- if (RFIFOW(fd,0) == 0x64) {
+ if (RFIFOW(fd,0) != 0x01dd) {
login_log("Request for connection (non encryption mode) of %s (ip: %s)." RETCODE, account.userid, ip);
memcpy(account.passwd, RFIFOP(fd,30), NAME_LENGTH);
account.passwd[23] = '\0';
@@ -3200,7 +3216,7 @@ int parse_login(int fd) {
}
WFIFOSET(fd,23);
}
- RFIFOSKIP(fd,(RFIFOW(fd,0) == 0x64) ? 55 : 47);
+ RFIFOSKIP(fd,packet_len);
break;
case 0x01db: // Sending request of the coding key