Raised This Month: $12 Target: $400
 3% 

Bot Played Time Faker (v1.2)


Post New Thread Reply   
 
Thread Tools Display Modes
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-24-2013 , 16:16   Re: Bot Played Time Faker (v1.1)
Reply With Quote #11

I would think it could be useful, if a player connects to the server, he may stay and it may lead to other players connection ; and eventually a server filled with only players. I see really no harm done. It's more a tool to motivate players to stay on the server and waiting for others players. If you want to blame someone, blame the admin who put bots.
__________________
Arkshine is offline
Lolz0r
Veteran Member
Join Date: Nov 2010
Location: Balgaria
Old 03-24-2013 , 16:22   Re: Bot Played Time Faker (v1.1)
Reply With Quote #12

Nice work Arkshine !
Lolz0r is offline
K.K.Lv
Veteran Member
Join Date: Aug 2008
Location: GameFolder
Old 03-25-2013 , 07:46   Re: Bot Played Time Faker (v1.1)
Reply With Quote #13

I think it will be better to hook sendto api and then replace the buffer !I have not time to finish it !
__________________
QQ:116268742
K.K.Lv is offline
Send a message via MSN to K.K.Lv
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-25-2013 , 07:59   Re: Bot Played Time Faker (v1.1)
Reply With Quote #14

It's what it does already, it hooks sendto and alter original buffer before sending. Or I've missed something ? And why do you say "I have not time to finish it" ?
__________________

Last edited by Arkshine; 03-25-2013 at 08:21.
Arkshine is offline
Sn!ff3r
Veteran Member
Join Date: Aug 2007
Location: Poland
Old 03-25-2013 , 08:33   Re: Bot Played Time Faker (v1.1)
Reply With Quote #15

It works! ;)

Good job.
__________________
Join US - custom Zombie Server - Custom Addons:



Sn!ff3r is offline
Send a message via Skype™ to Sn!ff3r
K.K.Lv
Veteran Member
Join Date: Aug 2008
Location: GameFolder
Old 03-26-2013 , 07:00   Re: Bot Played Time Faker (v1.1)
Reply With Quote #16

@Arkshine a few months ago yokomo pm me for this module !
__________________
QQ:116268742
K.K.Lv is offline
Send a message via MSN to K.K.Lv
K.K.Lv
Veteran Member
Join Date: Aug 2008
Location: GameFolder
Old 03-26-2013 , 07:15   Re: Bot Played Time Faker (v1.1)
Reply With Quote #17

