avatar_Sm0uk

Новый чит для MU Online - Teleport, Hitcount, Autokill, Autopickup и многое другое от брата Catastro

Автор Sm0uk, 2010 Янв. 09, 16:09

« назад - далее »

0 Пользователи и 1 гость просматривают эту тему.

boloto


KamatoZ

А кули его искать? Название есть и вперед. Нехватает сообщений - полазь по форуму пообщайся)

boloto

Я понимаю полазь, пообщайся, но есть те у кого она есть и особого труда не стоит ее выкинуть!   Я если честно не пойму зачем эти хайди на программы ??  Ведь анти чити все равно их блочат" Надо хайдить способы их обхода !    И все такие умные, а на форуме не одного примера не увидел как обойти  серьезную защиту !  ИЛИ все так сильно переживают за сервера??    Да бросто тут многие могут ток балаболить а на деле  0 !!

dn0

#283
Если здесь нет примеров как обойти серьезную защиту,тогда лезь в гугл и ищи инфу,на зарубежных форумах её хватает.

KamatoZ

Да и накой х... комуто здесь палить свои методы обхода античита если почти 70% а может и больше админов сидят на этом форуме)

Попросили прогу я выложил, а как сделать так что б она работала и не палилась тут уже ваш полет фантазий.

boloto

А ссылочку можно на хоть один норм зарубежный форум ?

AndOrXor

#286
вот.. часть исходного кода - в ознокомителних целях
Цитироватьhttps://www.sendspace.com/file/3ks27v

если хотите тестить на GMO - то:
unit Sproxy;

interface

Uses
Windows, SysUtils, ScktComp, WinSock;

type
TServerProxy = object
procedure OnConnect(Sender: TObject; Socket: TCustomWinSocket);
procedure OnDisconnect(Sender: TObject; Socket: TCustomWinSocket);
procedure OnError(Sender: TObject; Socket: TCustomWinSocket; ErrorEvent: TErrorEvent; var ErrorCode: Integer);
procedure OnRead(Sender: TObject; Socket: TCustomWinSocket);

procedure OnClientConnect(Sender: TObject;Socket: TCustomWinSocket);
procedure OnClientError(Sender: TObject; Socket: TCustomWinSocket; ErrorEvent: TErrorEvent; var ErrorCode: Integer);
procedure OnClientRead(Sender: TObject; Socket: TCustomWinSocket);
end;

procedure DisconnectServerProxy;
procedure StartProxy;
procedure Redirect(P: Pointer); stdcall;

var
Client2:     TClientSocket;  {55901}
Server2:     TServerSocket;  {55901}
Game2:       TServerProxy;
ToServer:    Byte = 0;
ToClient:    Byte = 0;
Hello:       Boolean = True;
SProxyConnected: Boolean = False;
RedTHID: Cardinal;
Rid: Integer;

implementation

Uses
Gproxy, uMainFrm, uEncDec;// uGGEmulator;

{===============================================================================


===============================================================================}
procedure TServerProxy.onConnect(Sender: TObject; Socket: TCustomWinSocket);
begin

end;
{===============================================================================


===============================================================================}
procedure TServerProxy.OnDisconnect(Sender: TObject; Socket: TCustomWinSocket);
begin

end;
{===============================================================================


===============================================================================}
procedure TServerProxy.OnError(Sender: TObject; Socket: TCustomWinSocket; ErrorEvent: TErrorEvent; var ErrorCode: Integer);
begin
if ((ErrorCode = 10053) or (ErrorCode = 10054)) then
OnDisconnect(Sender, Socket)
else
MainFrm.Log(Format('OE:%d',[ErrorCode]));
ErrorCode := 0;
end;
{===============================================================================


===============================================================================}
procedure TServerProxy.OnRead(Sender: TObject; Socket: TCustomWinSocket);
var
i,j,e: Integer;
Len, PLen, DecLen: Longint;
Data: TByteArray;
//GameGuardKey,SendGameGuardKey: TGG_Key;
Key: TBytes;
begin
{ if (Socket.Addr.sin_addr.S_addr = inet_addr(PAnsiChar(AnsiString(Zhyper1)))) or
(Socket.Addr.sin_addr.S_addr = inet_addr(PAnsiChar(AnsiString(Zhyper2)))) or
(Socket.Addr.sin_addr.S_addr = inet_addr(PAnsiChar(AnsiString(Zhyper3)))) or
(Socket.Addr.sin_addr.S_addr = inet_addr(PAnsiChar(AnsiString(Zhyper4)))) then
begin
Socket.Close;
Exit;
end;   <--- zhypermu not allowed
}
PLen := Socket.ReceiveBuf(Data,Socket.ReceiveLength);
if  PLen < 3 then
exit;
i := 0;
while (i < (PLen - 1)) do
begin
Len := 0;
case Data[I] of
$C1: begin
Len := Data[i + 1];
DecodeC1(@Data[i],0,Len);
Encodec1(@Decryptresult,0,Len);

if (Server2.Socket.ActiveConnections > 0) then
if (Server2.Socket.Connections[0].Connected) then
Server2.Socket.Connections[0].SendBuf(Data[i],Len);
end;
$C2: begin
Len := (Data[I + 1] shl 8) + Data[i + 2];
DecodeC1(@Data[i],0,Len);
Encodec1(@Decryptresult,0,Len);

if (Server2.Socket.ActiveConnections > 0) then
if (Server2.Socket.Connections[0].Connected) then
Server2.Socket.Connections[0].SendBuf(Data[i],Len);
end;
$C3: begin
Len := Data[i + 1];
//DecLen := MU_DecodeC3C4(@Data[i],False,Len);
//MainFrm.SendC3(@DecryptResult,DecLen,False);

if (Server2.Socket.ActiveConnections > 0) then
if (Server2.Socket.Connections[0].Connected) then
Server2.Socket.Connections[0].SendBuf(Data[i],Len);
end;
$C4: begin
Len := (Data[i + 1] shl 8) + Data[i + 2];
// DecLen := MU_DecodeC3C4(@Data[i],False,Len);
// MainFrm.SendC3(@DecryptResult,DecLen,False);

if (Server2.Socket.ActiveConnections > 0) then
if (Server2.Socket.Connections[0].Connected) then
Server2.Socket.Connections[0].SendBuf(Data[i],Len);
end;
end;
if Len = 0 then
Exit;
i := i + Len;
end;
end;
{===============================================================================


===============================================================================}
procedure TServerProxy.OnClientRead(Sender: TObject; Socket: TCustomWinSocket);
var
i,j: Integer;
Len, PLen, DecLen: Integer;
Data: TByteArray;
begin
PLen := Socket.ReceiveBuf(Data,Socket.ReceiveLength);
if PLen < 3 then
exit;
i := 0;
while (i < (PLen - 1)) do
begin
Len := 0;
case Data[i] of
$C1: begin
Len := Data[i + 1];
DecodeC1(@Data[i],0,Len);
Encodec1(@Decryptresult,0,Len);
if Client2.Active then
Client2.Socket.SendBuf(Data[i],Len);
end;
$C2: begin
Len := (Data[i + 1] shl 8)+ Data[i + 2];
DecodeC1(@Data[i],0,Len);
Encodec1(@Decryptresult,0,Len);
if Client2.Active then
Client2.Socket.SendBuf(Data[i],Len);
end;
$C3: begin
Len := Data[i + 1];
// DecLen := MU_DecodeC3C4(@Data[I],True,Len);
// MainFrm.SendC3(@DecryptResult,DecLen,True);

if Client2.Active then
Client2.Socket.SendBuf(Data[i],Len);

end;
$C4: begin
Len := (Data[i + 1] shl 8) + Data[i + 2];
//DecLen := MU_DecodeC3C4(@Data[I],True,Len);
// MainFrm.SendC3(@DecryptResult,DecLen,True);

if Client2.Active then
Client2.Socket.SendBuf(Data[i],Len);

end;
end;
if Len = 0 then
Exit;
i := i + Len;
end;
end;
{===============================================================================


===============================================================================}
procedure TServerProxy.OnClientConnect(Sender: TObject; Socket: TCustomWinSocket);
begin
if SProxyConnected then
begin
Exit;
end;
try
Client2.Port    := PlayPort;
if CharInSet(PlayIP[1], ['a'..'z']) or CharInSet(PlayIP[1], ['A'..'Z']) then
Client2.Host := string(AnsiString(PlayIP))
else
Client2.Address := string(AnsiString(PlayIP));
Client2.Open;
except
on E: Exception do
begin
MainFrm.Log('OCC Error: '+E.Message);
Exit;
end;
end;
SProxyConnected := True;
ToServer := 0;
ToClient := 0;
MainFrm.Log('Sproxy Connected');
end;
{===============================================================================


===============================================================================}
procedure TServerProxy.OnClientError(Sender: TObject; Socket: TCustomWinSocket; ErrorEvent: TErrorEvent; var ErrorCode: Integer);
begin
DisconnectServerProxy;
try
except
Rid := BeginThread(nil,0,@Redirect,nil,0,RedTHID);
end;
// MainFrm.Log(Format('OCError:%d',[ErrorCode]));
ErrorCode := 0;
end;
{===============================================================================


===============================================================================}
procedure DisconnectServerProxy;
begin
if SProxyConnected = False then
begin
Exit;
end;
SProxyConnected := False;

