Xeralize Cheater Reputation: 0
Joined: 17 Jul 2006 Posts: 39
|
Posted: Fri Sep 21, 2007 7:38 pm Post subject: Help with a delphi/pascal filter. |
|
|
Alright, lets get things started. I've been startin to use rPE, another packet editor - much more complicated than wPE. I'm currently using it to spam skills in Ragnarok. It's a custom filter where you get to spam skills.
However there is a downside to this, you freeze for 2 second whenever you click on someone with the skill. I tried to find solutions and I came up with this with the help of some other people.
Here's the code that suppose to not freeze for 2 sec but it's not working due to some errors:
Code: | library rPE_ex;
uses
windows,
Winsock2,
winsock,
rpefuncs;
var
Skill : string;
sock : TSocket;
spamming : boolean;
//CritSect : TRTLCriticalSection;
function SpamSkills( pSendWs1 : Pointer ) : integer;
var
i : integer;
begin
@Send_Callback := pSendWs1;
if not spamming then
begin
//EnterCriticalSection(CritSect);
spamming := true;
//LeaveCriticalSection(CritSect);
for i := 0 to 5 do // the number how often this packet should be send
begin
sleep(150); // delay you can chhose however you like (time in ms)
SendPacket(sock,Skill);
end;
//EnterCriticalSection(CritSect);
spamming := false;
//LeaveCriticalSection(CritSect);
end;
EndThread(0);
result:=0;
end;
function Send_WS1(s: TSocket; var Buf : PChar; len, flags: Integer; pSendWs1, pRecvWs1, pSendWs2, pRecvWs2: Pointer; var IsWorking : Boolean):Integer; stdcall;
var
CurHex: string;
thread1 : integer;
id1 : longword;
begin
CurHex := GetBufferAsHex(buf, len);
if ( pos('7200',CurHex) <> 0 ) and not spamming then
begin
Skill := CurHex;
sock := s;
thread1 := BeginThread(nil,
0,
Addr(SpamSkills),
Addr( pSendWs1 ),
0,
id1);
end;
result := 0;
end;
procedure DLL_Load;
begin
IntLog('C:\asd.txt');
end;
procedure DLL_UnLoad;
begin
Running := false;
EndLog;
end;
procedure DLLMain(dwR: integer);
begin
case dwR of
DLL_PROCESS_ATTACH:
DLL_Load;
DLL_PROCESS_DETACH:
DLL_UnLoad;
end;
end;
exports
Send_WS1;
begin
//InitializeCriticalSection(CritSect);
spamming := false;
Running := true;
DLLProc := @DLLMain;
DLLMain(DLL_PROCESS_ATTACH);
//DeleteCriticalSection(CritSect);
end. |
Somehow it won't work and give all kind of errors. I've been working on like forever and still can't get it fixed. Thus, I would like to ask for help in helping me fix this code, rather than spoonfeeding me the whole thing.
Here's the another custom skill that WORKS but freezes for 2 second whenever i use the skill.
Code: | library rPE_ex;
uses
windows,
Winsock2,
winsock,
rpefuncs;
function Send_WS1(s: TSocket; var Buf : PChar; len, flags: Integer; pSendWs1, pRecvWs1, pSendWs2, pRecvWs2: Pointer; var IsWorking : Boolean):Integer; stdcall;
var
CurHex: string;
i : integer;
begin
CurHex := GetBufferAsHex(buf, len);
if (pos('7200',CurHex) <> 0) and (pos('2E00',CurHex) <> 0) then
begin
@Send_Callback := pSendWs1;
for i := 0 to 300 do // the number how often this packet should be send
begin
sleep(0); // delay you can chhose however you like (time in ms)
SendPacket(s,CurHex);
end;
end;
result := 0;
end;
procedure DLL_Load;
begin
IntLog('D:\rpe_log.log');
end;
procedure DLL_UnLoad;
begin
Running := false;
EndLog;
end;
procedure DLLMain(dwR: integer);
begin
case dwR of
DLL_PROCESS_ATTACH:
DLL_Load;
DLL_PROCESS_DETACH:
DLL_UnLoad;
end;
end;
exports
Send_WS1;
begin
Running := true;
DLLProc := @DLLMain;
DLLMain(DLL_PROCESS_ATTACH);
end.
|
|
|