Public pr_processHandle As IntPtr
Private sendPacketOpcodeAddress, packetAddressLocation, packetSizeAddress As Integer
Private sendPacketOpcode As Byte() =
{&H60,
&HB8, &H0, &H0, &H0, &H0,
&H8B, &HD, &H0, &H0, &H0, &H0,
&H8B, &H49, &H20,
&HBF, &H0, &H0, &H0, &H0,
&H6A, &H0,
&H57,
&HFF, &HD0,
&H61,
&HC3
}
Private Sub LoadSendPacketOpcode()
sendPacketOpcodeAddress = MemFunctions.AllocateMemory(pr_processHandle, sendPacketOpcode.Length)
MemFunctions.MemWriteBytes(pr_processHandle, sendPacketOpcodeAddress, sendPacketOpcode)
Dim functionAddress As Byte() = {&H0, &H68, &HD6, &H40}
Array.Reverse(functionAddress)
Dim realBaseAddress As Byte() = {&H0, &HB4, &HEF, &H34}
Array.Reverse(realBaseAddress)
MemFunctions.MemWriteBytes(pr_processHandle, sendPacketOpcodeAddress + 2, functionAddress)
MemFunctions.MemWriteBytes(pr_processHandle, sendPacketOpcodeAddress + 8, realBaseAddress)
packetAddressLocation = sendPacketOpcodeAddress + 16
packetSizeAddress = sendPacketOpcodeAddress + 21
End Sub
Public Sub sendPacket(ByVal packetLocation As Byte(), ByVal packetSize As Integer)
If sendPacketOpcodeAddress = 0 Then
LoadSendPacketOpcode()
End If
MemFunctions.MemWriteBytes(pr_processHandle, packetAddressLocation, packetLocation)
MemFunctions.MemWriteByte(pr_processHandle, packetSizeAddress, CByte(packetSize))
Dim threadHandle As IntPtr = MemFunctions.CreateRemoteThread(pr_processHandle, sendPacketOpcodeAddress)
MemFunctions.WaitForSingleObject(threadHandle)
MemFunctions.CloseProcess(threadHandle)
End Sub
Have you checked if all the bytes get written correctly?Quote:
Interest, i read about sendpacket and i tried to make a sendpacket class in vb net
can you tell me what is wrong with my code?
the crash in pw occurs when i call function createremotethread ...Code:Public pr_processHandle As IntPtr Private sendPacketOpcodeAddress, packetAddressLocation, packetSizeAddress As Integer Private sendPacketOpcode As Byte() = {&H60, &HB8, &H0, &H0, &H0, &H0, &H8B, &HD, &H0, &H0, &H0, &H0, &H8B, &H49, &H20, &HBF, &H0, &H0, &H0, &H0, &H6A, &H0, &H57, &HFF, &HD0, &H61, &HC3 } Private Sub LoadSendPacketOpcode() sendPacketOpcodeAddress = MemFunctions.AllocateMemory(pr_processHandle, sendPacketOpcode.Length) MemFunctions.MemWriteBytes(pr_processHandle, sendPacketOpcodeAddress, sendPacketOpcode) Dim functionAddress As Byte() = {&H0, &H68, &HD6, &H40} Array.Reverse(functionAddress) Dim realBaseAddress As Byte() = {&H0, &HB4, &HEF, &H34} Array.Reverse(realBaseAddress) MemFunctions.MemWriteBytes(pr_processHandle, sendPacketOpcodeAddress + 2, functionAddress) MemFunctions.MemWriteBytes(pr_processHandle, sendPacketOpcodeAddress + 8, realBaseAddress) packetAddressLocation = sendPacketOpcodeAddress + 16 packetSizeAddress = sendPacketOpcodeAddress + 21 End Sub Public Sub sendPacket(ByVal packetLocation As Byte(), ByVal packetSize As Integer) If sendPacketOpcodeAddress = 0 Then LoadSendPacketOpcode() End If MemFunctions.MemWriteBytes(pr_processHandle, packetAddressLocation, packetLocation) MemFunctions.MemWriteByte(pr_processHandle, packetSizeAddress, CByte(packetSize)) Dim threadHandle As IntPtr = MemFunctions.CreateRemoteThread(pr_processHandle, sendPacketOpcodeAddress) MemFunctions.WaitForSingleObject(threadHandle) MemFunctions.CloseProcess(threadHandle) End Sub
can you help me? thanks in advance
@SᴡooshQuote:
$SEARCH=STRINGREGEXP($DATA,"6A21"&"E8.{8}"&"8BF0"& "83C404"&"85F6"&"74.{2}"&"8A442418"&"668B4C2410"&" 66C7060000"&"88461E"&"8B442408"&"66894E1A"&"D94424 14"&"8B10"&"895602"&"8B4804"&"D80D.{8}"&"894E06"&" 8B5008"&"8B44240C"&"89560A"&"D805.{8}"&"8B08"&"894 E0E"&"8B5004"&"895612"&"8B4008"&"894616"&"E8.{8}"& "668B4C241C"&"6689461C"&"66894E1F"&"8B15(.{8})"&"6 A21"&"56"&"8B4A20"&"E8(.{8})"&"56"&"E8.{8}"&"83C40 4"&"5E"&"C3",2)
I don't have time to write any tutorial - but I can show you how I do it for forsaken world :Quote:
@louco89
take a look in Interest07 wq bot offset finder, theres a regex for sendpacket:
@Sᴡoosh
helpfull answer, why dont you show us nubs how to work with byte patterns and write a excellent tutorial ?
type
TOffsets = record
BaseAddress: Cardinal;
SendPacket: Cardinal;
AttackCall: Cardinal;
CharStruct: Cardinal;
Target: Cardinal;
ActionStruct : Cardinal;
SkillStruct : cardinal;
InventoryStruct : Cardinal;
HP: Cardinal;
HPMax: Cardinal;
MP: Cardinal;
MPMax: Cardinal;
name: Cardinal;
NPCDialog : Cardinal;
WalkStateAddress : Cardinal;
AutoRouteAddress : Cardinal;
end;
type
TSigData = record
Data: array of byte;
Signature: array of byte;
Wildcard: byte;
end;
type
TSigQuerryResult = record
Position: cardinal;
Value: Cardinal;
end;
function TFWOffsetman.GetAddress(Sigdata: TSigData; Readlength: integer): TSigQuerryResult;
var
i, s, Value: Cardinal;
begin
result.Position := 0;
for i := 0 to length(Sigdata.Data) -1 do
begin
s := 0;
for s := 0 to length(Sigdata.Signature) - 1 do
begin
if (Sigdata.Data[i + s] <> Sigdata.Signature[s]) and (Sigdata.Signature[s] <> Sigdata.Wildcard) then
break;
end;
if s = length(Sigdata.Signature) then
begin
result.Position := i;
Copymemory(@Result.Value, @SigData.Data[i + length(Sigdata.Signature)], Readlength);
exit;
end;
end;
end;
Baseaddr: array[0..16] of byte = ($B0, $01, $5E, $C3, $90, $90, $90, $90, $90, $90, $90, $90, $90, $90, $90, $51, $A1);
setlength(Siggy.Signature, length(ActionStruct));
Copymemory(@Siggy.Signature[0], @ActionStruct, length(ActionStruct));
self.LoadedOffsets.ActionStruct := GetAddress(Siggy, 4).value;
Progress := 10;
setlength(Siggy.Signature, length(AutoRouteAddress));
Copymemory(@Siggy.Signature[0], @AutoRouteAddress[0], length(AutoRouteAddress));
Qresult := GetAddress(Siggy, 4);
self.LoadedOffsets.AutoRouteAddress :=
Qresult.position //Physical position of matching pattern starting from 00
+ length(AutoRouteAddress) //length of the pattern
+ $400000 + //Image base, almost always this
Qresult.value // value of 4 bytes following signature
+ 4; // add the 4 bytes we left out for signature
Yes.Quote:
Did you took already a look to this page?
[Only registered and activated users can see links. Click Here To Register...]
Here are Links to all informations like how to search, find and change them.