ToServer := 0;
ToClient := 0;

MainFrm.Log('Sproxy Disconnected!');

Client2.Active := False;
if Server2.Socket.ActiveConnections > 0 then
Server2.Socket.Connections[0].Close;
end;
{===============================================================================


===============================================================================}
procedure StartProxy;
begin
PlayIP := '';
PlayPort := 0;
try
//    Server2.Port := GamePort;
//    Server2.Open;
except
on E: Exception do
begin
//      MainFrm.Log('SP Error: '+E.Message);
end;
end;
end;
{===============================================================================


===============================================================================}
procedure Redirect(P: Pointer); stdcall;
begin
Server2.Port    := GamePort;
Server2.Open;
Sleep(5);
Client2.Port    := PlayPort;
Client2.Address := String(AnsiString(PlayIP));
Client2.Open;
CloseHandle(0)
end;
{===============================================================================


===============================================================================}
initialization

begin
Server2                   := TServerSocket.Create(nil);
Client2                   := TClientSocket.Create(nil);
Server2.OnClientRead      := Game2.OnClientRead;
Server2.OnClientConnect   := Game2.OnClientConnect;
Server2.OnClientError     := Game2.OnClientError;
Client2.OnRead            := Game2.OnRead;
Client2.OnConnect         := Game2.OnConnect ;
Client2.OnError           := Game2.OnError;
end;

finalization

begin
Server2.Free;
Client2.Free;
end;

end.

uEncDec:
const
KeyByteC1C2: array [0 .. 31] of Byte = ($AB, $11, $CD, $FE, $18, $23, $C5,
$A3, $CA, $33, $C1, $CC, $66, $67, $21, $F3, $32, $12, $15, $35, $29, $FF,
$FE, $1D, $44, $EF, $CD, $41, $26, $3C, $4E, $4D);

[hide]
------ ишо борахло:
unit uMonsters;

interface

uses
SysUtils, Windows;

function MonsterName(MobID: Word): string;
function ContainsMonster(ID: Word): Integer;
procedure meetmonsters(pckt:Tbytearray);
procedure RemMonster(ID: Word);
procedure SetMonsterPosition(ID: Word; X, Y: Byte);


implementation

uses
uMuArray, uMainFrm, EncDec, uFunctions;
{===============================================================================


===============================================================================}
function Ignore (MobID: Word): Boolean;
var
i: Integer;
begin
Result := False;
for i := 0 to 39 - 1 do
begin
if ((TIgnored[i].MobID shl 8) = MobID)  then
begin
Result := True;
Break;
end;
end;
end;
{===============================================================================


===============================================================================}
procedure SaveMonster(ID,Name: Word; X,Y: Byte);
begin
if (ContainsMonster(ID) = -1) then
begin
if TNum[Integer(Monster)].Num > Max then
Clear(Monster);
end;
if Ignore(Name) then
begin
MainFrm.Log(Format('Meet Ignored monster: %s with ID: %s WhereX,Y: %d - %d',[MonsterName(Name),ToHex(@ID, 2),x,y]));
Exit;
end;
TMonster[TNum[Integer(Monster)].Num].ID   := ID;
TMonster[TNum[Integer(Monster)].Num].Name := Name;
TMonster[TNum[Integer(Monster)].Num].X    := X;
TMonster[TNum[Integer(Monster)].Num].Y    := Y;
Inc(TNum[Integer(Monster)].Num);
MainFrm.Log(Format('Meet monster: %s with ID: %s WhereX,Y: %d - %d',[MonsterName(Name),ToHex(@ID, 2),x,y]));

end;
{===============================================================================


===============================================================================}
procedure RemMonster(ID: Word);
var
i,e: Integer;
begin
for i := 0 to TNum[Integer(Monster)].Num - 1 do
begin
if TMonster[i].ID = ID then
for e := (i + 1) to TNum[Integer(Monster)].Num - 1 do
TMonster[e - 1] := TMonster[i];
Dec(TNum[Integer(Monster)].Num);
MainFrm.Log(Format('Monster: %s WithID: %s Desapier',[MonsterName(TMonster[i].Name),ToHex(@ID, 2)]));
Break;
end;
end;
{===============================================================================


===============================================================================}
function MonsterName(MobID: Word): string;
begin
if (HexToInt(ToHex(@MobID,2)) > 542) then
Result := 'Unknow NameID: '+ToHex(@MobID,2)
else
Result := TNames[HexToInt(ToHex(@MobID,2))].Monsters;
end;
{===============================================================================


===============================================================================}
function ContainsMonster(ID: Word): Integer;
var
i: Integer;
begin
Result := -1;
if (TNum[Integer(Monster)].Num > 0) then
for i := 0 to (TNum[Integer(Monster)].Num - 1) do
if (TMonster[i].ID = ID) then
Result := i;
end;
{===============================================================================


===============================================================================}
procedure SetMonsterPosition(ID: Word; X, Y: Byte);
var
i: Integer;
begin
if (TNum[Integer(Monster)].Num > 0) then
for i := 0 to (TNum[Integer(Monster)].Num - 1) do
if (TMonster[i].ID = ID) then
begin
if (((TMonster[i].X <> X) or (TMonster[i].Y <> Y)))  then
MainFrm.Log(Format('Monster: %s WithID: %s Going from: %d - %d To: %d - %d ',[MonsterName(TMonster[i].Name),ToHex(@TMonster[I].ID, 2),TMonster[i].X,TMonster[i].Y,X,Y]));
TMonster[i].X := X;
TMonster[i].Y := Y;
end;
end;
{===============================================================================


===============================================================================}
procedure meetmonsters(pckt:Tbytearray);
var
I:Integer;
begin
for i := 0 to EncryptResult[4] -1 do
SaveMonster(PWord(@EncryptResult[5+i*10])^ and $FF7F,pWord(@EncryptResult[7+i*10])^,EncryptResult[11+i*10],EncryptResult[12
+i*10]);
end;
{===============================================================================


===============================================================================}
end.

unit uFunctions;

interface

uses
SysUtils, ZLib, Forms, Classes, uMuArray, Windows, uCompare, ExtCtrls,
ComCtrls;

const
XorKey : array[0..14] of Byte = ($47, $75, $6E, $7A, $54, $68, $65, $4B, $65, $72, $6E, $65, $6c, $33, $32);

function HexTo(Source: String): TByteArray;
function ToHex(Buffer:PByteArray; Len: Integer):string;
function HexToInt(HexNum: string): LongInt;
procedure LoadImage(var Img: TImage; ID: Byte);
function idtomap(id: integer):String;
procedure LoadMapPoints(var Lv: TListView; ID: Byte);
function ExcOptions (Opt,Op1,Opt2,Opt3,Opt4,Opt5: Boolean): Byte;
function CalculateExp(Level: Word): DWord;
function GetSkillId(SkillName: string): Integer;
function GetSkillAG(SkillName: string): Integer;
function GetSkillMana(SkillName: string): Integer;

var
test : Integer;


implementation
{==============================================================================


===============================================================================}
function GetSkillId(SkillName: string): Integer;
var
i: Integer;
begin
Result := -1;
for i := 0 to TNum[Integer(SnD)].Num - 1 do
if TSkill[i].Name = SkillName then
Result := TSkill[i].ID;
end;
{==============================================================================


===============================================================================}
function GetSkillMana(SkillName: string): Integer;
var
i: Integer;
begin
Result := -1;
for i := 0 to TNum[Integer(SnD)].Num - 1 do
if TSkill[i].Name = SkillName then
Result := TSkill[i].Mana;
end;
{==============================================================================


===============================================================================}
function GetSkillAG(SkillName: string): Integer;
var
i: Integer;
begin
Result := -1;
for i := 0 to TNum[Integer(SnD)].Num - 1 do
if TSkill[i].Name = SkillName then
Result := TSkill[i].AG;
end;
{==============================================================================


===============================================================================}
function CalculateExp(Level: Word): DWord;
begin
if (Level <= 255) then
Result := (Level + 9) * Level * Level * 10
else
Result := ((Level - 255) + 9) * (Level - 255) * (Level - 255) * 1000 + (Level + 9) * Level * Level * 10;
end;
{==============================================================================


===============================================================================}
function ExcOptions (Opt,Op1,Opt2,Opt3,Opt4,Opt5: Boolean): Byte;
begin
Result := Ord(Opt) or (Ord(Op1) shl 1) or (Ord(Opt2) shl 2) or (Ord(Opt3) shl 3) or (Ord(Opt4) shl 4) or (Ord(Opt5) shl 5)
end;
{==============================================================================


===============================================================================}
function idtomap(id: integer):String;
begin
case id of
0: Result      := 'Lorencia';
1: Result      := 'Dungeon';
2: Result      := 'Devias';
3: Result      := 'Noria';
4: Result      := 'LostTower';
5: Result      := 'Exile';
6: Result      := 'Arena';
7: Result      := 'Atlans';
8: Result      := 'Tarkan';
9: Result      := 'Devil Square 1,2,3,4';
32: Result     := 'Devil Square 5,6';
10: Result     := 'Icarus';
11: Result     := 'Blood Castle 1';
12: Result     := 'Blood Castle 2';
13: Result     := 'Blood Castle 3';
14: Result     := 'Blood Castle 4';
15: Result     := 'Blood Castle 5';
16: Result     := 'Blood Castle 6';
17: Result     := 'Blood Castle 7';
18: Result     := 'Chaos Castle 1';
19: Result     := 'Chaos Castle 2';
20: Result     := 'Chaos Castle 3';
21: Result     := 'Chaos Castle 4';
22: Result     := 'Chaos Castle 5';
23: Result     := 'Chaos Castle 6';
24: Result     := 'Kalima 1';
25: Result     := 'Kalima 2';
26: Result     := 'Kalima 3';
27: Result     := 'Kalima 4';
28: Result     := 'Kalima 5';
29: Result     := 'Kalima 6';
36: Result     := 'Kalima 7 (Lost Kalima)';
30: Result     := 'Valley of Loren';
31: Result     := 'Land of Trials';
33: Result     := 'Aida';
34: Result     := 'Crywolf Fortress';
37: Result     := 'Kantru';
38: Result     := 'Kantru 2';
39: Result     := 'Kantru 3';
40: Result     := 'Silent Map';
41: Result     := 'Barracks of Balgass';
42: Result     := 'Balgass Refuge';
45: Result     := 'Illusion Temple 1';
46: Result     := 'Illusion Temple 2';
47: Result     := 'Illusion Temple 3';
48: Result     := 'Illusion Temple 4';
49: Result     := 'Illusion Temple 5';
50: Result     := 'Illusion Temple 6';
51: Result     := 'Elbeland';
52: Result     := 'Blood Castle 7';
53: Result     := 'Blood Castle 8';
56: Result     := 'Swamp of Calmness';
57: Result     := 'Raklion';
58: Result     := 'Raklion Boss';
62: Result     := 'Villages Santa';
63: Result     := 'Vulcanus';
64: Result     := 'Duel Arena';
65: Result     := 'Doppelganger (Double Gear:65)';
66: Result     := 'Doppelganger (Double Gear:66)';
67: Result     := 'Doppelganger (Double Gear:67)';
68: Result     := 'Doppelganger (Double Gear:68)';
69: Result     := 'Doppelganger (Double Gear:69)';
70: Result     := 'Empire Fortress:70';
71: Result     := 'Empire Fortress:71';
72: Result     := 'Empire Fortress:72';
end;
end;
{==============================================================================


===============================================================================}
procedure LoadMapPoints(var Lv: TListView; ID: Byte);
var
i, j: Integer;
begin
j := 0;
Lv.Items.Clear;
if ID = $00 then
for i := 0 to 12 do
begin
Lv.items.add;
Lv.Items[i].Caption:=(Lorenciaplace[0+j]);
Lv.items[i].SubItems.Add(Lorenciaplace[0+1+j]);
Lv.items[i].SubItems.Add(Lorenciaplace[0+2+j]);
j:=j+3;
end;
if ID = $01 then
for i := 0 to 7 do
begin
Lv.items.add;
Lv.Items[i].Caption:=(Dungeunplace[0+j]);
Lv.items[i].SubItems.Add(Dungeunplace[0+1+j]);
Lv.items[i].SubItems.Add(Dungeunplace[0+2+j]);
j:=j+3;
end;
if ID = $02 then
for i := 0 to 12 do
begin
Lv.items.add;
Lv.Items[i].Caption:=(Deviasplace[0+j]);
Lv.items[i].SubItems.Add(Deviasplace[0+1+j]);
Lv.items[i].SubItems.Add(Deviasplace[0+2+j]);
j:=j+3;
end;
if ID = $03 then
for i := 0 to 7 do
begin
Lv.items.add;
Lv.Items[i].Caption:=(Noriaplace[0+j]);
Lv.items[i].SubItems.Add(Noriaplace[0+1+j]);
Lv.items[i].SubItems.Add(Noriaplace[0+2+j]);
j:=j+3;
end;
if ID = $04 then
for i := 0 to 2 do
begin
Lv.items.add;
Lv.Items[i].Caption:=(losttowerplace[0+j]);
Lv.items[i].SubItems.Add(losttowerplace[0+1+j]);
Lv.items[i].SubItems.Add(losttowerplace[0+2+j]);
j:=j+3;
end;
if ID = $06 then
for i := 0 to 0 do
begin
Lv.items.add;
Lv.Items[i].Caption:=(arenaplace[0+j]);
Lv.items[i].SubItems.Add(arenaplace[0+1+j]);
Lv.items[i].SubItems.Add(arenaplace[0+2+j]);
j:=j+3;
end;
if ID = $07 then
for i := 0 to 4 do
begin
Lv.items.add;
Lv.Items[i].Caption:=(Atlansplace[0+j]);
Lv.items[i].SubItems.Add(Atlansplace[0+1+j]);
Lv.items[i].SubItems.Add(Atlansplace[0+2+j]);
j:=j+3;
end;
if ID = $08 then
for i := 0 to 5 do
begin
Lv.items.add;
Lv.Items[i].Caption:=(tarkanplace[0+j]);
Lv.items[i].SubItems.Add(tarkanplace[0+1+j]);
Lv.items[i].SubItems.Add(tarkanplace[0+2+j]);
j:=j+3;
end;
if ID = $21 then
for i := 0 to 2 do
begin
Lv.items.add;
Lv.Items[i].Caption:=(Aidaplace[0+j]);
Lv.items[i].SubItems.Add(Aidaplace[0+1+j]);
Lv.items[i].SubItems.Add(Aidaplace[0+2+j]);
j:=j+3;
end;
if ID = $25 then
for i := 0 to 2 do
begin
Lv.items.add;
Lv.Items[i].Caption:=(Kanturuplace[0+j]);
Lv.items[i].SubItems.Add(Kanturuplace[0+1+j]);
Lv.items[i].SubItems.Add(Kanturuplace[0+2+j]);
j:=j+3;
end;
if ID = $26 then
for i := 0 to 1 do
begin
Lv.items.add;
Lv.Items[i].Caption:=(Kanturu3place[0+j]);
Lv.items[i].SubItems.Add(Kanturu3place[0+1+j]);
Lv.items[i].SubItems.Add(Kanturu3place[0+2+j]);
j:=j+3;
end;
if ID = $1E then
for i := 0 to 12 do
begin
Lv.items.add;
Lv.Items[i].Caption:=(Lorenplace[0+j]);
Lv.items[i].SubItems.Add(Lorenplace[0+1+j]);
Lv.items[i].SubItems.Add(Lorenplace[0+2+j]);
j:=j+3;
end;
end;

procedure LoadImage(var Img: TImage; ID: Byte);
begin
try
Img.Picture.LoadFromFile(ExtractFilePath(Application.ExeName)+'FilesMiniMap'+IntToStr(ID)+'.Bmp');
except
on E: EFOpenError do
Img.Picture := nil;
end;
end;
{==============================================================================


===============================================================================}
function HexToInt(HexNum: string): LongInt;
begin
Result:=StrToInt('$' + HexNum) ;
end;
{==============================================================================


===============================================================================}
function CheckString (s: String):Boolean;
begin
Result := True;
if (Length(S)  >0) then
begin
Result := (Ord(s[1]) = $20) or (Ord(s[1]) = $2F) or (Ord(s[1]) = $45) or (s[1] = 'e') or (s[1] = 'E') or (s = '')  or (Ord(s[1]) = $09) or (Length(s) <=1)
end;
end;
{==============================================================================


===============================================================================}
function ToHex(Buffer:PByteArray; Len: Integer):String;
const
HexCode: Array [$0 .. $F] Of AnsiChar = '0123456789ABCDEF';
var
i:integer;
begin
SetLength(Result,0);
for i := 0 to Len - 1 do
begin
Result := Result + HexCode[Buffer[i] shr 4]+HexCode[Buffer[i] and $0F];
end;
end;
{===============================================================================


===============================================================================}
function HexTo(Source: String): TByteArray;
var
i,CharPtr:Integer;
tmp:String;
begin
CharPtr := 1;
for i := 0 To Length(Source) div 2 -1 do
begin
tmp := Copy(Source, CharPtr, 2);
inc(CharPtr,2);
Result[i] := StrToInt('$'+tmp);
end;
end;
{===============================================================================


===============================================================================}
procedure LoadMoN(var Result: TStringList; var Position: Integer);
var
DelList: TStringList;
i,e: Integer;
Check: String;
begin
DelList := TStringList.Create;
DelList.Delimiter := #9;
DelList.QuoteChar := #34;
try
for i := 0 to Result.Count -1 do
begin
Check := Result[i];
test := i;
if not CheckString(Check) then
begin
DelList.DelimitedText := Result[i];
for e := 0 to 1 do
begin
TNames[TNum[Integer(MName)].Num].Monsters  := DelList[e];
end;
inc(TNum[Integer(MName)].Num);
end;
end;
finally
DelList.Free;
end;
end;
{===============================================================================


===============================================================================}
procedure LoadMaN(var Result: TStringList; var Position: Integer);
var
DelList: TStringList;
i,e: integer;
Check: String;
begin
DelList := TStringList.Create;
DelList.Delimiter := #9;
DelList.QuoteChar := #34;
try
for i := 0 to Result.Count -1 do
begin
test := i;
Check := Result[i];
DelList.DelimitedText := Result[i];
if not CheckString(Check) then
begin
for e := 0 to 1 do
TNames[TNum[Integer(ManName)].Num].Maps  := DelList[1];
end;
inc(TNum[Integer(ManName)].Num);
end;
finally
DelList.Free;
end;
end;
{===============================================================================


===============================================================================}
procedure LoadSND(var Result: TStringList; var Position: Integer);
var
List, DelList: TStringList;
i: integer;
Check: String;
begin
List := TStringList.Create;
DelList := TStringList.Create;
DelList.Delimiter := #9;
DelList.QuoteChar := #34;
try
for i := 0 to Result.Count -1 do
begin
Check := Result[i];
test := i;
DelList.DelimitedText := Result[i];
if not CheckString(Check) then
begin
TSkill[TNum[Integer(SnD)].Num].ID    := StrToIntDef(DelList[0],0);
TSkill[TNum[Integer(SnD)].Num].Name  := DelList[1];
TSkill[TNum[Integer(SnD)].Num].Mana  := StrToInt(DelList[4]);
TSkill[TNum[Integer(SnD)].Num].AG    := StrToInt(DelList[5]);
inc(TNum[Integer(SnD)].Num);
end;
end;
finally
List.Free;
DelList.Free;
end;
end;
{===============================================================================


===============================================================================}
procedure LoadIN(var Result: TStringList; var Position: Integer);
var
List, DelList: TStringList;
i,j: integer;
Check: String;
begin
List := TStringList.Create;
DelList := TStringList.Create;
DelList.Delimiter := #9;
DelList.QuoteChar := #34;
try
for i := 0 to Result.Count -1 do
begin
Check := Result[i];
test := i;
DelList.DelimitedText := Result[i];
if not CheckString(Check) then
begin
for j := 0 to 16 do
begin
TNames[TNum[Integer(IName)].Num].Items[j]  := DelList[j];
end;
inc(TNum[Integer(IName)].Num);
end;
end;
finally
List.Free;
DelList.Free;
end;
end;
{===============================================================================


===============================================================================}
function EncryptFiles (TFile: Integer; S: TFileName; out Position: Integer; out FSize: String; var Passed: Boolean): TStringList;
var
Fs,Ms: TStream;
begin
try
Fs := TFileStream.Create(S,fmOpenRead);
except
FSize := 'Error: Missing file!';
Exit;
end;
try
Ms := TMemoryStream.Create;
Result := TStringList.Create;

if CheckFiles(Fs) then
begin
FSize := 'File was successfully checked: Status OK!';
Passed := True;
end
else
begin
FSize := 'Some of files - looks to be corrupted!';
Passed := False;
end;

Ms.CopyFrom(Fs, Fs.Size);
Ms.Position := 0;
EncDecXor(Ms);
Ms.Position := 0;
CompressData(Ms,False);
Ms.Position := 0;
Result.LoadFromStream(Ms);
case TFile of
3: LoadIN(Result,Position);
4: LoadMoN(Result,Position);
5: LoadMaN(Result,Position);
6: LoadSND(Result,Position);
end;

finally
Fs.Free;
Ms.Free;
Result.Free;
end;
end;
{===============================================================================


===============================================================================}
end.

unit TMuClass;

interface

uses
SysUtils, Windows, uMuArray, uInvertory, uEncDec, uFunctions, uMainFrm, Sproxy, uPackets;

type
TPlayerName = array[0..10] of AnsiChar;

TMonster = packed record
ID   : Word;
Name : Word;
x    : Byte;
y    : Byte;
end;

TPlayer = packed record
ID       : Word;
Name     : TPlayerName;
aClass   : Byte;
x        : Byte;
y        : Byte;
Detected : Boolean;
end;

TMuShit = object
private
FKillMonsters : Boolean;
FXpos     : Byte;
FYpos     : Byte;
Monsters  : packed array of TMonster;
Players   : packed array of TPlayer;
function GetXpos : Byte;
function GetYpos : Byte;
function GetMaxPlayers : Integer;
procedure SetAKMonsters(Value: Boolean);
public
function GetPlayersName(ID: Word): string;
function GetMonsterID(i: Integer): Word;
function ContainsMonster(ID: Word): Integer;
function FaceDir(Mobx,Moby:byte):Byte;
function GetPlayersID (Name: string): Word;
function CharacterClassName(aClass: Byte): string;
procedure UpdateMonter(ID: Word; X, Y: Byte);
procedure UpdatePlayer(ID: Word; X: Byte; Y: Byte);
procedure MeetMonster (Buffer : PByteArray);
procedure MeetPlayer (Buffer: Pbytearray);
procedure RemMonster(Buffer: PByteArray);
procedure RemPlayer(Buffer: PByteArray);
procedure ClearMonster;
procedure ClearPlayers;
procedure SetPos (ValueX, ValueY: Byte);
property Xpos : Byte read GetXpos;
property Ypos : Byte read GetYpos;
property TotalPlayers : Integer read GetMaxPlayers;
property EnableMonsterAK : Boolean read FKillMonsters write SetAKMonsters default False;
protected
function ContainsPlayer(ID: Word): Integer;
procedure AddMonster(ID,Name: Word; x,y: Byte);
procedure AddPlayer(ID: Word; Name: TPlayerName; aClass, X, Y: Byte);
function inRange(Range: Byte; var X,Y: Byte): Boolean;

end;

var
Mu    : TMuShit;
PName : TPlayerName;

implementation


function TMuShit.GetMonsterID(i: Integer): Word;
begin
Result  := Monsters[i].ID;
end;

function TMuShit.FaceDir(Mobx,Moby:byte):Byte;
begin
Result:=$20;
If ((FXpos > Mobx) and (FYpos > Moby)) then
Result :=$E0
else if ((FXpos < Mobx) and (FYpos < Moby)) then
Result :=$60
else if ((FXpos < Mobx) and (FYpos > Moby)) then
Result :=$20
else if ((FXpos > Mobx) and (FYpos < Moby)) then
Result :=$A0;
end;
{===============================================================================

Test
===============================================================================}
function TMuShit.GetMaxPlayers: Integer;
begin
Result := High(Players)
end;
{===============================================================================

Test
===============================================================================}
procedure TMuShit.SetAKMonsters(Value: Boolean);
begin
FKillMonsters := Value;
if FKillMonsters then
//  Th1 := BeginThread(nil,0,@KillMonsters,nil,0,ThID)
end;
{===============================================================================


===============================================================================}
function TMuShit.inRange(Range: Byte; var X: Byte; var Y: Byte): Boolean;
var
D1, D2, Distance: Single;
begin
D1 := FXpos - X;
D2 := FYpos - Y;
Distance := Sqrt(D1 * D1 + D2 * D2);
Result := Distance < Range;
end;
{===============================================================================


===============================================================================}
procedure TMuShit.SetPos(ValueX: Byte; ValueY: Byte);
begin
FXpos := ValueX;
FYpos := ValueY;
end;
{===============================================================================


===============================================================================}
function TMuShit.GetYpos;
begin
Result := FYpos;
end;
{===============================================================================


===============================================================================}
function TMuShit.GetXpos;
begin
Result := FXpos;
end;
{===============================================================================


===============================================================================}
function MonsterName(MobID: Word): string;
begin
if (HexToInt(ToHex(@MobID,2)) > 542) then
Result := 'Unknow NameID: '+ToHex(@MobID,2)
else
Result := TNames[HexToInt(ToHex(@MobID,2))].Monsters;
end;


procedure TMuShit.AddMonster(ID: Word; Name: Word; x: Byte; y: Byte);
var
i: Integer;
begin
if ContainsMonster(ID) = -1 then
begin
//   for i := 0 to 45 do
//     if (Name = Swap(TIgnored[i].MobID)) then
//       begin
//        if MainFrm.CEventLog.Checked then
//         MainFrm.SystemLog(Format('Ignore MOB: %s - %s ',[ToHex(@ID, 2),MonsterName(Name)]),False);
//         Exit;
//       end;
SetLength(Monsters,High(Monsters)+2);
Monsters[High(Monsters)].ID   := ID;
Monsters[High(Monsters)].Name := Name;
Monsters[High(Monsters)].x    := x;
Monsters[High(Monsters)].y    := y;
if MainFrm.CEventLog.Checked then
MainFrm.SystemLog(Format('Meet monster: %s with ID: %s WhereX,Y: %d - %d',[MonsterName(Name),ToHex(@ID, 2),x,y]),False);
end;
end;
{===============================================================================


===============================================================================}
procedure TMuShit.RemMonster(Buffer: PByteArray);
var
i, e, index: Integer;
begin
for e := 0 to Buffer[3] - 1 do
begin
i:=e*2;
index := ContainsMonster(pword(@Buffer[4+i])^);
if (High(Monsters) > 0) and (index > -1)then
begin
Monsters[index].ID   := Monsters[High(Monsters)].ID;
Monsters[index].Name := Monsters[High(Monsters)].Name;
Monsters[index].x    := Monsters[High(Monsters)].x;
Monsters[index].y    := Monsters[High(Monsters)].y;
if High(Monsters) = -1 then
SetLength(Monsters,0)
else
SetLength(Monsters,High(Monsters));
if MainFrm.CEventLog.Checked then
MainFrm.SystemLog(Format('Monster: %s WithID: %s disappear',[MonsterName(Monsters[index].Name),ToHex(@Monsters[index].ID, 2)]),False);
end;
end;
end;
{===============================================================================


===============================================================================}
function TMuShit.ContainsMonster(ID: Word): Integer;
var
i: Integer;
begin
Result := -1;
for i := Low(Monsters) to High(Monsters) do
begin
if Monsters[i].ID = ID then
Result := i;
end;
end;
{===============================================================================


===============================================================================}
procedure TMuShit.ClearMonster;
begin
ZeroMemory(@Monsters,SizeOf(Monsters));
SetLength(Monsters,1);
end;
{===============================================================================


===============================================================================}
procedure TMuShit.MeetMonster(Buffer: PByteArray);
var
i: Integer;
begin
for i := 0 to Buffer[4] -1 do
AddMonster(PWord(@Buffer[5+i*10])^ and $FF7F,pWord(@Buffer[7+i*10])^,Buffer[11+i*10],Buffer[12+i*10]);
end;
{===============================================================================


===============================================================================}
procedure TMuShit.UpdateMonter(ID: Word; X: Byte; Y: Byte);
var
index: Integer;
begin
index := ContainsMonster(ID);
if (High(Monsters) > 0) and (index > -1)then
begin
if (Monsters[index].x <> x) or (Monsters[index].y <> y) then
if MainFrm.CEventLog.Checked then
MainFrm.SystemLog(Format('Monster: %s WithID: %s Going from: %d - %d To: %d - %d ',[MonsterName(Monsters[index].Name),ToHex(@Monsters[index].ID, 2),Monsters[index].X,Monsters[index].Y,X,Y]),False);
Monsters[index].x := x;
Monsters[index].y := y;
end;
end;
{===============================================================================


===============================================================================}
procedure TMuShit.AddPlayer(ID: Word; Name: TPlayerName; aClass: Byte; X: Byte; Y: Byte);
begin
if ID = PlayerID then
Exit;
if ContainsPlayer(ID)  = -1 then
begin
SetLength(Players,High(Players)+2);
Players[High(Players)].ID       := ID;
Players[High(Players)].Name     := Name;
Players[High(Players)].aClass   := aClass;
Players[High(Players)].x        := x;
Players[High(Players)].y        := y;
Players[High(Players)].Detected := True;
MainFrm.PlayerSightEvent(High(Players));
if MainFrm.CEventLog.Checked then
MainFrm.SystemLog(Format('Meet player: [%s] Class: [%s] PlayerID: [%s] WhereX,Y: [%d - %d]',[Name,CharacterClassName(aClass),ToHex(@ID, 2),x,y]),False);
end;
end;
{===============================================================================


===============================================================================}
function TMuShit.ContainsPlayer(ID: Word): Integer;
var
i: Integer;
begin
Result := -1;
for i := Low(Players) to High(Players) do
begin
if Players[i].ID = ID then
Result := i;
end;
end;
{===============================================================================


===============================================================================}
function TMuShit.CharacterClassName(aClass: Byte): string;
begin
case aClass of
0:  Result := 'Dark Wizard';
2:  Result := 'Dark Knight';
6:  Result := 'Magic Gladiator';
16:  Result := 'Soul Master';
24:  Result := 'Grand Master';
32:  Result := 'Dark Knight';
48:  Result := 'Blade Knight';
56:  Result := 'Blade Master';
64:  Result := 'Elf';
80:  Result := 'Muse Elf';
96:  Result := 'Magic Gladiator';
120:  Result := 'Duel Master';
128:  Result := 'Dark Lord';
152:  Result := 'Lord Emperor';
160:  Result := 'Summoner';
176:  Result := 'Bloody Summoner';
184:  Result := 'Dimension Summoner';
else
Result := Format('Unknown class ID: %x',[aClass]);
end;
end;
{===============================================================================


===============================================================================}
procedure TMuShit.ClearPlayers;
begin
ZeroMemory(@Players,SizeOf(Players));
SetLength(Players,1);
end;
{===============================================================================


===============================================================================}
procedure TMuShit.MeetPlayer(Buffer: PByteArray);
var
i:integer;
begin
for i := 0 to Buffer[4] -1 do
begin
Move(Buffer[27+i*36],PName,10);;
PName[10] := AnsiChar(00);
AddPlayer(pWord(@Buffer[5+i*36])^ and $FF7F,PName,Buffer[9+i*36],Buffer[10+i*25],Buffer[8+i*36]);
end;
end;
{===============================================================================


===============================================================================}
procedure TMuShit.RemPlayer(Buffer: PByteArray);
var
i, e, index: Integer;
begin
for e := 0 to Buffer[3] - 1 do
begin
i:=e*2;
index := ContainsPlayer(pword(@Buffer[4+i])^);
if (High(Players) > 0) and (index > -1)then
begin
Players[index].ID       := Players[High(Players)].ID;
Players[index].Name     := Players[High(Players)].Name;
Players[index].aClass   := Players[High(Players)].aClass;
Players[index].x        := Players[High(Players)].x;
Players[index].y        := Players[High(Players)].y;
Players[index].Detected := Players[High(Players)].Detected;
if High(Players) = -1 then
SetLength(Players,0)
else
SetLength(Players,High(Players));
if MainFrm.CEventLog.Checked then
MainFrm.SystemLog(Format('Player: %s WithID: %s disappear',[Players[index].Name,ToHex(@Players[index].ID, 2)]),False);
end;
end;
end;
{===============================================================================


===============================================================================}
procedure TMuShit.UpdatePlayer(ID: Word; X: Byte; Y: Byte);
var
index: Integer;
begin
index := ContainsPlayer(ID);
if (High(Players) > 0) and (index > -1)then
begin
if (Players[index].x <> x) or (Players[index].y <> y) then
if MainFrm.CEventLog.Checked then
MainFrm.SystemLog(Format('Player: [%s] WithID: %s Going from: %d - %d To: %d - %d ',[Players[index].Name,ToHex(@Players[index].ID, 2),Players[index].X,Players[index].Y,X,Y]),False);
Players[index].x := x;
Players[index].y := y;
end;
end;

function TMuShit.GetPlayersID(Name: string): Word;
var
i: Integer;
begin
Result := $0000;
for i := Low(Players) to High(Players) - 1 do
if AnsiString(Name) = Players[i].Name then
Result := Players[i].ID;
end;

function TMuShit.GetPlayersName(ID: Word): string;
var
i: Integer;
begin
Result := '';
i := ContainsPlayer(ID);
if i > -1 then
Result := Players[i].Name;
end;
end.

unit uSniffer;

interface

uses
SysUtils, Windows;

procedure LogPackets (Buf: array of Byte; Len: Integer; From: String);

implementation

uses
uMainFrm, uFunctions;
{===============================================================================



===============================================================================}
function ByLen(Len: Integer; CmpLen: String): Boolean;
begin
Result := Len = StrToIntDef(CmpLen,256)
end;
{===============================================================================



===============================================================================}
function ByHdr(Buf: array of Byte; hdr: Byte): Boolean;
begin
Result := CompareMem(@Buf[0],@Hdr,1);
end;
{===============================================================================



===============================================================================}
function BySubHdr(Buf: array of Byte; SubHdr: Byte): Boolean;
var
OpCode: Integer;
begin
case Buf[0] of
$C1,$C3: OpCode := 2;
else
OpCode := 3;
end;
Result := CompareMem(@Buf[OpCode],@subhdr,1);
end;
{===============================================================================



===============================================================================}
function HexToHStr(s:pByteArray; pref,suf:string; Len:integer):string;
Var
i:integer;
begin
for i:=0 to len do
begin
if i<>len then
result:=result+pref+IntToHex(s[i],2) + suf
else
result:=result+pref+IntToHex(s[i],2);
end;
end;
{===============================================================================



===============================================================================}
procedure LogPackets (Buf: array of Byte; Len: Integer; From: String);
var
i : Integer;
begin
i := MainFrm.PacketLog.Items.Count;
if MainFrm.CFilter.Checked then
begin
if MainFrm.CFilterSubHdr.Checked then
if BySubHdr(Buf,HexToInt(MainFrm.EFilterSubOp.Text)) then
with MainFrm.PacketLog.Items.Add do
begin
Caption := IntToStr(i);
SubItems.Add(From);
SubItems.Add(IntToStr(Len));
SubItems.Add(Tohex(@Buf,Len))
end;
if MainFrm.CFilterLen.Checked then
if ByLen(Len,MainFrm.EFilterLen.Text) then
with MainFrm.PacketLog.Items.Add do
begin
Caption := IntToStr(i);
SubItems.Add(From);
SubItems.Add(IntToStr(Len));
SubItems.Add(Tohex(@Buf,Len))
end;
if MainFrm.CFilterHdr.Checked then
if ByHdr(Buf,HexToInt(MainFrm.EFilterOP.Text)) then
with MainFrm.PacketLog.Items.Add do
begin
Caption := IntToStr(i);
SubItems.Add(From);
SubItems.Add(IntToStr(Len));
SubItems.Add(Tohex(@Buf,Len))
end;
end
else
begin
with MainFrm.PacketLog.Items.Add do
begin
Caption := IntToStr(i);
SubItems.Add(From);
SubItems.Add(IntToStr(Len));
SubItems.Add(Tohex(@Buf,Len))
end;
end;
end;
{===============================================================================



===============================================================================}
end.

unit uPickUp;

interface

uses
SysUtils, Windows, uMuArray, uMainFrm, Sproxy, uPackets, TMuClass;

procedure PickupItem (P: Pointer); stdcall;
procedure PickupBackThread(P: Pointer); stdcall;

type
PItemOpt = ^TItemOpt;
TItemOpt = packed record
Serial        : Word;
X             : Byte;
Y             : Byte;
ExcAttributes : Byte;
Durabity      : Byte;
Level         : Integer;
Options       : Integer;
Luck          : Boolean;
Skill         : Boolean;
Checked       : Boolean;
Name          : string;
end;

PSearchItem = ^TSearchItem;
TSearchItem = packed record
ExcAttributes : Byte;
Level         : Integer;
Options       : Integer;
Zen           : Word;
Luck          : Boolean;
Skill         : Boolean;
Name          : string;
ByLevel       : Boolean;
ByOption      : Boolean;
ByLuck        : Boolean;
BySkill       : Boolean;
end;

type
TMuItmes = object
private
FItemList : array of TItemOpt;
FSearchList : array of TSearchItem;
FZen : Integer;
public
function CheckItems (Zen,Anc,Exc: Boolean) : Integer;
procedure MeetItem (Buffer: PByteArray);
function AddItem (ExcAttributes: Byte; Level: Integer; Zen: Word; Options: Integer; Luck,Skill: Boolean; Name: String; ByLevel,ByOption,ByLuck,BySkill: Boolean): string; overload;
function CleanUp (Item: Integer) : string;
procedure RemItem(Buffer: PByteArray);
function DelSreachItem(i: Integer):string;
procedure ClearItems;
protected
procedure AddItem (Serial: Word; X,Y,Durabity,Excattributes: Byte; Level,Options: Integer; Luck,Skill: Boolean; Name: string; SubID: Byte); overload;
function ContainsItem (Serial: Word): Integer; overload;
function ContainsItem (Name: string): Integer; overload;
function isExcelent (Excattributes: Byte): Boolean;
function isExcLog (ExcAttributes: Byte): Boolean;
function ExcOptions(ExcAttributes,SubID: Byte): string;
function isSkill (Info: Byte): Boolean;
function isLuck (Info: Byte): Boolean;
function ItemLevel (Info: Byte): Integer;
function GetOptions (Info,ExcAttributes: Byte): Integer;
procedure CheckDupe;
end;

var
MuItems : TMuItmes;
ThID2   : Cardinal;
Th2     : Integer;
PickupItems : Boolean = True;
PosTeleBackX: Byte;
PosTeleBackY: Byte;
PickupThID   : Cardinal;
PickupID     : Integer;

implementation

procedure ItemID (i: Integer);
begin
if PickupItems then
begin
PosTeleBackX := Mu.Xpos;
PosTeleBackY := Mu.Ypos;
PWORD(@PickPacket[3])^ := MuItems.FItemList[i].Serial;
MainFrm.Teleport(MuItems.FItemList[i].X,MuItems.FItemList[i].Y);
MainFrm.SendC3(@PickPacket,5,True);
if MainFrm.CPickupTB.Checked then
begin
PickupID := BeginThread(nil,0,@PickupBackThread,nil,0,PickupThID);
CloseHandle(PickupID);
end
else
Mu.SetPos(MuItems.FItemList[i].X,MuItems.FItemList[i].Y);
end;
end;

procedure PickupBackThread(P: Pointer); stdcall;
begin
Sleep(500);
MainFrm.Teleport(PosTeleBackX,PosTeleBackY);
Mu.SetPos(PosTeleBackX,PosTeleBackY);
EndThread(0);
end;

procedure PickUpItem (P: Pointer); stdcall;
var
Test: Integer;
begin
while True do
begin
if High(MuItems.FItemList) > -1 then
begin
Test := MuItems.CheckItems(MainFrm.CitemsZen.Checked,MainFrm.CitemsAnc.Checked,MainFrm.C
ItemsExc.Checked);
if Test > -1 then
begin
ItemID(Test);
MuItems.CleanUp(Test)
end;
Sleep(64);
end;
Sleep(512);
end;
end;

procedure TMuItmes.ClearItems;
begin
ZeroMemory(@FItemList,SizeOf(FItemList));
SetLength(FItemList,1);
end;

function TMuItmes.AddItem(ExcAttributes: Byte; Level: Integer; Zen: Word; Options: Integer; Luck: Boolean; Skill: Boolean; Name: string; ByLevel,ByOption,ByLuck,BySkill: Boolean): string;
begin
SetLength(FSearchList,High(FSearchList)+2);
FSearchList[High(FSearchList)].ExcAttributes := ExcAttributes;
FSearchList[High(FSearchList)].Level         := Level;
FSearchList[High(FSearchList)].Zen           := Zen;
FSearchList[High(FSearchList)].Options       := Options;
FSearchList[High(FSearchList)].Skill         := Skill;
FSearchList[High(FSearchList)].Luck          := Luck;
FSearchList[High(FSearchList)].Name          := Name;

FSearchList[High(FSearchList)].ByLevel       := ByLevel;
FSearchList[High(FSearchList)].ByOption      := ByOption;
FSearchList[High(FSearchList)].ByLuck        := ByLuck;
FSearchList[High(FSearchList)].BySkill       := BySkill;
Result := Format('%s',[Name]);
end;

procedure TMuItmes.AddItem(Serial: Word; X: Byte; Y: Byte; Durabity: Byte; Excattributes: Byte; Level: Integer; Options: Integer; Luck: Boolean; Skill: Boolean; Name: string; SubID: Byte);
begin
if Serial > 0 then
begin
SetLength(FItemList,High(FItemList)+2);
FItemList[High(FItemList)].Serial        := Serial;
FItemList[High(FItemList)].X             := X;
FItemList[High(FItemList)].Y             := Y;
FItemList[High(FItemList)].Durabity      := Durabity;
FItemList[High(FItemList)].ExcAttributes := Excattributes;
FItemList[High(FItemList)].Level         := Level;
FItemList[High(FItemList)].Options       := Options;
FItemList[High(FItemList)].Luck          := Luck;
FItemList[High(FItemList)].Skill         := Skill;
FItemList[High(FItemList)].Checked       := False;
FItemList[High(FItemList)].Name          := Name;
Mainfrm.SystemLog(Format('Meet item: %s at X: %d and Y: %d',[Name,X,Y]),False);
end;
end;

procedure TMuItmes.CheckDupe;
var
i,j: Integer;
begin
if High(FItemList)= -1 then
Exit;
for j := Low(FItemList) to High(FItemList) do
for i := Low(FItemList) to High(FItemList) do
begin
if FItemList[i].Name = FItemList[j].Name then
if FItemList[i].ExcAttributes = FItemList[j].ExcAttributes then
if FItemList[i].Durabity = FItemList[j].Durabity then
if FItemList[i].Level = FItemList[j].Level then
if FItemList[i].Options = FItemList[j].Options then
if FItemList[i].Luck = FItemList[j].Luck then
if FItemList[i].Skill = FItemList[j].Skill then
CleanUp(i);
end;
end;

procedure TMuItmes.MeetItem(Buffer: PByteArray);
var
i: Integer;
begin
for i := 0 to Buffer[4] - 1 do
AddItem(
Pword(@Buffer[5+i*11])^ and $FF7F,
Buffer[7+i*11],
Buffer[8+i*11],
Buffer[11+i*11],
Buffer[13+i*11],
ItemLevel(Buffer[10+i*11]),
GetOptions(Buffer[10+i*11],Buffer[13+i*11]),
isLuck(Buffer[10+i*11]),
isSkill(Buffer[10+i*11]),
TNames[Buffer[9+i*11]].Items[((Buffer[14+i*11]) shr 4) +1],
Buffer[9+i*11]);
end;

function TMuItmes.isExcelent(ExcAttributes: Byte): Boolean;
begin
Result := (ExcAttributes and $40) > 0;
end;

function TMuItmes.GetOptions(Info,ExcAttributes: Byte): Integer;
begin
if isExcelent(ExcAttributes) then
Result := (Info and 3) *4 +16
else
Result := (Info and 3) *4
end;

function TMuItmes.isSkill(Info: Byte): Boolean;
begin
Result := (Info and $80) >0
end;

function TMuItmes.isLuck(Info: Byte): Boolean;
begin
Result := (Info and $04) >0
end;

function TMuItmes.ItemLevel(Info: Byte): Integer;
begin
Result := (Info and $78) div 8
end;

function TMuItmes.isExcLog(ExcAttributes: Byte): Boolean;
begin
Result := (ExcAttributes and $3F) > 0;
end;

function TMuItmes.ExcOptions(ExcAttributes: Byte; SubID: Byte): string;
begin
Result := '';
if isExcLog(ExcAttributes) then
case (SubID shr 4) of
0,1,2,3,4,5: Result := TExcOptions[0,(ExcAttributes and $3F)];
else
Result := TExcOptions[1,(ExcAttributes and $3F)];
end;
end;

function TMuItmes.ContainsItem(Serial: Word): Integer;
var
i: Integer;
begin
Result := -1;
for i := Low(FItemList) to High(FItemList) do
if (FItemList[i].Serial = Serial) then
Result := i;
end;

function TMuItmes.ContainsItem(Name: string): Integer;
var
i: Integer;
begin
Result := -1;
for i := Low(FItemList) to High(FItemList) do
if (FItemList[i].Name = Name) then
Result := i;
end;

function TMuItmes.CheckItems(Zen,Anc,Exc: Boolean) : Integer;
var
i,j,Opt: Integer;
begin
Result := -1;
for j := Low(FSearchList) to High(FSearchList) do
for i := Low(FItemList) to High(FItemList) do
if ContainsItem(FSearchList[j].Name) > -1 then
if FSearchList[j].Name = FItemList[i].Name then
begin
Opt := Ord(FSearchList[j].Level) or (Ord(FSearchList[j].ByOption) shl 1) or (Ord(FSearchList[j].ByLuck) shl 2) or (Ord(FSearchList[j].BySkill) shl 3);
case Opt of
0:
Result := i;
1: if (FSearchList[j].Level = FItemList[i].Level) then
Result := i;
2: if (FSearchList[j].Options = FItemList[i].Options) then
Result := i;
3: if (FSearchList[j].Level = FItemList[i].Level) and (FSearchList[j].Options = FItemList[i].Options)  then
Result := i;
4: if (FSearchList[j].Luck = FItemList[i].Luck) then
Result := i;
5: if (FSearchList[j].Luck = FItemList[i].Luck) and (FSearchList[j].Level = FItemList[i].Level) then
Result := i;
6:if (FSearchList[j].Luck = FItemList[i].Luck) and (FSearchList[j].Options = FItemList[i].Options) then
Result := i;
7:if (FSearchList[j].Luck = FItemList[i].Luck) and (FSearchList[j].Options = FItemList[i].Options) and  (FSearchList[j].Level = FItemList[i].Level) then
Result := i;
8: if (FSearchList[j].Skill = FItemList[i].Skill) then
Result := i;
9: if (FSearchList[j].Skill = FItemList[i].Skill) and (FSearchList[j].Level = FItemList[i].Level) then
Result := i;
10: if (FSearchList[j].Skill = FItemList[i].Skill) and (FSearchList[j].Options = FItemList[i].Options) then
Result := i;
11: if (FSearchList[j].Skill = FItemList[i].Skill) and (FSearchList[j].Options = FItemList[i].Options) and (FSearchList[j].Level = FItemList[i].Level) then
Result := i;
12: if (FSearchList[j].Skill = FItemList[i].Skill) and  (FSearchList[j].Luck = FItemList[i].Luck) then
Result := i;
13: if (FSearchList[j].Skill = FItemList[i].Skill) and  (FSearchList[j].Luck = FItemList[i].Luck) and (FSearchList[j].Level = FItemList[i].Level) then
Result := i;
14: if (FSearchList[j].Skill = FItemList[i].Skill) and  (FSearchList[j].Luck = FItemList[i].Luck) and (FSearchList[j].Options = FItemList[i].Options) then
Result := i;
15: if (FSearchList[j].Skill = FItemList[i].Skill) and  (FSearchList[j].Luck = FItemList[i].Luck) and (FSearchList[j].Options = FItemList[i].Options) and (FSearchList[j].Level = FItemList[i].Level) then
Result := i;
end;
if Zen then
if (FSearchList[j].Zen >= MakeWord(FItemList[i].ExcAttributes,FItemList[i].Durabity)) then
Result := i;
if Anc then
if not (FItemList[i].Name = 'Zen') then
if (FItemList[i].ExcAttributes and $0C) >0 then
Result := i;
if Exc then
if not (FItemList[i].Name = 'Zen') then
if CompareMem(@FSearchList[j].ExcAttributes,@FItemList[i].ExcAttributes,1) then
Result := i;
end;
if Result > -1 then
FItemList[Result].Checked := True;
end;

function TMuItmes.CleanUp(Item: Integer): string;
begin
MainFrm.SystemLog(Format('Item %s picked UP!',[FItemList[Item].Name]),False);
FItemList[Item].Serial        := FItemList[High(FItemList)].Serial;
FItemList[Item].X             := FItemList[High(FItemList)].X;
FItemList[Item].Y             := FItemList[High(FItemList)].Y;
FItemList[Item].ExcAttributes := FItemList[High(FItemList)].ExcAttributes;
FItemList[Item].Durabity      := FItemList[High(FItemList)].Durabity;
FItemList[Item].Level         := FItemList[High(FItemList)].Level;
FItemList[Item].Options       := FItemList[High(FItemList)].Options;
FItemList[Item].Luck          := FItemList[High(FItemList)].Luck;
FItemList[Item].Skill         := FItemList[High(FItemList)].Skill;
FItemList[Item].Checked       := FItemList[High(FItemList)].Checked;
FItemList[Item].Name          := FItemList[High(FItemList)].Name;
if Item <= 0 then
SetLength(FItemList,0)
else
SetLength(FItemList,High(FItemList));
end;


procedure TMuItmes.RemItem(Buffer: PByteArray);
var
i,item: Integer;
begin
for i := 0 to Buffer[4] - 1 do
begin
item := ContainsItem(pWord(@Buffer[5+i*2])^);
if (item > -1)then
begin
FItemList[Item].Serial        := FItemList[High(FItemList)].Serial;
FItemList[Item].X             := FItemList[High(FItemList)].X;
FItemList[Item].Y             := FItemList[High(FItemList)].Y;
FItemList[Item].ExcAttributes := FItemList[High(FItemList)].ExcAttributes;
FItemList[Item].Durabity      := FItemList[High(FItemList)].Durabity;
FItemList[Item].Level         := FItemList[High(FItemList)].Level;
FItemList[Item].Options       := FItemList[High(FItemList)].Options;
FItemList[Item].Luck          := FItemList[High(FItemList)].Luck;
FItemList[Item].Skill         := FItemList[High(FItemList)].Skill;
FItemList[Item].Checked       := FItemList[High(FItemList)].Checked;
FItemList[Item].Name          := FItemList[High(FItemList)].Name;
if item <= 0 then
SetLength(FItemList,0)
else
SetLength(FItemList,High(FItemList));
end;
end;
end;

