I have no idea why he's using edx, but it's not needed to call the function.
Weird I was still seeing the sent packets but with that address at least it no longer crashes. Doesn't seem the packet is being sent (as I'm not getting an appropriate response) but the no crash is great. This is what I have currently:
Code:
public void SendPacket(byte[] packet)
{[INDENT]int packetAddr = (int)this.Dbg.AllocateMemory((uint)packet.Length);
this.Dbg.WriteByteArray(packet, (int)packetAddr);
using (MemoryStream ms = new MemoryStream())
using (BinaryWriter writer = new BinaryWriter(ms))
{
// push packet size
writer.Write((byte)0x68);
writer.Write(packet.Length);
// push packet address
writer.Write((byte)0x68);
writer.Write(packetAddr);
// store NetWorkClass address in ECX
writer.Write((byte)0xB9);
writer.Write(NetworkClass);
// store SendPacket() address in EAX
writer.Write((byte)0xB8);
writer.Write(SendPacketAddress);
// call function stored in EAX
writer.Write(new byte[] { 0xFF, 0xD0 });
// return
writer.Write((byte)0xC3);
this.Dbg.ExecuteCode(ms.ToArray());
}
this.Dbg.FreeMemory(packetAddr);[/INDENT]}
private void HandleSentPacket(ref Helper.CONTEXT ctx)
{[INDENT]if (NetworkClass == 0)
{[INDENT]NetworkClass = ctx.Esi;[/INDENT]}[/INDENT]}
With the encryption change and it being such a 'valuable' secret.... hook based bots are going to take over and essentially remove the viability of making proxies and in the long term the progress of private servers (at least in terms of patches, we've already seen the stagnation in coding practices and source choices).
Not sure if this is a good thing or not... but it will be interesting none the less.
Maybe I'll re-write my ProxyParadise base into a hook based solution and continue the guides from there as I was already moving on to packets and actual bot systems which would work exactly the same way on a hook based bot...
With the encryption change and it being such a 'valuable' secret.... hook based bots are going to take over and essentially remove the viability of making proxies and in the long term the progress of private servers (at least in terms of patches, we've already seen the stagnation in coding practices and source choices).
Not sure if this is a good thing or not... but it will be interesting none the less.
Maybe I'll re-write my ProxyParadise base into a hook based solution and continue the guides from there as I was already moving on to packets and actual bot systems which would work exactly the same way on a hook based bot...
It's still possible to make a private server for the current (and future) version(s) of CO, even if you don't know the encryption routines at all. Just hook/detour the SendPacket function inside the client with an injected DLL, and replace the original encryption with your own custom encryption.
Same goes for receiving packets, hook the function in the client where it decrypts server packets and replace with your own decryption routine
I have no idea why he's using edx, but it's not needed to call the function.
The SendPacketAddress works fine for me and I can map the packet based on my old proxy packet structure. But the receivepacket seems wont work on the entity other than my character. It won't logs the activity caused by other entity like action, character spawn and etc.
This part is working fine :
Code:
Private Sub HandleSentPacket(ByRef ctx As CONTEXT)
If NetworkClass = 0 Then NetworkClass = ctx.Esi
Dim lpPacket As Integer = Me._dbg.ReadInt32(ctx.Esp + 4)
Dim Size As Integer = Me._dbg.ReadInt32(ctx.Esp + 8)
Dim data() As Byte = Me._dbg.ReadByteArray(lpPacket, Size)
Dim mPacket As packet.myPacket
mPacket = New packet.myPacket(Data)
If Packet.Chat.IsThisType(mPacket) Then
Dim mchat As packet.Chat = New packet.Chat(mPacket)
' mchat.Message = "123"
End If
If packet.Action.IsThisType(mPacket) Then
Dim maction As packet.Action = New packet.Action(mPacket)
' Blah blah
' Blah blah
End If
End If
Me._dbg.WriteByteArray(data, lpPacket)
End Sub
This part will not update on any activities cause by other entity:
Code:
Private Sub HandleRecvPacket(ByRef ctx As CONTEXT)
Dim lpPacket As Integer = Me._dbg.ReadInt32(ctx.Esp + 4)
Dim Size As Integer = Me._dbg.ReadInt32(ctx.Esp + 8)
Dim data() As Byte = Me._dbg.ReadByteArray(lpPacket, Size)
Dim mPacket As packet.myPacket
mPacket = New packet.myPacket(data)
If packet.CharacterInformation.IsThisType(mPacket) Then
Dim CharInfo As packet.CharacterInformation = New packet.CharacterInformation(mPacket)
mychar = New character(CharInfo)
charInfoIsLoadedFlg = True
AddUpdateNearbyEntities(CharInfo.FirstName, CharInfo.AcountID, 0, 0)
End If
If packet.CharacterSpawning.IsThisType(mPacket) Then
'Dim charspawn As packet.CharacterSpawning = New packet.CharacterSpawning(mPacket)
'AddUpdateNearbyEntities(charspawn.CharacterName, charspawn.CharacterID, charspawn.CharacterCoordX, charspawn.CharacterCoordY)
'If charspawn.CharacterStatus = &H4200000000000C8 Then
' UpdateDeathAliveChar(charspawn.CharacterID, 0)
'Else
'UpdateDeathAliveChar(charspawn.CharacterID, 1)
'End If
End If
If packet.GeneralData.IsThisType(mPacket) Then
Dim gendata As packet.GeneralData = New packet.GeneralData(mPacket)
If gendata.DataType = 137 Then
Me.OnCharMovement = True
AddUpdateNearbyEntities(getName(gendata.EntityID), gendata.EntityID, gendata.CoordX, gendata.CoordY)
End If
End If
If packet.Walk.IsThisType(mPacket) Then
Dim mwalk As packet.Walk = New packet.Walk(mPacket)
UpdateNearbyEntitiesWalking(mwalk)
End If
If packet.EntityStatus.IsThisType(mPacket) Then
Dim estat As packet.EntityStatus = New packet.EntityStatus(mPacket)
If estat.StatusType = 25 Then
If estat.StatusValue = 32 Then
UpdateDeathAliveChar(estat.CharacterID, 0)
ElseIf estat.StatusValue = 0 Then
UpdateDeathAliveChar(estat.CharacterID, 1)
End If
End If
End If
End Sub
I am using these addresses(I am clueless also on how did you guys get that values):
SendPacketAddress= &H6DFEE2
RecvPacketAddress= &H6E2809
This part will not update on any activities cause by other entity:
Code:
Private Sub HandleRecvPacket(ByRef ctx As CONTEXT)
Dim lpPacket As Integer = Me._dbg.ReadInt32(ctx.Esp + 4)
Dim Size As Integer = Me._dbg.ReadInt32(ctx.Esp + 8)
Dim data() As Byte = Me._dbg.ReadByteArray(lpPacket, Size)
Dim mPacket As packet.myPacket
mPacket = New packet.myPacket(data)
If packet.CharacterInformation.IsThisType(mPacket) Then
Dim CharInfo As packet.CharacterInformation = New packet.CharacterInformation(mPacket)
mychar = New character(CharInfo)
charInfoIsLoadedFlg = True
AddUpdateNearbyEntities(CharInfo.FirstName, CharInfo.AcountID, 0, 0)
End If
If packet.CharacterSpawning.IsThisType(mPacket) Then
'Dim charspawn As packet.CharacterSpawning = New packet.CharacterSpawning(mPacket)
'AddUpdateNearbyEntities(charspawn.CharacterName, charspawn.CharacterID, charspawn.CharacterCoordX, charspawn.CharacterCoordY)
'If charspawn.CharacterStatus = &H4200000000000C8 Then
' UpdateDeathAliveChar(charspawn.CharacterID, 0)
'Else
'UpdateDeathAliveChar(charspawn.CharacterID, 1)
'End If
End If
If packet.GeneralData.IsThisType(mPacket) Then
Dim gendata As packet.GeneralData = New packet.GeneralData(mPacket)
If gendata.DataType = 137 Then
Me.OnCharMovement = True
AddUpdateNearbyEntities(getName(gendata.EntityID), gendata.EntityID, gendata.CoordX, gendata.CoordY)
End If
End If
If packet.Walk.IsThisType(mPacket) Then
Dim mwalk As packet.Walk = New packet.Walk(mPacket)
UpdateNearbyEntitiesWalking(mwalk)
End If
If packet.EntityStatus.IsThisType(mPacket) Then
Dim estat As packet.EntityStatus = New packet.EntityStatus(mPacket)
If estat.StatusType = 25 Then
If estat.StatusValue = 32 Then
UpdateDeathAliveChar(estat.CharacterID, 0)
ElseIf estat.StatusValue = 0 Then
UpdateDeathAliveChar(estat.CharacterID, 1)
End If
End If
End If
End Sub
I am using these addresses(I am clueless also on how did you guys get that values):
SendPacketAddress= &H6DFEE2
RecvPacketAddress= &H6E2809
Hope someone will enlighten me. Thanks.
The way you're reading the packet is correct, it's most likely something in your packet classes that's wrong. Also, for your packet handler, I suggest using something a little more managable, like this:
Code:
Private Sub HandleRecvPacket(ByRef ctx As CONTEXT)
Dim lpPacket As Integer = Me._dbg.ReadInt32(ctx.Esp + 4)
Dim Size As Integer = Me._dbg.ReadInt32(ctx.Esp + 8)
Dim data() As Byte = Me._dbg.ReadByteArray(lpPacket, Size)
Dim PacketType As Short = BitConverter.ToInt16(data, 2)
Select Case PacketType
Case &H271A '(General data)
Dim DataPacket As New Packet.GeneralData(data)
Select Case DataPacket.SubType
Case &H89 '(Jump)
OnJump(DataPacket)
End Select
Case &H2715
OnWalk(New Packet.WalkPacket(data))
End Select
End Sub
It's still possible to make a private server for the current (and future) version(s) of CO, even if you don't know the encryption routines at all. Just hook/detour the SendPacket function inside the client with an injected DLL, and replace the original encryption with your own custom encryption.
Same goes for receiving packets, hook the function in the client where it decrypts server packets and replace with your own decryption routine
Yah.... cause people involved with pserver coding are
Yah.... cause people involved with pserver coding are
A: capable
B: willing
to put that much effort into their servers xD
(few exceptions)
True, although I'd say that it would be an easier approach than trying to reverse the encryption. That depends on one's level of reversing knowledge though, of course.
The receive address is wrong I believe as it seems to point to the same function as the send address. It was just a guess on my end as I don't know what to look for either.
Once I move into my boss' house tomorrow I'll have a **** ton of boredom and free time so I'll prob whip something together with this so I can continue with the bot tutorials.
[RELEASE] Make a more Advanced NPC 02/02/2011 - CO2 PServer Guides & Releases - 55 Replies This guide will show you how to make a NPC. I will update this post daily with new things to add to your NPC.
First. We are going to take this NPC from Paralyzer and modify this a little bit. here is the link if you have never made a simple NPC.
http://www.elitepvpers.com/forum/co2-pserver-guide s-releases/492901-release-how-code-decent-npc-npcs -txt-entry.html
Easiest stuff first.
How to make an NPC check for a specific level.
To make an NPC check for a level we can do this by adding...
Advanced Tribalwars Bot Release 05/31/2010 - Browsergames - 20 Replies Ein Bot für das Browsergame "Die Stämme".
Features:
Multiaccountfähig
baut Dörfer selbstständig aus
Bot merkt sich, wann ein Gebäude gebaut werden kann, bzw. wann es fertiggestellt ist
Information: Bei "Server" z.B. de60.die-staemme.de o.ä. eingeben.
ReViSiOn [Advanced Public Release] 02/13/2009 - WarRock Hacks, Bots, Cheats & Exploits - 5 Replies http://i295.photobucket.com/albums/mm150/gfx_forum s/revvv3.png
ReViSiOn Public Beta 1.2
_____
Working features:
No Recoil
No Spread