elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: AIO elhacker.NET 2021 Compilación herramientas análisis y desinfección malware


  Mostrar Mensajes
Páginas: 1 ... 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 [56] 57 58 59 60 61
551  Programación / Programación C/C++ / Libreria Juego Online en OpenGL en: 23 Marzo 2013, 14:43 pm
Hola, estoy creando un juego:
Código:
https://www.dropbox.com/s/0m9mhmrgmhmt7an/Juego%20Isc.rar
y algun día me gustaria poder ponerlo online. Como estoy programando en OpenGL, no quiero usar Winsock ya que seria anclarse a un S.O. por una simple libreria. La pregunta es...
Conoceis alguna libreria para hacer el Online que no necesite un Sistema Operativo en especial?
552  Programación / Programación C/C++ / Re: Ayuda con los structs en: 23 Marzo 2013, 14:29 pm
MUCHISIMAS GRACIAAAS YA LO HE CONSEGUIDO GRACIAS !!!!!
un link a el juego que estoy creando a ver que te parecec jaaja: https://www.dropbox.com/s/0m9mhmrgmhmt7an/Juego%20Isc.rar
553  Programación / Programación C/C++ / Re: Ayuda con los structs en: 23 Marzo 2013, 14:19 pm
No consigo que funcione. Solo quiero tener un header con el struct y usar los datos desde cualquier .cpp

Con este code no da error de struct pero si de objetostotales

struct.h
Código:
#ifndef STRUCTOBJETO_H
#define STRUCTOBJETO_H

int ObjetosTotales = 0;

struct Objeto{
    
   float x, y, z;
   int modelo;
   float t_x, t_y, t_z;
   int ang_x;

   void Nuevo(int vmodelo, float vx,float vy,float vz,int vang_x,float vt_x,float vt_y,float vt_z) {
      modelo = vmodelo;
      ang_x = vang_x;
      x = vx;   t_x = vt_x;
      y = vy;   t_y = vt_y;
      z = vz;   t_z = vt_z;
      ObjetosTotales++;
   }
};

extern Objeto objeto[5000];

#endif

main.cpp
Código:
#include "header.h"
#include "struct.h"

using namespace std;

struct Objeto objeto[5000];// Declaración, no va con extern!
int Comprobar();

int main(){

cout << "asdasd" << endl;
objeto[ObjetosTotales+1].Nuevo(69,1,1,1,1,1,1,1);
getch();
Comprobar();
getch();

return 0;
}

anadir.cpp
Código:
#include "header.h"
#include "struct.h"

using namespace std;



int Comprobar(){
   if(objeto[ObjetosTotales].modelo == 69){
      return 1;}

   return 0;
}

Errores:
Código:
Vinculando...
anadir.obj : error LNK2005: ya se definió "int ObjetosTotales" (?ObjetosTotales@@3HA) en main.obj
struct.obj : error LNK2005: ya se definió "int ObjetosTotales" (?ObjetosTotales@@3HA) en main.obj
C:\Documents and Settings\isc\Mis documentos\Visual Studio 2008\Projects\Structs\Debug\Structs.exe : fatal error LNK1169: se encontraron uno o más símbolos definidos simultáneamente
554  Programación / Programación C/C++ / Re: Ayuda con los structs en: 23 Marzo 2013, 14:09 pm
a ver sigue sin funcionar:
struct.h
Código:
#ifndef STRUCTOBJETO_H
#define STRUCTOBJETO_H

int ObjetosTotales = 0;

struct Objeto{
   
float x, y, z;
int modelo;
float t_x, t_y, t_z;
int ang_x;

void Nuevo(int vmodelo, float vx,float vy,float vz,int vang_x,float vt_x,float vt_y,float vt_z) {
   modelo = vmodelo;
   ang_x = vang_x;
   x = vx; t_x = vt_x;
   y = vy; t_y = vt_y;
   z = vz; t_z = vt_z;
   ObjetosTotales++;
   }
};

extern Objeto objeto[5000];

#endif

main.cpp
Código:
#include "header.h"
#include "struct.h"

using namespace std;

int Comprobar();

int main(){

cout << "asdasd" << endl;
objeto[ObjetosTotales+1].Nuevo(69,1,1,1,1,1,1,1);
getch();
Comprobar();
getch();

return 0;
}

anadir.cpp
Código:
#include "header.h"
#include "struct.h"

using namespace std;


int Comprobar(){
if(objeto[ObjetosTotales].modelo == 69){
return 1;}

return 0;
}

Errores:
Código:
Vinculando...
anadir.obj : error LNK2005: ya se definió "int ObjetosTotales" (?ObjetosTotales@@3HA) en main.obj
struct.obj : error LNK2005: ya se definió "int ObjetosTotales" (?ObjetosTotales@@3HA) en main.obj
main.obj : error LNK2001: símbolo externo "struct Objeto * objeto" (?objeto@@3PAUObjeto@@A) sin resolver
anadir.obj : error LNK2001: símbolo externo "struct Objeto * objeto" (?objeto@@3PAUObjeto@@A) sin resolver
C:\Documents and Settings\isc\Mis documentos\Visual Studio 2008\Projects\Structs\Debug\Structs.exe : fatal error LNK1120: 1 externos sin resolver
555  Programación / Programación C/C++ / Re: Ayuda con los structs en: 23 Marzo 2013, 14:06 pm
mm no te entiendo, de que archivo borro la linea extern struct Objeto Objeto[5000];
556  Programación / Programación C/C++ / Re: Ayuda con los structs en: 23 Marzo 2013, 14:03 pm
sigue fallando. Msn: blackm4ster@gmail.com
Da el mismo error
557  Programación / Programación C/C++ / Sigue sin funcionarme en: 23 Marzo 2013, 13:53 pm
No se como usarlo, porfavor ayuda:

