Problem mit Header Include [wxWidgets]
-
Hallo,
BIn noch recht neu in C++ und schreibe einen kleinen Game Trainer für FerbySpeed (unbekanntes Game). In der Console hatte alles geklappt, nur jetzt in der Window APP nicht mehr so ganz. Hier ist die Klasse die rein soll:
#include <iostream> #include <windows.h> class Hack { public: Hack(void); void Wallhack(); void RandHack(); void FuelHack(); private: HWND fenster; BYTE wallhack[2]; BYTE randhack[2]; BYTE fuelhack[2]; DWORD prozessid; HANDLE handleprozess; DWORD puffer; }; Hack::Hack(void) { wallhack = {0xEB, 0x07}; // Wallhack randhack = { 0x90, 0x90 }; // RandHack NOP fuelhack = {0xEB, 0x07 }; // FuelHack fenster = FindWindow(NULL, "Ferby-Speed"); GetWindowThreadProcessId(fenster, &prozessid); puffer = NULL; }; void Hack::Wallhack() { handleprozess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, prozessid); WriteProcessMemory(handleprozess,(void*)(0x0046A4A8),&wallhack,sizeof(wallhack),&puffer); CloseHandle(handleprozess); };
Ich include sie an dieser Stelle in der APP: (Projekt2Dlg.h)
//Do not add custom headers between //Header Include Start and Header Include End. //wxDev-C++ designer will remove them. Add custom headers after the block. ////Header Include Start #include <wx/button.h> #include <wx/statbmp.h> ////Header Include End ////Dialog Style Start #undef Project2Dlg_STYLE #define Project2Dlg_STYLE wxCAPTION | wxSYSTEM_MENU | wxDIALOG_NO_PARENT | wxMINIMIZE_BOX | wxCLOSE_BOX ////Dialog Style End #include "Hack.h" // Meine Datei
-
Fehlerbeschreibung vielleicht vergessen?
EDIT: Übrigens solltest du Deklaration und Implementation deiner Klasse besser trennen (Header und cpp).
-
die trennung hatte ich bereits probiert hab es dann weg gemacht um zu testen ob immer noch der Fehler kommt.
Fehler:
Compiler: Default GCC compiler Building Makefile: "C:\Users\Rene\Documents\devc++-projekts\FormsTest\Makefile.win" Executing make... mingw32-make.exe -f "C:\Users\Rene\Documents\devc++-projekts\FormsTest\Makefile.win" all g++.exe -c Project2App.cpp -o Objects/MingW/Project2App.o -I"C:/Program Files (x86)/Dev-Cpp/lib/gcc/mingw32/3.4.5/include" -I"C:/Program Files (x86)/Dev-Cpp/include/c++/3.4.5/backward" -I"C:/Program Files (x86)/Dev-Cpp/include/c++/3.4.5/mingw32" -I"C:/Program Files (x86)/Dev-Cpp/include/c++/3.4.5" -I"C:/Program Files (x86)/Dev-Cpp/include" -I"C:/Program Files (x86)/Dev-Cpp/" -I"C:/Program Files (x86)/Dev-Cpp/include/3rdparty/wx/plotctrl" -I"C:/Program Files (x86)/Dev-Cpp/include/3rdparty/wx/sheet" -I"C:/Program Files (x86)/Dev-Cpp/include/3rdparty/wx/treemultictrl" -I"C:/Program Files (x86)/Dev-Cpp/include/3rdparty/wx/things" -I"C:/Program Files (x86)/Dev-Cpp/include/3rdparty/wx" -I"C:/Program Files (x86)/Dev-Cpp/include/3rdparty" -I"C:/Program Files (x86)/Dev-Cpp/include/common/wx/msw" -I"C:/Program Files (x86)/Dev-Cpp/include/common/wx/generic" -I"C:/Program Files (x86)/Dev-Cpp/include/common/wx/fl" -I"C:/Program Files (x86)/Dev-Cpp/include/common/wx/gizmos" -I"C:/Program Files (x86)/Dev-Cpp/include/common/wx/html" -I"C:/Program Files (x86)/Dev-Cpp/include/common/wx/mmedia" -I"C:/Program Files (x86)/Dev-Cpp/include/common/wx/net" -I"C:/Program Files (x86)/Dev-Cpp/include/common/wx/ogl" -I"C:/Program Files (x86)/Dev-Cpp/include/common/wx/plot" -I"C:/Program Files (x86)/Dev-Cpp/include/common/wx/protocol" -I"C:/Program Files (x86)/Dev-Cpp/include/common/wx/stc" -I"C:/Program Files (x86)/Dev-Cpp/include/common/wx/svg" -I"C:/Program Files (x86)/Dev-Cpp/include/common/wx/xml" -I"C:/Program Files (x86)/Dev-Cpp/include/common/wx/xrc" -I"C:/Program Files (x86)/Dev-Cpp/include/common/wx" -I"C:/Program Files (x86)/Dev-Cpp/include/common" -D__WXMSW__ -D__GNUWIN32__ -D__WIN95__ -fno-exceptions -fno-pcc-struct-return -fstrict-aliasing -Wall -D__WXMSW__ -D__GNUWIN32__ -D__WIN95__ -fexpensive-optimizations -O3 In file included from Project2Dlg.h:38, from Project2App.cpp:11: Hack.h: In constructor `Hack::Hack()': Hack.h:26: error: expected primary-expression before '{' token Hack.h:26: error: expected `;' before '{' token Hack.h:27: error: expected primary-expression before '{' token Hack.h:27: error: expected `;' before '{' token Hack.h:28: error: expected primary-expression before '{' token Hack.h:28: error: expected `;' before '{' token Hack.h:33: warning: converting to non-pointer type `DWORD' from NULL mingw32-make.exe: *** [Objects/MingW/Project2App.o] Error 1 Execution terminated Compilation Failed. Make returned 2
-
Mach's mal so:
wallhack[0] = 0xEB; wallhack[1] = 0x07;
EDIT: Und dein "puffer" solltest du vermutlich auch überdenken (siehe Warnung).
-
ehm du weiß schon dass deine byte deklaration ein array ist? dh darfst du [] nicht vergessen.
bsp:
BYTE Wallhack[] = {0x00, 0x00, 0x00};
dann könntest du wen du WriteProcessMemory benutzt einfach sizeof(Wallhack) benutzen um die anzahl der einträge in dem array zu lesen.
oder einfach dreckt
BYTE Wallhack[2] = {0x00, 0x00, 0x00};
(fängt bei 0 an.)
-
Momo5000 schrieb:
BYTE Wallhack[2] = {0x00, 0x00, 0x00};
(fängt bei 0 an.)
Mit der Angabe sagst du aber, dass du ein Array mit 2 Elementen haben willst und nicht, dass du ein Array bis zum Index 2 (also mit 3 Elementen) haben willst. Nullbasiert hin oder her, bei der Array-Deklaration gibst du die Anzahl an.