PDA

View Full Version : hLaPEx observation


testdude
18.02.2007, 10:36
well ive been working on an antibot system lately and while debugging hlapex i found a fatal flaw with its design... it hooks ws2_32.connect and changes it to connect to 127.0.0.1 and acts as a proxy between server <-> client... now he flaw is it depends on the authd port always being 2106/2222/5001-4(i think... well its something like that anyway xD).. so yeah, change the authd port to something else and it will detect it as the gameserver port and wont work... anyone with half a brain can get around this tho, but it gets rid of the average 10 year old that wants to crash ur server xP

just thought id share this lil observation with everyone...

mmm well just to make sure i just checked it again xP im pretty sure its 2106/2222 and 5001-4, but yeah u get the idea

dirkr
18.02.2007, 14:10
pretty nice observation..
might really help get rid of the morons that just download hlapex from some cheatsite and just run it without knowing anything..

nice one

DevilsAssociate
18.02.2007, 16:31
sounds interesting

just like changing the protocal or the l2server.exe so the avg botter can't bot :p

thanks for the info

testdude
18.02.2007, 17:52
sounds interesting

just like changing the protocal or the l2server.exe so the avg botter can't bot :p

thanks for the info

its not AS easy as that xD but anyone with an unpacked version of hlapex could get around it...

sparcode
18.02.2007, 18:09
Nice :) Thank you for information, testdude

mcrabben7
18.02.2007, 19:23
Don't forget to block and look out for the new L2PacketHack (l2phx) v3.1.1 by some russians. It's based off hLaPEx design, and it's completely unprotected.

hhk31257
18.02.2007, 22:13
how do you change the auth port client side?
i know it is in engine.dll but not sure how to change it.

thanks for the help!

dirkr
18.02.2007, 23:05
lets put a detailed explenation on how to do it here so all ppl that wanna exploit it can just follow it here step by step ><

TheTester
19.02.2007, 17:08
inside.dpr (sorry for trash in code):
library inside;

uses
Windows,
WinSock,
uBlowFish;

const
WM_COPYDATA=$004A;
WM_DATA=$0400+256;
ID_RECV=0;
ID_SEND=1;
LOOP_PCK=#$04#$01#$01#$01#$7F#$00#$00#$01#$61#$1E# $00#$00#$00#$00#$E2#$05#$88#$13#$01#$00#$00#$00#$0 0#$00#$92#$0C#$E2#$05#$4B#$BD#$6F#$A5;
title='hLaPEx (LineAge Packets EXplorer by Hint)';

type
TSocket=integer;
TLogData = record
IP: String[15];
Port: Cardinal;
end;

var
old_connect: function(s: TSocket; name: PSockAddr; namelen: Integer): Integer; stdcall;
h:integer;
ws:string;
ImageBase: Cardinal;
FileName: array [0..MAX_PATH - 1] of Char;

function new_connect(s: TSocket; name: PSockAddr; namelen: Integer): Integer; stdcall;
var
CDS: TCopyDataStruct;
Data: TLogData;
begin
Data.IP := inet_ntoa(name.sin_addr);
Data.Port := ntohs(name.sin_port);
if not ((Data.Port=2106) or (Data.Port=2222) or ((Data.Port>=5001) and (Data.Port<=5004))) then
begin
CDS.cbData := SizeOf(TLogData);
CDS.lpData := @Data;
h:=FindWindow(nil,PChar(title));
if h=0 then MessageBoxA(0,'hLaPEx not found','Interceptor',MB_ICONERROR);
SendMessage(h, WM_COPYDATA, 0, Integer(@CDS));
name.sin_port:=htons(7777);
name.sin_addr.S_addr:=inet_addr('xx.x.0.1');
end;
Result := old_connect(s,name,namelen);
end;

begin
h:=FindWindow(nil,PChar(title));
if h=0 then
begin
MessageBoxA(0,'hLaPEx not found','Interceptor',MB_ICONERROR);
exit;
end;
ImageBase:=GetModuleHandle(nil);
ZeroMemory(@FileName, SizeOf(FileName));
GetModuleFileName(ImageBase, @FileName, SizeOf(FileName));
ws:='wsock32.dll';
if (Pos('L2WALKER.EXE', AnsiUpper(@FileName))<>0) then ws:='ws2_32.dll';
HookProc(PChar(ws),'connect',@new_connect,@old_con nect);
end.
Hm. Anymore sources? =)

<rus>Учи ассемблер</rus>