and this is my un-finish code on CSGO !
but at least , it could be load now !
Code:
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <memory.h> #include <stdarg.h> #include <windows.h> #include "detours.h" #include "stub_mm.h" StubPlugin g_StubPlugin; HMODULE gSocket_ws2; HMODULE gSocket_wsock32; BOOL gbHook = FALSE; #define A2S_INFO_REPLY      "\xFF\xFF\xFF\xFF\x49" typedef int (WINAPI *sendto_t)(SOCKET, const char* , int, int , const sockaddr*, int); //origin ws2_32.dll recvfrom callback sendto_t sendto_ws2; //origin wsock32.dll recvfrom callback sendto_t sendto_wsock32; char* trimbuf(char *str) {     char *ibuf = str;     int i = 0;         if (str == NULL)         return NULL;     for (ibuf = str; *ibuf && isspace(*ibuf); ++ibuf)         ;         i = strlen(ibuf);     if (str != ibuf)         memmove(str, ibuf, i);         str[i] = 0;     while (--i >= 0)     {         if (!isspace(ibuf[i]))             break;     }     ibuf[++i] = 0;     return str; } void GetGameDir(char *gamedir, size_t maxlen) {     const char *gamepath = g_SMAPI->GetBaseDir();     size_t len = strlen(gamepath);     for (size_t i = len - 1; i < len; i--)     {         if (gamepath[i] == '\\')         {             strncpy(gamedir, &gamepath[++i], maxlen);             break;         }     } } bool IsNewMapName(LPCSTR lpOriginalMapName, LPCH NewName, size_t maxlen) {     LPCSTR NEWNAME_INI = "NewMapName.ini";     char buf[1024];     char gamedir[256];     char *cl;     char *vl;     int line = 0;     sprintf(buf, "%s", NEWNAME_INI);     FILE *fp = fopen(buf, "r");         if (fp == NULL)     {         GetGameDir(gamedir, sizeof(gamedir));         sprintf(buf, "%s/%s", gamedir, NEWNAME_INI);         fp = fopen(buf, "r");         if (fp == NULL)         {             printf("Could open file \"%s\"\n", NEWNAME_INI);             return false;         }     }     while (fgets(buf, sizeof(buf), fp))     {         if (line++ == 0)         {             if (strlen(buf) > 3 && buf[0] == -17 && buf[1] == -69 && buf[2] == -65)             {                 strcpy(buf, &buf[3]);             }         }         cl = trimbuf(buf);         if (strlen(cl) == 0 || cl[0] == ';' || (cl[0] == '/' && cl[1] == '/') )             continue;         vl = strchr(cl, '=');         if (vl == NULL)             continue;         *(vl++) = 0;         cl = trimbuf(cl);         vl = trimbuf(vl);         if (!stricmp(cl, lpOriginalMapName))         {             strncpy(NewName, vl, maxlen);             fclose(fp);             return true;         }     }     fclose(fp);     NewName[0] = '\0';     return false; } int GetStr(char *buffer, int &index, char *output, size_t maxlen) {     int len = 0;     if((len = lstrlen(&buffer[index])) > (int)maxlen)     {         if(lstrcpyn(output, &buffer[index], maxlen) == 0)         {             return FALSE;         }         buffer[index + maxlen] = 0;     }else if(buffer[index]!=0){         if(lstrcpyn(output, &buffer[index], len + 1)==0)         {             return FALSE;         }     }else{         output[0] = 0;     }     index += len + 1;     return len; } int WINAPI newsendto_ws2(SOCKET s, const char* buf, int len, int flags, const sockaddr* to, int tolen) {     if(len > 5)     {         if(memcmp(A2S_INFO_REPLY, buf, 5) == 0)         {             //printf("sendto buffer %s\n", buf);             BYTE packet[1024];             TCHAR *cache, ServerName[256], MapName[32];             cache = (TCHAR*)malloc(len);             int id = 5, stringlen = 0, m_len = 0, ret = 0;             memset(packet, 0, sizeof(packet));             memset(cache, 0, len);             memcpy(cache, buf, len);             GetStr(cache, id, ServerName, sizeof(ServerName));             GetStr(cache, id, MapName, sizeof(MapName));             if (IsNewMapName(MapName, MapName, sizeof(MapName)))             {                 *(DWORD*)packet = -1;                 packet[4] = 0x49;                 m_len = 5;                 stringlen = sprintf((char*)&packet[m_len], ServerName);                 m_len += stringlen + 1;                 stringlen = sprintf((char*)&packet[m_len], MapName);                 m_len += stringlen + 1;                 memcpy((void*)&packet[m_len], (const void*)&cache[id], len - id + 1);                 m_len += (len - id) + 1;                 free(cache);                 ret = sendto_ws2(s, (const char*)packet, m_len, flags, to, tolen);                 return ret;             }         }     }     return sendto_ws2(s, buf, len, flags, to, tolen); } int WINAPI newsendto_wsock32(SOCKET s, const char* buf, int len, int flags, const sockaddr* to, int tolen) {     if(len > 5)     {         if(memcmp(A2S_INFO_REPLY, buf, 5) == 0)         {             //printf("sendto buffer %s\n", buf);             BYTE packet[1024];             TCHAR *cache, ServerName[256], MapName[32];             cache = (TCHAR*)malloc(len);             int id = 5, stringlen = 0, m_len = 0, ret = 0;             memset(packet, 0, sizeof(packet));             memset(cache, 0, len);             memcpy(cache, buf, len);             GetStr(cache, id, ServerName, sizeof(ServerName));             GetStr(cache, id, MapName, sizeof(MapName));             if (IsNewMapName(MapName, MapName, sizeof(MapName)))             {                 *(DWORD*)packet = -1;                 packet[4] = 0x49;                 m_len = 5;                 stringlen = sprintf((char*)&packet[m_len], ServerName);                 m_len += stringlen + 1;                 stringlen = sprintf((char*)&packet[m_len], MapName);                 m_len += stringlen + 1;                 memcpy((void*)&packet[m_len], (const void*)&cache[id], len - id + 1);                 m_len += (len - id) + 1;                 free(cache);                 ret = sendto_wsock32(s, (const char*)packet, m_len, flags, to, tolen);                 return ret;             }         }     }     return sendto_wsock32(s, buf, len, flags, to, tolen); } IServerGameDLL *server = NULL; PLUGIN_EXPOSE(StubPlugin, g_StubPlugin); bool StubPlugin::Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlen, bool late) {     PLUGIN_SAVEVARS();     /* Make sure we build on MM:S 1.4 */ #if defined METAMOD_PLAPI_VERSION     GET_V_IFACE_ANY(GetServerFactory, server, IServerGameDLL, INTERFACEVERSION_SERVERGAMEDLL); #else     GET_V_IFACE_ANY(serverFactory, server, IServerGameDLL, INTERFACEVERSION_SERVERGAMEDLL); #endif         gSocket_ws2 = LoadLibrary("ws2_32.dll");     gSocket_wsock32 = LoadLibrary("wsock32.dll");     sendto_ws2 = (sendto_t)GetProcAddress(gSocket_ws2,"sendto");     sendto_wsock32 = (sendto_t)GetProcAddress(gSocket_wsock32, "sendto");     if (sendto_ws2)     {         DetourTransactionBegin();         DetourUpdateThread(GetCurrentThread());         DetourAttach((void**)&sendto_ws2,newsendto_ws2);//attach make new jump data         DetourTransactionCommit();     }         if(sendto_wsock32)     {         DetourTransactionBegin();         DetourUpdateThread(GetCurrentThread());         DetourAttach((void**)&sendto_wsock32,newsendto_wsock32); //attach make new jump data         DetourTransactionCommit();     }     gbHook = TRUE;     g_SMAPI->ConPrintf("\n\tServer using \"%s\"(v %s)\n\tCopyright 2012 by \"%s\".\n\tWeibo: \"%s\"\n\n", GetName(), GetVersion(), GetAuthor(), GetURL());     return true; } bool StubPlugin::Unload(char *error, size_t maxlen) {     if(gbHook == TRUE) //check hook mark     {         if(sendto_ws2)         {             DetourTransactionBegin();             DetourUpdateThread(GetCurrentThread());             DetourDetach((void**)&sendto_ws2,newsendto_ws2); //detach hook             DetourTransactionCommit()//destory new jump data and restore         }                 if(sendto_wsock32) //check hook mark         {             DetourTransactionBegin();             DetourUpdateThread(GetCurrentThread());             DetourDetach((void**)&sendto_wsock32,newsendto_wsock32)//detach hook             DetourTransactionCommit()//destory new jump data and restore         }     }     return true; } void StubPlugin::AllPluginsLoaded() { } bool StubPlugin::Pause(char *error, size_t maxlen) {     return true; } bool StubPlugin::Unpause(char *error, size_t maxlen) {     return true; } const char *StubPlugin::GetLicense() {     return "Lv<->吕"; } const char *StubPlugin::GetVersion() {     return "1.0.0.3"; } const char *StubPlugin::GetDate() {     return __DATE__; } const char *StubPlugin::GetLogTag() {     return "MNE"; } const char *StubPlugin::GetAuthor() {     return "L.K"; } const char *StubPlugin::GetDescription() {     return "Edit the map name at the sendto packet"; } const char *StubPlugin::GetName() {     return "Map Name Editor"; } const char *StubPlugin::GetURL() {     return "http://weibo.com/kklv"; }
__________________
QQ:116268742
K.K.Lv is offline
Send a message via MSN to K.K.Lv
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-26-2013 , 07:30   Re: Bot Played Time Faker (v1.1)
Reply With Quote #18

Not sure why you show this code, it's what does the module basically, except it doesn't hook for ws2_32.dll (not sure what is the difference between both)
__________________
Arkshine is offline
h010c
Member
Join Date: Aug 2009
Location: Mother Russia, Moscow
Old 01-17-2014 , 22:58   Re: Bot Played Time Faker (v1.1)
Reply With Quote #19

The road to hell is paved with good intentions.
h010c is offline
3emu
Junior Member
Join Date: Jan 2011
Location: BETTER THAN YOUR!
Old 03-09-2014 , 20:58   Re: Bot Played Time Faker (v1.1)
Reply With Quote #20

Can you fix this for podbots?
3emu is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:21.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode