Register for your free account! | Forgot your password?

You last visited: Today at 23:50

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Help for sending packets

Discussion on Help for sending packets within the PW Hacks, Bots, Cheats, Exploits forum part of the Perfect World category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jan 2012
Posts: 3
Received Thanks: 0
Help for sending packets

Hello Dear programmers, botovody!
I am a novice programmer, and started programming in the language of Delphi!
there is a couple of my works !
But another question!
I would like to implement the sending of packages to craft nirvana clothing, weapons. But I have a problem with traffic light emitted from the fact that the package that I send a very large ie 256 characters!
Please help or point me where to look! that used
вот код которым я пользуюсь :
Code:
///////////////////////////////////////////////////
procedure InjectFunc(ProcessID: Cardinal; Func: Pointer; aParams: Pointer; aParamsSize: DWORD);
var
  hThread: THandle;
  lpNumberOfBytes: DWORD;

  ThreadAddr, ParamAddr: Pointer;
begin
  if ProcessID<>0 then
  begin
    // ---- Write function address
    ThreadAddr := VirtualAllocEx(ProcessID, nil, 438, MEM_COMMIT or MEM_RESERVE, PAGE_EXECUTE_READWRITE);
    WriteProcessMemory(ProcessID, ThreadAddr, Func, 438, lpNumberOfBytes);

    // ---- Address to write parameters
    ParamAddr := VirtualAllocEx(ProcessID, nil, aParamsSize, MEM_COMMIT or MEM_RESERVE, PAGE_EXECUTE_READWRITE);
    WriteProcessMemory(ProcessID, ParamAddr, aParams, aParamsSize, lpNumberOfBytes);

    // ---- Create a remote thread
    hThread := CreateRemoteThread(ProcessID, nil, 0, ThreadAddr, ParamAddr, 0, lpNumberOfBytes);

    // ---- Thread to wait for the end of
    WaitForSingleObject(hThread, 3000);

    VirtualFreeEx(ProcessID,ThreadAddr,0,MEM_RELEASE);
    VirtualFreeEx(ProcessID,ParamAddr,0,MEM_RELEASE);
    VirtualFreeEx(ProcessID,Func,0,MEM_RELEASE);
    VirtualFreeEx(ProcessID,aParams,0,MEM_RELEASE);

    CloseHandle(hThread);
  end
end;

//////////////////////////////////////////////////////////////
procedure PacketCall(aPParams:PParams); stdcall;
var
CallAddress,pPacket,_BASE_ADD_,_Ofs,_SendPacket:Pointer;
Len:DWord;
begin
_SendPacket:=aPParams^.SendPacket;
CallAddress:=Pointer(_SendPacket); //адрес был устаревший
Len:=aPParams^.Param1;
_BASE_ADD_:=aPParams^.BASE_ADD;
_Ofs:=aPParams^.Ofs;
pPacket:=@aPParams^.Packet;
 asm
 pushad
 mov ecx, _BASE_ADD_
 mov ecx, dword ptr [ecx]
 mov esi, _Ofs
 mov ecx, dword ptr [ecx+esi] //20
 push Len
 push pPacket
 call CallAddress
 popad
 end;
end;

procedure StrToByte(Packet:string; var aParams:TParams);
var
i:integer;
begin
i:=(length(Packet) div 2)-1;
aParams.Param1:=i+1;
 for i:=0 to i do
 aParams.Packet[i]:=strtoint('$'+Packet[i*2+1]+Packet[i*2+2]);
end;

procedure Packet(Packet: string);
var
aParams: TParams;
  PID, hProcess: DWord;
begin
  aParams.BASE_ADD := Pointer(BASE_ADD);
  aParams.Ofs :=Pointer(OffSets_Uchastvuelvotpravkepaketa);
  aParams.SendPacket:= Pointer(OffSets_SendPacket);
  GetWindowThreadProcessId(WID, @PID);
  hProcess:=OpenProcess(PROCESS_ALL_ACCESS, False, PID);
StrToByte(Packet,aParams);
InjectFunc(hProcess,@PacketCall,@aParams,sizeof(aParams));
CloseHandle(hProcess); //забыл дописать
end;
Thanks in advance! And sorry for my bad english .. I just do not know the English language and simply translated using google
rufat2005 is offline  
Old 05/11/2012, 12:00   #2
 
Sᴡoosh's Avatar
 
elite*gold: 20
Join Date: May 2009
Posts: 1,290
Received Thanks: 326
Did you set breakpoint on CreateRemoteThread and checked ingame if functions/parameters where written correctly? I didn't check your whole source - just some things I noticed at first glance :

Code:
    VirtualFreeEx(ProcessID,Func,0,MEM_RELEASE);
    VirtualFreeEx(ProcessID,aParams,0,MEM_RELEASE);
Not needed, this is a local variable reference - you can leave this out. You only need to free the forgein ram again, which you did here :

Code:
    VirtualFreeEx(ProcessID,ThreadAddr,0,MEM_RELEASE);
    VirtualFreeEx(ProcessID,ParamAddr,0,MEM_RELEASE);
Why do you use string as parameter for your packet function? And why do you allocate exactly 438 byte for function? Seems a bit high to me - but certainly not the cause of crash.

Best for you really is to do what I suggested at start - set breakpoint and check if all is written well before you CRT it.

Cheers
Sᴡoosh is offline  
Reply


Similar Threads Similar Threads
Sending Packets
03/26/2019 - PW Hacks, Bots, Cheats, Exploits - 432 Replies
As per Smurfin's request: reposting of what I posted in the Prophet's bot thread. some example of functions you could use with sending packets (AutoIt code, see link below for C#): ;////Code for sending packets.
[AutoIT] Sending Packets Help
10/10/2012 - SRO Coding Corner - 53 Replies
With edxloader i got this : (Sit - Stand recorded) 04 Now, in AutoIt, i think that it need to look like this, but i dont know what to write in "?????" to send packet for sit - stand command .
Help with sending packets in autoit
08/16/2010 - AutoIt - 1 Replies
ive been lookin around different sites for ways to send packets to the game server. the only examples i see is to create a server and a client which i dont need, i think. well to the point now, can someone lead me in a direction or tell me how to send packets to a game? also if i send packets then that means i dont need the game to be active, correct? Because in autoit when u use keys u need to have the game active, and control send does not work. ty
Sending Packets !!!
09/07/2008 - Kal Online - 14 Replies
now i know how to sniff / analyse packets ... but what then ? :) how can i send packets ?? to pimp or mix weapon for example i just need the way to send , and then i can depend on myself :D
Sending packets
10/12/2005 - Conquer Online 2 - 10 Replies
I've a question. Is it possible to send 1 packet multiple times at the exact same time?



All times are GMT +1. The time now is 23:51.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.