Main.cpp
Código:
#include "header.h"
#include "struct.h"

using namespace std;

int Comprobar();

int main(){

cout << "asdasd" << endl;
Objeto[ObjetosTotales+1].Nuevo(69,1,1,1,1,1,1,1);
getch();
Comprobar();
getch();

return 0;
}

Struct.h
Código:
#ifndef STRUCTOBJETO_H
#define STRUCTOBJETO_H

int ObjetosTotales = 0;

struct Objeto{
   
float x, y, z;
int modelo;
float t_x, t_y, t_z;
int ang_x;

void Nuevo(int vmodelo, float vx,float vy,float vz,int vang_x,float vt_x,float vt_y,float vt_z) {
   modelo = vmodelo;
   ang_x = vang_x;
   x = vx; t_x = vt_x;
   y = vy; t_y = vt_y;
   z = vz; t_z = vt_z;
   ObjetosTotales++;
   }
};

extern Objeto Objeto[5000];

#endif

añadir.cpp
Código:
#include "header.h"
#include "struct.h"

using namespace std;

extern struct Objeto Objeto[5000];

int Comprobar(){
if(Objeto[ObjetosTotales].modelo == 69){
return 1;}

return 0;
}

Resultado:
Código:
Vinculando...
anadir.obj : error LNK2005: ya se definió "int ObjetosTotales" (?ObjetosTotales@@3HA) en main.obj
struct.obj : error LNK2005: ya se definió "int ObjetosTotales" (?ObjetosTotales@@3HA) en main.obj
main.obj : error LNK2001: símbolo externo "struct Objeto * Objeto" (?Objeto@@3PAU0@A) sin resolver
anadir.obj : error LNK2001: símbolo externo "struct Objeto * Objeto" (?Objeto@@3PAU0@A) sin resolver
558  Programación / Programación C/C++ / (SOLUCIONADO) Ayuda con los structs en: 22 Marzo 2013, 16:54 pm
Estoy creando un juego, necesito un struct que almacene el id del objeto con sus caracteristicas. he creado un header y accediendo solo desde el main funciona bien pero cuando intento acceder a el struct desde otro .cpp falla:

idobjeto.h

Código:
int ObjetosTotales = 0;

struct Objeto{
    
float x, y, z;
GLuint modelo;
float t_x, t_y, t_z;
int ang_x;

   void Nuevo(GLuint vmodelo, float vx,float vy,float vz,int vang_x,float vt_x,float vt_y,float vt_z) {
  modelo = vmodelo;
  ang_x = vang_x;
  x = vx; t_x = vt_x;
  y = vy; t_y = vt_y;
  z = vz; t_z = vt_z;
  ObjetosTotales++;
   }

}Objeto[5000];

Como hago para poder acceder a el desde cualquier .cpp? uso vc++2008
Gracias de antemano porfavor las respuestas lo mas detalladas posibles :)
559  Programación / Programación C/C++ / Ayuda con C++ 2010 error C2664 en: 26 Julio 2012, 11:26 am
Hace poco instalé el visual c++ 2010 y cuando intento compilar algo me da errores como C2664 o como
Código:
main.obj : error LNK2028: se hace referencia al símbolo (token) sin resolver (0A00003E) "extern "C" int __stdcall MessageBoxA(struct HWND__ *,char const *,char const *,unsigned int)" (?MessageBoxA@@$$J216YGHPAUHWND__@@PBD1I@Z) en la función "extern "C" int __cdecl MessageBox(struct HWND__ *,char const *,char const *,unsigned int)" (?MessageBox@@$$J0YAHPAUHWND__@@PBD1I@Z)[code]
nose q mas probar porfavor ayuda xD (cambiando de unicode a multibyte tmapoco se soluciona) Pd: si lo compilo con devc++ funciona perfect el code es el siguiente:
[code]#include <windows.h>

int main()
{
HWND hWnd = FindWindow(0, "Calculator");
  if(hWnd == 0)
{
    MessageBox(0, "Error cannot find window.", "Error", MB_OK|MB_ICONERROR);
  }
else
{
    DWORD proccess_ID;
    GetWindowThreadProcessId(hWnd, &proccess_ID);
    HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, proccess_ID);
    if(!hProcess)
{
      MessageBox(0, "Could not open the process!", "Error!", MB_OK|MB_ICONERROR);
    }
else
{
      int newdata = 500;
      DWORD newdatasize = sizeof(newdata);
      if(WriteProcessMemory(hProcess, (LPVOID)0x57C2A4, &newdata, newdatasize, NULL))
{
        MessageBox(NULL, "WriteProcessMemory worked.", "Success", MB_OK + MB_ICONINFORMATION);
      }
else
{
        MessageBox(NULL, "Error cannot WriteProcessMemory!", "Error", MB_OK + MB_ICONERROR);
      }
      CloseHandle(hProcess);
    }
  }
  return 0;
}
[/code][/code]
560  Programación / Ingeniería Inversa / Re: Hack de Wow 3.3.5a en: 20 Julio 2012, 00:36 am
Si las address que te han tocado son estáticas o pasan por mil pointers realmente no importa xD pd: ahora ls hago con vb2010 express
Páginas: 1 ... 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 [56] 57 58 59 60 61
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines