Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

122 Neutral

About Kranar

  • Rank
  1. Hello, Can someone explain how a program can determine the base address and the length of its own various memory segments? In particular I'd like my program to determine the base address and length of the data segment, and any segment where static/global variables are stored. The motivation for this is that I have been working on a simple mark-sweep garbage collector, and currently it works when the roots are limited to local stack variables, but it obviously fails when the roots also include static/global variables. Any help would be appreciated. Thanks, Kranar
  2. I was wondering what some techniques are for extracting data out of programs like games to retrieve state and other information. Basically I am looking to write a program that can scan through the contents of another program to get stuff like variable data, state, and strings. If anyone knows good ways to go about this, I'd appreciate it. Thanks.
  3. LoadLibraryA worked perfectly, thank you.
  4. I am writing a program in plain C, not C++, but I need to call LoadLibrary to load a DLL. It's really frustrating since LoadLibrary expects an LPCTSTR and will fail when given a plain const char*. The code is basically the following: HINSTANCE hlib = LoadLibrary(libpath); // libpath is a const char* Now libpath must remain a const char*, I do not have control over it. How can I convert it to an LPCTSTR though? The code must remain C, can't use any C++ for this. Thank you.
  5. Kranar

    Online Poker Inspectors.

    None of the poker calculators are able to tell you what an opponent is holding, of course. The servers don't send that kind of information. But if the information is being decoded, how would a program aquire the network traffic? Is there a way to inspect the network traffic of a program? What API would be used?
  6. With the abundance of online poker calculators available, I was wondering how it is that these programs are able to know what cards are held, what opponents are at a table, and basically have access to all the information that the actual program has. At first I thought they just took a snapshot of the program and parsed that information, but a lot of the information they managed to extract and display isn't available graphically. Does anyone know how to peek into other programs to know what they know and have access to all the information that another program has? It would be very interesting to know how this is done.
  7. Hello, I am trying to write a program that takes a screen capture of a video game and analyzes the contents. To do this, the bitmap of the capture is saved into a GDI CBitmap. The problem I'm having is in extracting the pixel data from the CBitmap. It seems that since the bitmap is not device independent, I can not wrap attach the bitmap to a CImage in order to use CImage::GetPixel method. I am very stumped on this problem, the only way around it, is that I use CImage::Save method to save the screenshot into a .bmp file, then load the .bmp file. When the bitmap is saved, it's saved as a device independent bitmap, so when it's reloaded I am able to use CImage::GetPixel. It works, but it's really slow and it's probably a very terrible method to use. If anyone who is familiar with device dependent bitmaps and knows how I can extract individual pixels at exact coordinates from a CBitmap object, I'd appreciate all the help and info you can share.
  8. Kranar

    A simple bmp class

    Actually, looking over GDI, it has some useful functions for doing what I want. Does anyone know, however, how to create a CImage from a CBitmap?
  9. Kranar

    A simple bmp class

    Where can I find a very simple class for C++ that opens a .bmp file, and will allow me to easily see the scan through the pixels of the bitmap in sequential order to see what their values are? I've tried looking but I end up with GDI+ classes, or classes that implement all sorts of complex features, but so far have come up with nothing that allows me to simply check the raw pixel data. Thanks.
  10. Is there a way to get the list of every single window running or atleast visible on the desktop? Just a list of their names, so for example right now I would have something along the lines of a list with: "Post a New Message - GameDev.Net Discussion Forums - Microsoft Internet Explorer" "Someguy - Conversation" "Windows Explorer" "Notepad" Since all of those windows are running as I type this message? Thank you.
  11. Kranar

    Initializing static class members.

    The reason for not wanting a cpp file is that I want to use this class often in many of my MSVC projects. If I make a .cpp file, I have to include the .cpp file in every MSVC project I make. I'd much rather not have to include the .cpp file every time, if I need the class, I can just "#include" it, if I decide not to use it, I can just remove the #include. I really like the class method idea that returns a reference to the static variable.
  12. Let's say I have a class where I absolutely need both the declaration and definition to be in the .h file. I can not split them up into .h and .cpp files. The problem I'm having is that I have a static member in that class that I need to initialize, the member is not a integral type (ie int, char, bool... ...), so I can not initialize it from within the class body. But when I initialize it outside of the class body, I get a really annoying LINKER error: fatal error LKN2005: "private: static class boost::basic_regex TestClass::attributePattern" already defined in a previous module fatal error LNK1169: one or more multiply defined symbols found How can I go about keeping the declaration and definition of a class all within a single .h file, initialize the static member on the class within the .h file, and avoid this linker error? Using "#pragma once" isn't helping either.
  13. Say I have these two classes: class Channel { public: Channel(UTString n, UTString w); virtual ~Channel(void); }; And this one #include "Channel.h" class PublicChannel : public Channel { public: PublicChannel(UTString n, UTString w); ~PublicChannel(void); }; My problem is that when I compile PublicChannel, I get the error saying that Channel doesn't have a default constructor. My question is how do I evoke Channel's constructor (the one that takes in 2 parameters) from within PublicChannel? I really don't want to have to make a default constructor for Channel just to get around this problem. Thanks for the help.
  14. I made a console program in C++ for Windows XP, it's a script engine that reads some simple instructions from a file and executes them in order inside of a loop. When the program runs, though, my entire computer begins to freeze up and when I ALT-TAB to check my Processes, it shows my program hogging 99% of the CPU. The program doesn't need that much CPU to run, how can I somehow get my program to slow down, or to cap how much of the CPU it uses? I want my script engine to run in the background while I use my computer for other stuff. Thanks.
  15. Is it possible to get the number of elements allocated by new[]? As in... assume I did the following... int* x = new int[100]; /* A lot of code */ cout << *number of elements allocated by x* << endl; delete[] x; So that the output would be 100. Surely this number must be stored somewhere since delete[] manages to delete 100 ints safely, so the question is how can I access this number so I know how many elements x points to? Thanks.
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!