[VB.Net] Multiple CO's?

08/25/2008 00:28 purplehaze#1
Hello everyone,
Im trying to learn some stuff about memory reading/writing
(I'll Stick with reading for now :P)
I figured out how to read a couple memory addresses like for example money and VP's, but now yes here comes the problem it seems to be unable to read from multiple CO windows!
I know it's so silly!

So my question is how can I solve this any pointers, samples, guides (Just about ANYTHING that helps will do!)

I thank you for your time reading this and maybe the time you take for responding :)
08/25/2008 00:44 Leo_2#2
You would have to create a checklist/itemlist, and make a thread scan for clients, using FindWindowsLike, or something (thats what i did), and just put the client-scan part in a while(true) loop, (make sure to add Threading.Sleep(1000) or so, otherwise it will cause major CPU usage). then after it has scanned for clients, make it add them all to an array and also to your list.

when you want to specify a certain client, you would get the user to click his client, in the checklist/itemlist and then read the item's INDEX, from the list, and read the array's value at the index of the list, containg HWND, or PID or something like that, for example:

void chklst_Click(sender e) //<--cannot remember example args xD
{
for(int i = 0;i<=chklst.Items.Checked-1;i++)
{
ThreadStart(SpeedHack((int)myArray[i]));
}
}

That example code, is based on C#, and just off the top of my head. It would call the ThreadStart function, to every checked item, on the check list, with the arguments of the OTHER array's value at the specified index. (if you dont understand, dont worry - i am very bad at explaining)

And perhaps, in the SpeedHack function, it could have
uint SpeedHack(void* args)
{
while(true){
int speedval = 128;
WriteProcessMemory((int)args,0xSPEEDADDRESS,speedv al,4,null); //<-probably incorrect, just off memory.
Threading.Sleep(1500);
}
}

Maybe that's of some help, im sorry for bad explaining, i tried, but i probably failed and made you more confused.
08/25/2008 00:53 unknownone#3
FindWindowEx
EnumChildWindows
EnumChildProc
...

There's a number of ways to do it. Check those functions out on [Only registered and activated users can see links. Click Here To Register...].
08/25/2008 01:10 purplehaze#4
Thank you both for the replies very appreciated,
Why didnt I think of FindWindowEx thanks a bunch :)

Edit: I remember why i didnt think of that :p
See if i use FindWindowEx It most probably find the same window again instead of the other
So what I want to do is like attach it to the CO process on top, So if the user Alt tabs to a different CO screen the Money, VP's and what not changes to that users stuff
Correct me if im wrong :p

Right now i have this:

Code:
        Dim myProcesses As Process() = Process.GetProcessesByName("Conquer")
        If myProcesses.Length = 0 Then
            MessageBox.Show("No Conquer Client found!")
            Exit Sub
        End If

        Dim processhandle As IntPtr = OpenProcess(PROCESS_ALL_ACCESS, 0, myprocesses(0).Id)
        If processhandle = IntPtr.Zero Then
            Exit Sub
        End If
So maybe this needs a few changes in order to make it read the window on top?
08/25/2008 02:37 unknownone#5
When you use FindWindowEx, you need to set the parent window as the conquer window you previously found, otherwise it'll only find the topmost one. (Setting parent to NULL uses the desktop as the start point)
Code:
for(int i=0;;i++)
{
    if (i==0) hwnd[i] = FindWindowEx(NULL, NULL, NULL, "[Conquer 2.0]");
    else hwnd[i] = FindWindowEx(hwnd[i-1], NULL, NULL, "[Conquer 2.0]");
    if (hwnd[i]==NULL) break;
}
...etc. You get the idea.
08/28/2008 18:39 purplehaze#6
Crap i cant get it to work :( and cant find any VB.Net examples either, I'll keep looking if anyone got an example it would be much appreciated :)