function TMuItmes.DelSreachItem(i: Integer): string;
var
Max: Integer;
begin
Max := High(FSearchList);
if Max <= 0 then
begin
ZeroMemory(@FSearchList,SizeOf(FSearchList));
SetLength(FSearchList,1);
Exit;
end
else
begin
Result := Format('Item: %s was removed',[FSearchList[i].Name]);
FSearchList[i].ExcAttributes := FSearchList[High(FSearchList)].ExcAttributes;
FSearchList[i].Level         := FSearchList[High(FSearchList)].Level;
FSearchList[i].Options       := FSearchList[High(FSearchList)].Options;
FSearchList[i].Zen           := FSearchList[High(FSearchList)].Zen;
FSearchList[i].Luck          := FSearchList[High(FSearchList)].Luck;
FSearchList[i].Skill         := FSearchList[High(FSearchList)].Skill;
FSearchList[i].Name          := FSearchList[High(FSearchList)].Name;
FSearchList[i].ByLevel       := FSearchList[High(FSearchList)].ByLevel;
FSearchList[i].ByOption      := FSearchList[High(FSearchList)].ByOption;
FSearchList[i].ByLuck        := FSearchList[High(FSearchList)].ByLuck;
FSearchList[i].BySkill       := FSearchList[High(FSearchList)].BySkill;
SetLength(FSearchList,High(FSearchList));
end;
end;


end.

[code]
unit uMuArray;

interface

uses
Windows, SysUtils;

const
Max        = 1000;
ItemsCount = 1000;
MNCount    = 1000;
MaPCount   = 1000;

type
TPlayerName = array[0..10] of AnsiChar;

TNumType = (Monster = 0,
Player  = 1,
Players = 2,
IName   = 3,
MName   = 4,
MaNName = 5,
SnD     = 6);

TMuMonsterArray = packed record
ID       : Word;
Name     : Word;
X        : Byte;
Y        : Byte;
end;

TMuPlayerArray = packed record
Name     : TPlayerName;
ID       : Word;
X        : Byte;
Y        : Byte;
Filter   : Boolean;
Detected : Boolean;
end;

TCounter = packed record
Num : Word;
end;

TName = packed record
Monsters : string;
Items    : packed array[0..16] of string;
Maps     : string;
end;

TNpc = packed record
ID : Word;
end;

TSkil = packed record
ID   : Byte;
Name : string;
Mana : Integer;
AG   : Integer;
end;

TIgnore = packed record
MobID : Word;
end;

TMuPackets = packed record
MoveToServer : array [0..9] of Byte;
MoveToClient : array [0..6] of Byte;
AtackPacket  : array [0..6] of Byte;
end;

TAccount = packed record
Name      : TPlayerName;
CharClass : Byte;
Level     : Word;
end;

procedure Clear(Clear: TNumType);

var
Recconection : Boolean = False;
GodMode   : Boolean = False;
TPackets  : TMuPackets;
PlayerName: TPlayerName;
MyName    : TPlayerName;
FaceDir   : Byte;
ViewX     : Byte;
ViewY     : Byte;
GuardCordY: Byte;
GuardCordX: Byte;
MyClass   : Byte;
MyLevel   : Word;
MyGuildID : Word;
MyExp     : Cardinal;
MyMaxExp  : Cardinal;
MyStr     : Word;
MyAgi     : Word;
MyVit     : Word;
MyEne     : Word;
MyHp      : Word;
MyMaxHp   : Word;
MyMana    : Word;
MyMaxMana : Word;
MyAG      : Word;
MyMaxAG   : Word;
ObjectID  : Word;
KillerID  : Word;
ReqMana   : Word;
TotalMonstersExp : Cardinal;
KilledMonsters   : Cardinal;
AvgExpPerMonster : Single;
StartTime : TTime;
DownloadedPacketsSize, UploadedPacketsSize: DWord;
TNum      : packed array [0..6] of TCounter;
TPlayers  : packed array [0..4] of TPlayerName;
TMonster  : packed array [0..Max -1] of TMuMonsterArray;
TPlayer   : packed array [0..Max -1] of TMuPlayerArray;
TNames    : packed array [0..Max -1] of TName;
TSkill    : packed array [0..Max -1] of TSkil;
TMyAcc    : packed array [0..4] of TAccount;

LorenciaPlace  : array [0..38] of string   =('Lower Vault','147','110','Higher Vault','147', '144','Devias Portal','7','40','Noria Portal','214','244','Dungeun Portal','122','230','Loren Portal','237','13','Lumen the Barmaid','123','133','Elf Soldier','96','128','Alex','63','130','Wandering Merchant','7','144','Trainer','123','110','Potion Girl','127','85','Hanzo the Blacksmith','118','141');
LorenPlace     : array [0..38] of string   =('Chair','176','214','Switch 1','163','190','Switch 2','189','190','Lot Portal','139','100','Crywolf Portal','159','43','Lorencia Portal','31','40','Gate 1','68','112','Gate 2','94','112','Gate 3','120','112','Gate 4','82','159','Gate 5','108','159','Gate 6','94','202','Room Chair Portal','94','240');
DeviasPlace    : array [0..38] of string   =('Baz the Vault Keeper','219','63','Wizard','226','40','Guild Master','215','44', 'Ziena Weapon Merchant','188','47','Sebina the Priest','184','31','Lahap','192','17','Elf Soldier','220','76','Thompson Kenel','9','77','Messenger of Archangel','209','29','Lorencia Portal','243','36','Lost Tower Portal','4','247','Devias 2','23','26','Devias 3','225','229');
DungeunPlace   : array [0..23] of string   =('Lorencia Portal','109','247','Dungeun 1 to 2 Portal','241','150','Dungeun 2 to 1 Portal','232','126','Bulls Room','116','46','Dungeun 2 to 3 Portal','6','32','Dungeun 2 to 3 Portal','4','18','Dungeun 3 to 2 Portal','3','84','Dungeun 3 to 2 Portal','29','125');
NoriaPlace     : array [0..23] of string   =('Baz the Vault Keeper','173','95','Goblin Scammer','180','102','Elf Lala','173','125','Elf Soldier','167','117','Eo the Craftsman','194','123','Charon','172','105','Aida portal','223','27','Atlans Portal','239','241');
Atlansplace    : array [0..14] of string   =('Atlans safe zone','22','16','Atlans 2','225','53','Atlans 3','65','163','Tarkan Portal','17','225','Noria Portal','13','11');
LosttowerPlace : array [0..8]  of string   =('Lost Tower Looby','207','76','Lost Tower 8','45','164','Icarus Portal','17','249');
ArenaPlace     : array [0..2]  of string   =('Arena Guard','73','164');
TarkanPlace    : array [0..17] of string   =('Atlans Portal','245','42','Tarkan Looby','188','57','Kanturu Portal','7','200','Tarkan 2','98','142','Left Out','155','58','Rigth Out','206','97');
KanturuPlace   : array [0..8]  of string   =('Tarkan Portal','20','218','Kanturu 2','204','39','Kanturu 3 Portal','84','91');
Kanturu3Place  : array [0..5]  of string   =('Kanturu 3 Looby','78','106','Refinary Portal','141','186');
AidaPlace      : array [0..8]  of string   =('Aida Looby','83','11','Aida Hot Spot','192','146','Aida 2','176','171');
IcarusPlace    : array [0..2]  of string   =('Lost Tower Portal','14','13');

const
TIgnored : packed array [0..45] of TIgnore = (
(MobID: $0064),(MobID: $0065),(MobID: $0067),(MobID: $0068),
(MobID: $0069),(MobID: $006A),(MobID: $0096),(MobID: $0061),
(MobID: $00E2),(MobID: $00E3),(MobID: $00E4),(MobID: $00E5),
(MobID: $00E6),(MobID: $00E9),(MobID: $00EA),(MobID: $00EB),
(MobID: $00EC),(MobID: $00ED),(MobID: $00EE),(MobID: $00EF),
(MobID: $00F0),(MobID: $00F1),(MobID: $00F2),(MobID: $00F3),
(MobID: $00F4),(MobID: $00F5),(MobID: $00F6),(MobID: $00F7),
(MobID: $00F8),(MobID: $00F9),(MobID: $00FA),(MobID: $00FB),
(MobID: $00FC),(MobID: $00FD),(MobID: $00FE),(MobID: $00FF),
(MobID: $0100),(MobID: $0101),(MobID: $0102),(MobID: $0103),
(MobID: $0171),(MobID: $0172),(MobID: $0181),(MobID: $019F),
(MobID: $01A0),(MobID: $01A1));

TItemHdr : packed array [0..15] of string = (
'Swords','Axes','Maces & Scepters','Spears','Bows & Crossbows','Staffs',
'Shields','Helms','Armors','P

549545


4ecHbIu

+1 ссылка не работает исправьте пожалуйста

Похожие темы (5)