Quote:
Originally Posted by IAmHawtness
Hahahaha, yeah well.. I'm hooking the send/recv functions and then the "shift-click function" for my targeting system and the "limit fps function" for my fps unlocker :p
|
After reading your guide I now am less of a dumbass and realize that I can read from memory without actually hooking a function.
IE: I was about to try to make a hook to pull the character name instead of simply using the readstring method you already added.
/facepalm
After searching my intelligence for longer than I care to admit I got the Name/ID showing in my fancy select process list (I hate using windows forums with a passion... Consoles are just so warm and cozy! :P)
Not used to not being able to create fancy little structs/classes for holding data (IE: Character Name/Process ID) and using that for my selection system. And yes, I'm well aware I could google a bit and enlighten myself but using string formatting works nicely enough for me (Yes... I'm being lame and doing PID: Name and then using Split(':')[0] to pull the PID lol!)
Now to actually write some botting stuff! Maybe if I feel ambitious I can finally do a Map HUD. Always wanted to do one but been too terrified of windows forums to attempt it ahaha.
<edit>
ok so I'm running into a slight issue...
Is there some reason why I cannot re-attach to a debuggee even after I've used DetachDebugger();?
Essentially what I'm doing is when I open the program or click the refresh button I'm running my refresh code to populate my dropdown menu of clients running on the computer.
Code:
public void RefreshList()
{
Debuggee Me;
PIDList.Items.Clear();
foreach (Process ID in Process.GetProcessesByName("Conquer"))
{
Me = new Debuggee(ID.Id);
Me.AttachDebugger();
string Text = ID.Id + ": ";
string Add = Me.ReadString(0x8D5D66, (uint)16).Replace("/0", "");
if (Add.Length > 1)
Text += Add;
else
Text += "Not Loaded";
PIDList.Items.Add(Text);
Me.DetachDebugger();
}
if (PIDList.Items.Count > 0)
PIDList.Text = "Select a Process";
else
PIDList.Text = "No Client Found";
}
Using that code works perfectly fine. It frees up the process unlike if I use the COClient code posted. Obviously that's cause it's hooking the send/receive function meaning if I force close the bot it will close out the client and inversely if I hook without setting up my event handlers it won't send/receive packets so cannot connect. I understand that part. What I don't understand is why when using the DetachDebugger() I cannot then re-attach later say... if I click the refresh button.
So basically... I open the client and login then open the bot and it will show the Process ID: Char Name without issue... if I open the client, open the bot and then log in it will still say Process ID: Not Loaded.
<edit again>
Hmm... client likes to crash now randomly. After about 30-60 seconds of being logged in it just dies. Good times :P
I changed the way I was reading packets so that it creates a copy of the packet just incase I was unintentionally editing it causing crashy crash issues lol.
I'm not sending any packets at all so it's not an issue with that.
Yay for debugging w/o my handy dandy console :P
<edit for the last time... I swear (not)>
So I'm failwhail.
The crashing was caused by the hooker not detaching from the original list. If I log into the game fully and THEN run the selector, select my character and open up the botting window it seems to work perfectly fine.
For now I'm gonna remove the hooking code in the selector and try again cause much of my code is still packet based so I wanna be able to read those packets during login.
<Going to bed after this edit>
So now that it's not crashing I decided to start adding in some botting code. I got a bunch of gui stuff added and stuff but am running into an issue sending packets.
Obviously the posted examples don't contain a send packet method so I'm attempting to write my own but not having done anything with memory edits before I have no clue what I'm doing.
I tried using the WriteByteArray method but it seems to crash the client (going to bed so I haven't messed with it much but w/e).
Example packet attempt
Code:
public static void LootItem(Client C, GroundItem I)
{
byte[] Pack = new byte[32];
PacketHandler.WriteUInt16((ushort)(Pack.Length - 8), 0, Pack);
PacketHandler.WriteUInt16(1101, 2, Pack);
PacketHandler.WriteUInt32(I.UID, 4, Pack);
PacketHandler.WriteUInt32(C.UID, 8, Pack);
PacketHandler.WriteUInt16(I.X, 12, Pack);
PacketHandler.WriteUInt16(I.Y, 14, Pack);
PacketHandler.WriteUInt16(3, 18, Pack);
PacketHandler.WriteString("TQClient", 24, Pack);
C.Owner.Hooked.Dbg.WriteByteArray(Pack, 0x688F46);
}
I assumed (incorrectly it seems) that I could just write to memory at the send function. But obviously it's not as simple as that :P