This will change the returned pRet string so that it returns 0(pRet is the value returned from authentication,0=proper login)
This should allow you to login and it will show the server select,but there is no character select yet.If someone could provide me with an old client(Preferably a TW client from 2008),I would appreciate it.Code:#include <windows.h>
#include <stdio.h>
#include <time.h>
#include <intrin.h>
#pragma comment(lib, "Advapi32")
#include "CDetour/CDetour.h"
CDetour LoginHookDet;
void LoginHook(const wchar_t *Account, const char *Password, unsigned int *Serial, unsigned int *pRet)
{
unsigned int *fakeRet = 0;
LoginHookDet.Org(Account,Password,Serial,fakeRet);
}
extern "C" __declspec( dllexport )BOOL __stdcall DllMain( HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved )
{
if( dwReason == DLL_PROCESS_ATTACH )
{
LoginHookDet.Detour((PBYTE)0x005A1D50,(PBYTE)LoginHook);
LoginHookDet.Apply();
MessageBoxA(NULL,"Done","Done",MB_OK);
}
return true;
}
PS:Here's a screenshot :D
http://img816.imageshack.us/img816/9383/itworks.png
Update:
IT WORKS.I ACHIEVED DB CONNECTION
I think Phail said something about how he used MySQL 4.1 on another thread.Main thing is,we actually achieved to get it to connect to a database.Cheers to everyone.Code:[2010-12-24 22:45:33]Query(400:insert into SKID_STLOG_TB(LOGNAME,LOGKEY,SERVERID,CID,CNAME,CREATEDATE,N1ARG,N2ARG,N3ARG,TXTCONTENT) values(?,?,?,?,?,SYSDATE,?,?,?,?)) Error:1146
Param:serverStart 0 100 0 admin 168 1 3 server started
Error:1146:1:SQLExecute:[42S02][MySQL][ODBC 5.1 Driver][mysqld-5.1.41]Table 'skid_stlog_tb' doesn't exist
[2010-12-24 22:45:33]Query(601:select to_char(sysdate,'YYYY-MM-DD HH24:MI:SS') from dual) Error:1305
Param:
Error:1305:1:SQLExecute:[42000][MySQL][ODBC 5.1 Driver][mysqld-5.1.41]FUNCTION to_char does not exist
[2010-12-24 22:45:33]Query(1535:select STICKERID,BIGIMGID,CID,CNAME,STICKERTYPE,ATTACHCNT,LASTDATE,STICKERCATEGORY,STICKERNAME from SKID_STICKERCATALOG_TB where SERVERID=? and STICKERTYPE=0 and rownum<200000 order by LASTDATE ) Error:1146
Param:100
Error:1146:1:SQLExecute:[42S02][MySQL][ODBC 5.1 Driver][mysqld-5.1.41]Table 'skid_stickercatalog_tb' doesn't exist
Update2:
Changed to 4.1,MySQL errors posted below
I am starting to believe that it needs Oracle.Code:[2010-12-25 00:02:26]Query(400:insert into SKID_STLOG_TB(LOGNAME,LOGKEY,SERVERID,CID,CNAME,CREATEDATE,N1ARG,N2ARG,N3ARG,TXTCONTENT) values(?,?,?,?,?,SYSDATE,?,?,?,?)) Error:1054
Param:serverStart 0 100 0 admin 168 1 3 server started
Error:1054:1:SQLExecute:[42S22][MySQL][ODBC 3.51 Driver][mysqld-4.1.22-community-nt]Unknown column 'SYSDATE' in 'field list'
[2010-12-25 00:02:26]Query(601:select to_char(sysdate,'YYYY-MM-DD HH24:MI:SS') from dual) Error:1064
Param:
Error:1064:1:SQLExecute:[42000][MySQL][ODBC 3.51 Driver][mysqld-4.1.22-community-nt]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(sysdate,'YYYY-MM-DD HH24:MI:SS') from dual'
[2010-12-25 00:02:26]Query(1535:select STICKERID,BIGIMGID,CID,CNAME,STICKERTYPE,ATTACHCNT,LASTDATE,STICKERCATEGORY,STICKERNAME from SKID_STICKERCATALOG_TB where SERVERID=? and STICKERTYPE=0 and rownum<200000 order by LASTDATE ) Error:1054
Param:100
Error:1054:1:SQLExecute:[42S22][MySQL][ODBC 3.51 Driver][mysqld-4.1.22-community-nt]Unknown column 'rownum' in 'where clause'
[2010-12-25 00:05:49]Query(30:select a.CID,a.CNAME,a.AVATAR,a.NLEVEL,a.CURCAR,TO_CHAR(a.CDATE, 'yyyy-mm-dd hh24:mi:ss'), b.CARTYPE,b.COLOR, a.TeamId , c.TeamName, c.TMarkId, a.GUILDTYPE from SKID_CHARACTER_TB a,SKID_CAR_TB b,SKID_TEAM_TB c where a.serverid=b.serverid(+) and a.CID=b.CID(+) and a.CURCAR=b.CARID(+) and a.memberid=? and a.serverid=? and a.state='P' and a.serverid=c.serverid(+) and a.TEAMID=c.TID(+) order by a.lastdate desc;) Error:1064
Param:car 100
Error:1064:1:SQLExecute:[42000][MySQL][ODBC 3.51 Driver][mysqld-4.1.22-community-nt]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(a.CDATE, 'yyyy-mm-dd hh24:mi:ss'), b.CARTYPE,
[2010-12-25 00:05:50]Query(26:update SKID_MEMBER_TB set LOGINDATE=SYSDATE,LASTIP=? where memberid=?) Error:1054
Param:127.0.0.1:17824 car
Error:1054:1:SQLExecute:[42S22][MySQL][ODBC 3.51 Driver][mysqld-4.1.22-community-nt]Unknown column 'SYSDATE' in 'field list'
[2010-12-25 00:11:48]Query(21:SELECT TO_NUMBER(SYSDATE-LOGOUTDATE) FROM SKID_MEMBER_TB WHERE MEMBERID=?) Error:1064
Param:car
Error:1064:1:SQLExecute:[42000][MySQL][ODBC 3.51 Driver][mysqld-4.1.22-community-nt]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(SYSDATE-LOGOUTDATE) FROM SKID_MEMBER_TB WHERE
[2010-12-25 00:11:48]Query(25:update SKID_MEMBER_TB set LOGOUTDATE=SYSDATE,LASTPLAYTIME=?,TOTALPLAYTIME=TOTALPLAYTIME+? where memberid=?) Error:1054
Param:359 359 car
Error:1054:1:SQLExecute:[42S22][MySQL][ODBC 3.51 Driver][mysqld-4.1.22-community-nt]Unknown column 'SYSDATE' in 'field list'
EDIT:
Converted database to PostGreSQL
Errors below
We are getting closer,we just need to add some columnsCode:[2010-12-25 13:25:05]Query(400:insert into SKID_STLOG_TB(LOGNAME,LOGKEY,SERVERID,CID,CNAME,CREATEDATE,N1ARG,N2ARG,N3ARG,TXTCONTENT) values(?,?,?,?,?,SYSDATE,?,?,?,?)) Error:7
Param:serverStart 0 100 0 admin 168 1 3 server started
Error:7:1:SQLExecute:[42703]ERROR: column "logname" of relation "skid_stlog_tb" does not exist;
Error while executing the query
[2010-12-25 13:25:05]Query(601:select to_char(sysdate,'YYYY-MM-DD HH24:MI:SS') from dual) Error:7
Param:
Error:7:1:SQLExecute:[42P01]ERROR: relation "dual" does not exist;
Error while executing the query
[2010-12-25 13:25:05]Query(290:SELECT CID, CNAME, REGNUM, BUYNUM,SELLNUM FROM SKID_AUCTIONMILEAGE_TB WHERE SERVERID=?) Error:7
Param:100
Error:7:1:SQLExecute:[42703]ERROR: column "cid" does not exist;
Error while executing the query

