462 Posted Topics
How can I get a DLL's Parent Window Title? OR How can I get the PID of the process that loaded my DLL? I need this so I can make a file for each process that loads my DLL but the file has to contain some sort of identifier. Something … | |
Hello everyone. I have a problem with my checksum and logic. I wrote a program that downloads and read bitmaps and try to generate a checksum for each one. The checksum is used as the name to save the bitmap as so that I don't save the same bitmap every … | |
Re: Happens to all of us. It depends on the settings. Visual studio defaults to unicode so every string is prefixed with an L. A couple other stuff like suffix _s. strcpy would be strcpy_s, vsprintf would be vsprintf_s.. etc.. Visual studio code compiles in codeblocks most of the time but … | |
Re: Don't use conio. Also use a vector as the array isn't contingously aligned. A nice constructor to allow dynamic sizing. Also if you wanted it to continously add 10, you have to store the value it was currently at, add 10 to it and add 10 to the initial. I … | |
Why does my checksum not work? I use it on my computer with ATI graphics and it works perfectly fine. When I switch to a computer with Intel graphics, it starts doing random values and they aren't the same. I switch back to my comp, the values are still the … | |
Re: int Smallest(int Array[], int size) { if (size == 1) return Array[0]; int A = Array[0]; for (int I = 0; I < size; I++) A = Array[I] < A ? Array[I] : A; return A; } int Smallest(std::vector<int> Array) { if (Array.size() == 1) return Array[0]; int A = … | |
I keep getting "None of the 6 overloads could convert all arguments". I only get this problem in visual studio though. When I compile with g++ or codeblocks, it works perfectly fine. The code I'm calling my templates with is: `MemDeSerialize(ListOfItems, SerializedData, size_t(Data[2]));` The definitions: template<typename T> void MemDeSerialize(T& Destination, … | |
What are some safe sized datatypes? Inother words, stuff like size_t, uint32_t. They don't seem to change no matter what machine I use. I'm asking because the confusion comes in here: I'm not sure when to use long vs int. I did a sizeof(int) and sizeof(long) and they are both … | |
Re: Link to `gdi32.a` Whenever you get an undefined reference error, it means you don't have the right libraries linked and the linker cannot find your function. In your case: Library Gdi32.lib DLL Gdi32.dll Most of the time, if you do not know the library, search for the function on MSDN: … | |
I currently use this to serialize data, write it to shared memory so that another program can reconstruct it and use it: template<typename T> void Serialize(unsigned char* &Destination, const T &Source) { CopyMemory(Destination, &Source, sizeof(T)); //Destination += sizeof(T); //Not sure if to add this or not. } template<typename T> void … | |
Hey guys, I have two structs and I have two functions in two DLL's. DLL-A is attached to a process and collects data. When the data is requested by DLLB which is attached to a second process, DLLA maps the data for B to read. The problem is, I cannot … | |
I just started shared memory and I took a big dive into it and got stuck trying to figure out how to share pointers. Well not really pointers: void* pData = MapViewOfFile(hMapFile, FILE_MAP_ALL_ACCESS, 0, 0, MapSize); Ok so the above holds my view of the file to be shared between … | |
Hey all. I'm having a problem with a DLL being loaded. In codeblocks, if I don't export Main + ALL the functions in my DLL, they cannot be used by an external program! Yet in visual studio, I exported nothing and external programs are able to load the DLL. Example: … | |
How can I iterate a buffer with a stride? For example, I saved the pointer to a vertex buffer for later use. I've got the stride, the pointer, and triangle count for vertices. I want to iterate my pointer using this info to get the vertices. I'm doing it wrong … | |
What are the last 4 values for? (m[0], m[4], m[8], m[12]) (m[1], m[5], m[9], m[13]) (m[2], m[6], m[10], m[14]) (m[3], m[7], m[11], m[15]) I've looked everywhere and cannot figure out what m[3], m[7], m[11], m[16] are for (ModelView Matrix).. It says to ignore them but I can't just ignore them … | |
How can I reverse a GLTranslate. Example: if glTranslate is called before rendering text to the screen, how can I figure out the position of that text if glTranslate weren't used? The text is rendered to the screen like this: glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB, 7681) glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB, 34168) glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB, 768) glColor4ub(0, … | |
How can I compare Dimensional arrays using iterators? My attempt is below but I gave up and used indexing instead. I plan to change comparing doubles with == to use epsilon later. Also should I be using vector of vectors? //In my class, Data is defined as std::vector<std::vector<double>> Data; bool … | |
In OpenGL, I'm reading about glVertexPointer which has a parameter: `const void* pointer` and it is a pointer to the coordinates of the first vertex. Thing is, it doesn't have any parameters that tell you the amount of vertices there are. I'm wondering if there is a way to copy … | |
I'm trying to generate Unique ID's for a buffer unless they contain the same content. Inother words if the buffer has the same content as another, the ID should be the same; otherwise different. I've found someone using this algorithm for the same kind of buffer: DWORD CalcChecksum(DWORD *pData, int … | |
Re: Wait.. you want to redirect cout to your stream? Or are you trying to redirect your output to the console? cout itself is a stream to the console. You can't just assign it like that. What about using std::streambuf and cout.rdbuf()? | |
Re: > Are you sure you're not a bad programmer? Because your logic is atrocious. ;) LOL.. @OP. I started out with Backtrack but you said you want something from scratch. Does it have to be complicated like PE-Editing notepad/calculator to load a messagebox? Injection? Neat ForkBomb: I also live in … | |
I hooked a game's OpenGL.dll with my own glwrapper but this game uses two dll's.. It uses a wrapper of OpenGL32 and my hook is also a wrapper. So what I need: I want to know if these symbols point to the same functions.. http://i.imgur.com/eMZC5.png @28, @28, @28.. That means … | |
Re: > E:\Dev-Cpp\include\c++\3.4.2\mingw32 It's still using the old thing: E:\Dev-Cpp\include\c++\3.4.2\mingw32 You need to change everything to point to your new mingw/gcc folder. C:/Mingw/Bin/g++ C:/Mingw/Bin/mingw32-g++ C:/Mingw/Bin/gcc C:/Mingw/Bin/mingw32-gcc C:/Mingw/Include C:/Mingw/lib Not sure if I missed any. | |
I've hook a game that uses OpenGL and I'm trying to draw text on the window but when drawn, it has a background that I do not want. Currently i'm using: void glPrint(HDC DC, COLORREF Colour, int X, int Y, const char* format, ...) { if (format == NULL) return; … | |
So... I'm looking into learning Assembly. I downloaded the FASM assembler and I want to know how useful is assembly? I want the opinion from Cpp programmers because assembly programmers always tell me it's the best language -__- Also quick question: How do I know which register to put stuff … | |
How can I get SetConsoleTextAttribute to work with my Console? I tried everything. First I redirected the cout and cin buffers so that my console can have input and output. But now it doesn't have Colour :S I used: HANDLE OutputHandle = GetStdHandle(STD_OUTPUT_HANDLE); SetConsoleTextAttribute(OutputHandle, 10); I don't think GetStdHandle is … | |
How can I create PNG Files from an array of bytes or read a PNG file to create an array of bytes? I looked up the format but it looks nothing like a bitmap and I read the GDI doesn't support PNG's. So how does LibPNG do it then? I … | |
How can I get camera view and Triangle count of models in OpenGL? I know it's a vague question but I'm just starting opengl and none of the tutorials explain how to get the current camera view. I hooked all OpenGL calls for a game and figured out how to … | |
Re: yes. IDA Pro Or OllyDBG can do this for EXE's and DLL's. For Java I used to use CJBE by Contra. | |
I'm learning how to detour-hook functions from tutorials online but when I follow along, my DLL says symbols not found. The error I get says: > Linking dynamic library: bin\Debug\GLHook.dll > Cannot export GLHook_glAccum: symbol not defined > Cannot export GLHook_glAlphaFunc: symbol not defined I don't know why though.. I've … | |
Re: Look into template specialization. I think that may be what you're referring too. | |
I'm having a huge problem trying to learn how to export classes from a DLL. I can do some functions just fine but the classes are mangled :S I've tried from .def file, I've used extern "C" but when I did, it threw errors and won't export the class at … | |
Re: Embedded it inside an internal struct. Not sure if you can use lambda functions here but meh I prefer the internal struct. void RMatrix::RepMatrixf() { const int MAX = 100; // PROBLEM STARTS BELOW struct { void RepMatrix (int NDR, int size, int PosIR, int calls) // PosIR and calls … | |
I have: 39H4-GTT7-LGLN And I'm trying to find every possible combination of sets. Basically each section is scrambled within itself. So there's only 16 combinations for each section. Example the first section I wrote it out as: 39H4 394H 349H 34H9 49H3 4H93 493H 4H39 9H34 934H 943H 9H43 H493 … | |
Re: Link to libwsock32.a and any necessary libraries. In Visual studio you can link by doing `#pragma comment(lib, "libwsock32.a");` | |
I have a Two Test classes that use variadic templates but I made the constructors explicit so that the compiler doesn't convert anything and leave everything as it was. One class was Array and the other was called 2DArray. When I intialize 2DArray, the compiler was converting its arguments to … | |
I'm trying to test my copy con and move con as well as their assignment operators. It NEVER gets invoked :S Copy con gets invoked just fine but the assignment operators are never called and neither is the move constructor. How can I test it to make sure it works … | |
Re: Reading an INI file: http://msdn.microsoft.com/en-us/library/windows/desktop/ms724353%28v=vs.85%29.aspx Use the WINAPI for that unless you plan on doing it manually and iterating through each line and constructing tokens from it. An INI has the sections and the keys. You want to provide the key and get the value under that section for that … | |
> "warning: 'class Debug' has pointer data members but does not override 'Debug(const Debug&)' or 'operator=(const Debug&)' [-Weffc++]" The only pointer member I see here is the HANDLE hTHread. Why should I override my constructors or add a move/copy to this class as the compiler suggests? class Debug { private: … | |
How can I create a Modifiable Const vector but make it unable to be resized? Either that OR I want to return a pointer from a function but not allow the user to delete it. This is my example so far: class MemberRawArrayVector { private: vector<unsigned char> MemberRawArray; public: MemberRawArrayVector(int … | |
Why does the following code skip the initialization of values of the temporary created? Box::Box() : X1(0), Y1(0), X2(0), Y2(0), W((X2 < 0 ? -X2 : X2) - (X1 < 0 ? -X1 : X1)), H((Y2 < 0 ? -Y2 : Y2) - (Y1 < 0 ? -Y1 : Y1)) … | |
Re: 1. You never used NumCount. Thus you loop went infinitely. 2. You never incremented total every time they entered a number. 3. None of your variables were initialized so the values could be anything. 4. If using codeblocks, right click anywhere in the source editor and press format A-Style. Then … | |
I'm a bit confused atm, I don't know when to use const T& or T& or T as a parameter. Currently I'm doing: void Resize(std::vector<T> &Vec, const size_t &NewLength) //Ahh edited the function as a result of Lucaci's answer. { Vec.resize(NewLength); } //But thinking of doing: void Resize(std::vector<T> &Vec, size_t … | |
Re: So let me get this right. Uhh you want to check the position of specific values in the array and keep track of their position? I'd probably use std::multimap from the <map> header. int TestArray[11] = {3, 9, 5, 1, 4, 2, 7, 8, 11, 10, 4}; multimap<int, int> Tracker; … | |
Re: The reason is because at the end of your for-loop, Day will be incremented by 1! In a for-loop, the initialization variable is always incremented at the end! Thus when your for-loop is finished, Day will have a value of 6 and not 5. The solution would be to just … | |
I have the following code to take a bitmap of a portion of the screen specified by the Box Area. Area is just a struct that holds Width, Height, X1, Y1, X2, Y2 and represents a box. Basically a RECT with additional features. For some reason, if Box is (0, … | |
I've just read a tutorial on Classes Under the hood/behind the scenes. It says that: Foo* A = new Foo(); // Is different from: Foo* B = new Foo; What in the world? I never put the brackets for my classes like that. Why does the first initialize variables and … | |
Re: If it has the dots like that, then it's probably a templated class or a class that takes an int in the constructor.. class xx { public: xx(); ~xx(); class func// : public xx { func(int Value){/*do something with value here*/} ~func(){} operator ()(int Value) { /*do something with value … | |
I just learned C++ style casting and the 4 types of casts. I'm not sure if I'm abusing it though. Examples: typedef long (*stringFromString)(int, char*) __cdecl; //TO: typedef long static_cast<*stringFromString>((int, char*)) __cdecl; SmartSetup((char*)World.c_str(), (char*)",f5", 765, 503,(char*)""); //TO: SmartSetup(static_cast<char*>(World.c_str()), static_cast<char*>(",f5"), 765, 503, static_cast<char*>("")); memcpy(&INH, (void*)((DWORD)Buffer + IDH.e_lfanew), sizeof(INH)); TO: memcpy(&INH, static_cast<void*>(static_cast<DWORD>(Buffer) … |
The End.