Autor
|
Tema: autoname, namechanger, namestealer (Leído 2,358 veces)
|
85
|
Hola , estaba revisando un código que usaba en el Counter-Strike. Es un namechanger o namestealer. En un servidor de CS, de por ejemplo 32 slots, este hack lo que hace es cambiar tu nombre aleatoriamente por el de alguno de los demás jugadores. El tema es que no se permite tener el mismo exacto nombre, por lo que se le debe hacer un cambio. Tampoco se permite que tu nombre contenga el nombre de un administrador. Este namechanger se encarga de lo primero, o sea recibe el nombre de alguien y lo modifica con un sólo cambio y devuelve el nombre modificado. Se hace un sólo cambio por que la idea es que el nombre se pareza al del otro jugador. Yo lo que hice fue reemplazar las funciones de cadena que se utilizaron en el primer código. Lo que quisiera es si alguien se anima a hacerlo de otra forma, sin salirse de la lógica de funcionamiento. Otra cosa es lo de la escritura LEET, o 1337. Se trata de una equivalencia de letras con números, por ejemplo: CASA = C454 o AVIÓN = 4V10N o BS = 85 etc Eso también es válido para este autoname. Si encuentran algún error en mi code avizen. Aunque no crean este autoname da buenos resultados para gambetear bans XD // // By 85 // elhacker.net // etalking.com.ar // 2013 // #include<windows.h> #include<stdio.h> // char objetivos[] = "ABEGLOST\0"; char reemplazos[]= "48361057\0"; // void ModificadorDeNombresConSTR(char* str){ // Detección de doble whitespace if(strstr(str," ")!=NULL) { strcpy(strstr(str," "),strstr(str," ")+1); return; } // Detección de whitespace if(strstr(str," ")!=NULL) { char buf[256]; strcpy(buf,str); strcpy(strstr(buf," ")+1,strstr(str," ")); strcpy(str,buf); return; } // Char inicial y final iguales if(str[0]==str[strlen(str)-1]) { char buf[256]; char sbuf[2]="X";// Al asignarle valor se le agrega el 0 automáticamente. sbuf[0]=str[0]; strcpy(buf,sbuf); strcat(buf,str); strcpy(str,buf); return; } // Reemplazo de ocurrencias (para escritura 1337 XD) if(strstr(str,"A")!=NULL) { *strstr(str,"A")='4'; return; } if(strstr(str,"B")!=NULL) { *strstr(str,"B")='5'; return; } if(strstr(str,"E")!=NULL) { *strstr(str,"E")='3'; return; } if(strstr(str,"G")!=NULL) { *strstr(str,"G")='6'; return; } if(strstr(str,"L")!=NULL) { *strstr(str,"L")='1'; return; } if(strstr(str,"O")!=NULL) { *strstr(str,"O")='0'; return; } if(strstr(str,"S")!=NULL) { *strstr(str,"S")='5'; return; } if(strstr(str,"T")!=NULL) { *strstr(str,"T")='7'; return; } // Char final y prefinal iguales if(str[strlen(str)-1]==str[strlen(str)-2]) { str[strlen(str)-1]=0; return; } // Reducción de longitud if(strlen(str)>16) { str[strlen(str)-1]=0; return; } // Agrega un punto al final strcat(str,"."); } // void ModificadorDeNombresSinSTR(char* str){ #define current (i-1) int len=0; for(;*str++;len++);// Obtener largo de cadena str-=(len+1);// Arreglar el puntero que se ha desplazado!!! { int i=0; while(str[i++]){ // Detección de doble whitespace if((str[current] == ' ' && str[i] == ' ')){ printf("DOBLE ESPACIO\n"); system("pause"); char buf[256]; int pos=current; while(str[pos++]!='\0'){// Reemplazo de STRCPY+STRSTR ;D int bufcur = (pos-current)-1; int strcur = (pos-1); buf[bufcur]=str[strcur+1]; buf[bufcur+1]=str[strcur+2]; str[strcur]=buf[bufcur]; str[strcur+1]=buf[bufcur+1]; } str[pos-1]=0; return; }}} { int i=0; while(str[i++]){ // Detección whitespace if(str[current] == ' '){ printf("ESPACIO\n"); system("pause"); str[len+1]=0; int pos=len+1; while(pos--){ if(pos==current) break; str[pos]=str[pos-1]; } return; }}} { int i=0; while(str[i++]){ // Char inicial y final iguales if(str[0] == str[len-1]){ printf("INICIAL y FINAL IGUALES\n"); system("pause"); str[len+1]=0; int pos=len+1; while(pos--){// Reemplazo de STRCPY ;D if(pos<1) break; str[pos]=str[pos-1]; } return; }}} { int i=0; while(str[i++]){ // Reemplazo de ocurrencias (para escritura 1337 XD) if(str[current] == 'A') {str[current]='4'; return;} else if(str[current] == 'B') {str[current]='8'; return;} else if(str[current] == 'E') {str[current]='3'; return;} else if(str[current] == 'G') {str[current]='6'; return;} else if(str[current] == 'L') {str[current]='1'; return;} else if(str[current] == 'O') {str[current]='0'; return;} else if(str[current] == 'S') {str[current]='5'; return;} else if(str[current] == 'T') {str[current]='7'; return;} }} // Char final y prefinal iguales if(str[len-1] == str[len-2]){ printf("FINAL y PREFINAL IGUALES\n"); system("pause"); str[len-1]=0; return; } // Reducción de longitud if(len>16){ printf("LONGITUD\n"); system("pause"); str[len-1] =0; return; } // Agrega un punto al final str[len] ='.'; str[len+1] =0; } // int main(){ // Nota: si STRCPY recibe el segundo argumento de mayor size que el primero // no importa mientras la cadena sea igual o menor. Y terminada en 0. // Aparte de que STRCPY recibe sus argumentos en forma de punteros. // http://www.cplusplus.com/reference/cstring/strcpy/ char nombrelargo[256]; // char ingreso[512] = "RRRRRRRRRRRRRRRRX\0"; // char ingreso[512] = "LEE TL\0"; // char ingreso[512] = "LEETL \0"; // char ingreso[512] = "LEET"; // char ingreso[512] = "azucarada"; // char ingreso[512] = "azuc arada"; // char ingreso[512] = "hazuc aradah"; // char ingreso[512] = "hazucaradahh"; // char ingreso[512] = "1azucaradahh"; // char ingreso[512] = "1 azucaradahh"; // char ingreso[512] = "1azucaradahhaaaa "; char ingreso[512] = "1azucaradahhaaaa "; strcpy(nombrelargo, ingreso); // ModificadorDeNombresConSTR(nombrelargo); ModificadorDeNombresSinSTR(ingreso); //printf("%s\n", nombrelargo); printf("%s\n", ingreso); system("pause"); return (0); } //
Proyecto: http://www.mediafire.com/?k6os3q63sxrw0ff
|
|
« Última modificación: 9 Marzo 2013, 09:21 am por 85 »
|
En línea
|
|
|
|
0xDani
Desconectado
Mensajes: 1.077
|
Una pregunta: ¿porque siempre incluyes windows.h en tus proyectos aunque no la uses?
|
|
|
En línea
|
I keep searching for something that I never seem to find, but maybe I won't, because I left it all behind!
I code for $$$ Hago trabajos en C/C++ Contactar por PM
|
|
|
bemone
Desconectado
Mensajes: 74
|
Y como volcas todo esto al juego?
|
|
|
En línea
|
Odio los tipos de variable de Windows.
|
|
|
85
|
Una pregunta: ¿porque siempre incluyes windows.h en tus proyectos aunque no la uses?
En muchos de mis códigos está puesto innecesariamente, es cierto, pero si te tengo que responder ¿por qué? es entre otras razones por esto: Algunas de las funciones que uso continuamente, MessageBox (Depuramiento del programa) http://msdn.microsoft.com/en-us/library/windows/desktop/ms645505(v=vs.85).aspx GetAsyncKeyState (Para detectar alguna tecla) http://msdn.microsoft.com/en-us/library/windows/desktop/ms646293(v=vs.85).aspx ExitProcess (Salir del programa) http://msdn.microsoft.com/en-us/library/windows/desktop/ms682658(v=vs.85).aspx ETC y es como que siempre queda <windows.h> Y como volcas todo esto al juego?
XD justo había apretado 'Publicar' y me dice que alguien respondió algo ERAS VOS XD El tema es que en el juego hay una forma de obtener los datos de los jugadores, y a esta función solamente le tenés que pasar un nombre y te lo modifica. Con ese nombre modificado, ahora podés cambiar tu propio nombre al del modificado.
|
|
|
En línea
|
|
|
|
bemone
Desconectado
Mensajes: 74
|
Me podes explicar donde consigo esta funcion? me interesa el tema.
|
|
|
En línea
|
Odio los tipos de variable de Windows.
|
|
|
85
|
Mi jefe es un hombre muy de moda, que siempre gusta ir de compras en Internet.Ayer cuando estaba listo para volver a casa, él me envió un mensajes de texto y escribió: "hola, Benny, sé que usted está buscando un tablet pc agradable, así que creo que debería recomendar esta tableta para usted.su configuración es muy bonito y está comenzando una promoción loco ahora, su nuevo precio es sólo del Euro € 52, creo que totalmente se lo puede permitir. "Ahora publicar esta noticia aquí, espero que sea útil!! enlace aquí: 7" pantalla Android 4.0 TOP configuración tablet pcrico bot.. Me podes explicar donde consigo esta funcion? me interesa el tema.
Esta sería la implementación de la función de autoname.. Es un hack para Counter-Strike /////////////////////////////////////////////////////////////////////////////////////////////// // // // AUTONAME, NAMECHANGER, NAMESTEALER, TEST // By 85 // [ElHacker.Net] // [09/03/13] // // ///////////////////////////////////////////////////////////////////////////////////////////////
// Counter-Strike Base Hook // By Chod & h1web // Release Date: 26th October 2008
/////////////////////////////////////////////////////////////////////////////////////////////// #pragma optimize("gtp",on) //#pragma comment(linker,"/MERGE:.data=.text /MERGE:.rdata=.text /SECTION:.text,EWR")
#include "apihook.h" #include "include.h"
///////////////////////////////////////////////////////////////////////////////////////////////
char g_szBaseDir[ 256 ]; cl_enginefunc_t * o_pEngFuncs = NULL;
///////////////////////////////////////////////////////////////////////////////////////////////
void logme(char * fmt, ... ) { va_list va_alist; char buf[512]; va_start (va_alist, fmt); _vsnprintf (buf, sizeof(buf), fmt, va_alist); va_end (va_alist);
ofstream fout; char path[256]; sprintf(path,"%sDionysus.txt",g_szBaseDir); fout.open(path, ios::app);
if(fout.fail()) return;
fout << buf << endl; fout.close(); }
///////////////////////////////////////////////////////////////////////////////////////////////
// This is just a test for the namechanger !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! bool ok=false; static unsigned int randi=0; static char names[32][256]; static unsigned int last_timer=0; //extern cl_enginefunc_t * o_pEngFuncs; void logme(char * fmt, ... ); //////////////////////////////////////////////////// void ModificadorDeNombresConSTR(char* str){ // Detección de doble whitespace if(strstr(str," ")!=NULL) { strcpy(strstr(str," "),strstr(str," ")+1); return; } // Detección de whitespace if(strstr(str," ")!=NULL) { char buf[256]; strcpy(buf,str); strcpy(strstr(buf," ")+1,strstr(str," ")); strcpy(str,buf); return; } // Char inicial y final iguales if(str[0]==str[strlen(str)-1]) { char buf[256]; char sbuf[2]="X";// Al asignarle valor se le agrega el 0 automáticamente. sbuf[0]=str[0]; strcpy(buf,sbuf); strcat(buf,str); strcpy(str,buf); return; } // Reemplazo de ocurrencias (para escritura 1337 XD) if(strstr(str,"A")!=NULL) { *strstr(str,"A")='4'; return; } if(strstr(str,"B")!=NULL) { *strstr(str,"B")='5'; return; } if(strstr(str,"E")!=NULL) { *strstr(str,"E")='3'; return; } if(strstr(str,"G")!=NULL) { *strstr(str,"G")='6'; return; } if(strstr(str,"L")!=NULL) { *strstr(str,"L")='1'; return; } if(strstr(str,"O")!=NULL) { *strstr(str,"O")='0'; return; } if(strstr(str,"S")!=NULL) { *strstr(str,"S")='5'; return; } if(strstr(str,"T")!=NULL) { *strstr(str,"T")='7'; return; } // Char final y prefinal iguales if(str[strlen(str)-1]==str[strlen(str)-2]) { str[strlen(str)-1]=0; return; } // Reducción de longitud if(strlen(str)>16) { str[strlen(str)-1]=0; return; } // Agrega un punto al final strcat(str,"."); }
int AddEntResult = 1; //=================================================================================== void HUD_AddEntity (int type, struct cl_entity_s *ent, const char *modelname) {
if(o_pEngFuncs) { //////////////////////////////////////////////////////////////////Modificado por 85
if(o_pEngFuncs->GetLocalPlayer()->curstate.solid) { //logme("tgt %d",(timeGetTime()/1000)); //logme("last_timer %d",last_timer); int ii = (timeGetTime()/1000); SYSTEMTIME time; GetLocalTime(&time); //int ii =time.wSecond; //int ii = 0; //logme("o_pEngFuncs %X",o_pEngFuncs); //logme("ii %d",ii);
if(((ii) - last_timer)>2.0) { int names_count=0; int i; for(i=0; i<33;i++) { cl_entity_s * pEnt = o_pEngFuncs->GetEntityByIndex(i); if(pEnt && pEnt->curstate.solid && pEnt!=o_pEngFuncs->GetLocalPlayer()) { hud_player_info_t pInfo; o_pEngFuncs->pfnGetPlayerInfo(i, &pInfo);//pEnt->curstate.solid char name[256]; //strcpy(name,pInfo.name); memcpy(name,pInfo.name,128); name[128]=0; if(name[0]!='('){ randi++; strcpy(names[names_count++],name); } } }
int n; if(names_count>0) { char cmdstr[256]; char name[256]; char buf[2]="A"; n=randi%names_count; strcpy(cmdstr,"name \""); strcpy(name,names[n]); ///////////////////////////////////////////////// ModificadorDeNombresConSTR(name);// Hola, me reconocen? ////////////////////////////////////////// strcat(cmdstr,name); strcat(cmdstr,"\""); o_pEngFuncs->pfnClientCmd(cmdstr); //o_pEngFuncs->pfnDrawConsoleString( 300, 300, cmdstr ); //logme(cmdstr); }
last_timer = (ii); } }/////////////////////////////////////////////////////////////// }/////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////
int retval = 1; AddEntResult = retval; } DWORD* slots=(DWORD*)0x01EB74E8; static bool loaded = false; static bool done = false; DWORD retaddress; __declspec( naked )void Gateway2_HUD_AddEntity( void ) { __asm { mov AddEntResult, eax; call HUD_AddEntity; mov eax, AddEntResult; jmp retaddress; } } DWORD AddEnt = (DWORD)&Gateway2_HUD_AddEntity; __declspec( naked )void Gateway1_HUD_AddEntity( void ) { __asm { push esi; mov esi,dword ptr ss:[esp+0x14]; mov retaddress,esi; push AddEnt pop esi; mov dword ptr ss:[esp+0x14],esi; pop esi; ret; } } __declspec(naked) void nullStub() { _asm ret; } void OnlyHook(LARGE_INTEGER *lp, bool force = true) { static bool patched = false; bool a = (o_pEngFuncs->GetLocalPlayer()->curstate.solid && !done); if( /*a ||*/force || GetAsyncKeyState(VK_END)&0x8000 ) { unsigned char* c; if(!patched) { patched=true; for(int s=0;s<40;s++) { c = (unsigned char*)slots[s]; if( c[0] != 0xc3 ) { patched=false; MessageBox(NULL, "Things look wrong... very wrong", NULL, MB_OK); } } } c = (unsigned char*)slots[20]; if( c[0] == 0xc3 ){ slots[20] = (DWORD)&Gateway1_HUD_AddEntity;}//HUD_AddEntity done = true; } if (force) return; }
typedef BOOL (WINAPI *QueryPerformanceCounterFunc)(LARGE_INTEGER*); QueryPerformanceCounterFunc QueryPerformanceCounterPtr=NULL; BOOL WINAPI newQueryPerformanceCounter(LARGE_INTEGER *lp) { BOOL ret = (*QueryPerformanceCounterPtr)(lp); OnlyHook(lp, false); return ret; }
FARPROC (WINAPI *oGetProcAddress)(HMODULE hModule, LPCSTR lpProcName);
///////////////////////////////////////////////////////////////////////////////////////////////
FARPROC WINAPI _GetProcAddress(HMODULE hModule, LPCSTR lpProcName) { FARPROC nResult = oGetProcAddress(hModule, lpProcName);
if (HIWORD(lpProcName)) { if (!lstrcmp(lpProcName, "GetProcAddress")) { return (FARPROC) &_GetProcAddress; } else if(!strcmp(lpProcName,"QueryPerformanceCounter")) { QueryPerformanceCounterPtr = (QueryPerformanceCounterFunc)nResult; return (FARPROC)&newQueryPerformanceCounter; } } return nResult; }
///////////////////////////////////////////////////////////////////////////////////////////////
BOOL APIENTRY DllMain ( HINSTANCE hInst, DWORD reason, LPVOID reserved ) { if( reason == DLL_PROCESS_ATTACH ) { if(!o_pEngFuncs){ o_pEngFuncs=(cl_enginefunc_t *)0x01EB72D8; }
// setup base directory GetModuleFileName( hInst, g_szBaseDir, sizeof( g_szBaseDir ) ); char* pos = g_szBaseDir + strlen( g_szBaseDir ); while( pos >= g_szBaseDir && *pos!='\\' ) --pos; pos[ 1 ]=0;
oGetProcAddress=(FARPROC(WINAPI *)(HMODULE, LPCSTR))InterceptDllCall(GetModuleHandle(NULL), "Kernel32.dll", "GetProcAddress", (DWORD)&_GetProcAddress); } return TRUE; }
///////////////////////////////////////////////////////////////////////////////////////////////
y me tomé la molestia de armarte un proyecto de una DLL para cargar en el juego, así podés probar de que se trata. http://www.mediafire.com/?98pcz7qk8dwdswdVes los names que vas tomando?, son los de los demás pero con un cambio que lo hace la función esa.
|
|
|
En línea
|
|
|
|
rir3760
Desconectado
Mensajes: 1.639
|
rico bot Si vas a citar al spambot por favor elimina el link. void logme(char * fmt, ... ) { // ...
ofstream fout; ¿Programas en C++? Bueno, en ese caso deberías utilizar las facilidades que este provee, empezando por la clase string. Un saludo
|
|
|
En línea
|
C retains the basic philosophy that programmers know what they are doing; it only requires that they state their intentions explicitly. -- Kernighan & Ritchie, The C programming language
|
|
|
|
|