PDA

View Full Version : [share]L2Extend source code


torune
20.06.2006, 06:12
final words from me:
due to personal issue, i am out of this community, so good luck on dev/cracking/hacking guys
i will share certain features that directly rip from my dll.
havent decided if i should put complete project out, or maybe some of you can buy my source * :D *, but at least you guys will get something.
i dont use asm code for most of my features, and i wont give out any struct code, but its not really hard to get your own, just time consuming

RequestChangePartyLeader

bool __cdecl isInParty(BYTE * pParty, DWORD dwTargetID)
{
BYTE *pUser;
int nPartySize, i;
DWORD dwObjectID;

PARTY aParty;
aParty.pFirst = NULL;
aParty.pLast = NULL;
MakeParty(pParty, &aParty);
nPartySize = ((DWORD)aParty.pLast - (DWORD)aParty.pFirst) / 4;

i = 0;
while(i < nPartySize)
{
pUser = (unsigned char*)(*(unsigned int*)(aParty.pFirst + i * 4));
dwObjectID = *(unsigned int*)(pUser + 0x18);
if (dwObjectID == dwTargetID) return true;
++i;
}
return false;
}

void __cdecl AnnounceNewPartyLeader(BYTE * pParty, wchar_t *ptarget_name)
{
BYTE *pUser, *pSocket;
int nPartySize, i;

PARTY aParty;
aParty.pFirst = NULL;
aParty.pLast = NULL;
MakeParty(pParty, &aParty);
nPartySize = ((DWORD)aParty.pLast - (DWORD)aParty.pFirst) / 4;

i = 0;
while(i < nPartySize)
{
pUser = (unsigned char*)(*(unsigned int*)(aParty.pFirst + i * 4));
pSocket = (unsigned char*)(*(unsigned int*)(pUser + 0x19B8));
Lin2Send(pSocket, "cdddS", 0x7A, 1384, 1, 0, ptarget_name);
++i;
}
}

void __cdecl RequestChangePartyLeader(BYTE * pData, BYTE* pUser, BYTE * pSocket)
{
BYTE *pBuffer, *pParty, *pTargetUser;
wchar_t *ptarget_name;
DWORD dwLeaderID, dwObjectID, dwTargetID;

pBuffer = pData;

if (pUser!=NULL)
{
ptarget_name = (wchar_t*)pBuffer;
pParty = GetParty(pUser);
if (pParty == NULL)
{
Lin2Send(pSocket, "cd", 0x7A, 1403);
return;
}
dwLeaderID = *(unsigned int*)(*(unsigned int*)(pParty +0x28) + 0x70);
dwObjectID = *(unsigned int*)(pUser +0x18);

if (dwObjectID != dwLeaderID)
{
Lin2Send(pSocket, "cd", 0x7A, 1399);
return;
}
pTargetUser = wchar2pUser(pBuffer);
if (pTargetUser == NULL) return;
dwTargetID = *(unsigned int*)(pTargetUser +0x18);

if (dwTargetID == dwObjectID)
{
Lin2Send(pSocket, "cd", 0x7A, 1401);
return;
}
if (isInParty(pParty, dwTargetID))
{
*(unsigned int*)(*(unsigned int*)(pParty +0x28) + 0x70) = dwTargetID;
AnnounceNewPartyLeader(pParty,ptarget_name);
}
else
{
Lin2Send(pSocket, "cd", 0x7A, 1402);
}
}
}

torune
20.06.2006, 06:15
void RequestEvaluate()

void RequestEvaluate(BYTE *pData, BYTE *pUser, BYTE *pSocket)
{
DWORD dwTarget, dwLevel;
BYTE *pBuffer;
BYTE *pUserTarget, *pSocketTarget;

LPTSHAREDDATA TSharedData, TargetSharedData;

if(pUser == NULL) return;

TSharedData = (LPTSHAREDDATA)(*(unsigned int*)(pUser + 0xF54));
dwLevel = TSharedData->LEVEL;
pBuffer = pData;
dwTarget = *(unsigned int*)pBuffer;
pBuffer += sizeof(unsigned int);
pUserTarget = GetCreature(dwTarget);

if(dwLevel < 10)
{
Lin2Send(pSocket, "cd", 0x7A, 898);
}
else if(TSharedData->RecomLeft <= 0)
{
Lin2Send(pSocket, "cd", 0x7A, 833);
}
else if(pUserTarget == pUser)
{
Lin2Send(pSocket, "cd", 0x7A, 829);
}
else if(pUserTarget == NULL)
{
Lin2Send(pSocket, "cd", 0x7A, 144);
}
else
{

pSocketTarget = (unsigned char*)(*(unsigned int*)(pUserTarget + 0x19B8));
TargetSharedData = (LPTSHAREDDATA)(*(unsigned int*)(pUserTarget + 0xF54));

if(TargetSharedData->RecomHave >= 255)
{
Lin2Send(pSocketTarget, "cd", 0x7A, 1188);
}
else
{
TSharedData->RecomLeft--;
TargetSharedData->RecomHave++;

CDBSend(0x1720CB90, "cdddddd", 0xe7, *(unsigned int*)(pUser + 0x18), *(unsigned int*)(pUser + 0x14), TSharedData->RecomLeft, *(unsigned int*)(pUserTarget + 0x18), *(unsigned int*)(pUserTarget + 0x14), TargetSharedData->RecomHave);
}
}
}

torune
20.06.2006, 06:16
void RequestUserCommand()


void __cdecl ShowLocPacket(BYTE* pUser,BYTE * pSocket)
{
LPTSHAREDDATA TSharedData;
int tileX,tileY;
int nRegion,nLocaltion;
int x,y,z;

TSharedData = (LPTSHAREDDATA)(*(unsigned int*)(pUser + 0xF54));
x = (int)TSharedData->x;
y = (int)TSharedData->y;
z = (int)TSharedData->z;
tileX = (( x >> 15 ) + 4 )& 0x1F;
tileY = (( y >> 15 ) + 10)& 0x1F;
nRegion = _regions[tileY][tileX];
if (nRegion > 15) nLocaltion = 924;
else nLocaltion = _LOC_MSG[nRegion];

Lin2Send(pSocket, "cdddddddd", 0x7A, nLocaltion, 3, 1, x, 1, y, 1, z);
}

void __cdecl ShowTimePacket(BYTE* pUser,BYTE * pSocket)
{
SYSTEMTIME st;
GetLocalTime(&st);
if (st.wHour<12)
{
Lin2Send(pSocket, "cdddddd", 0x7A, 927, 2, 1, st.wHour, 1, st.wMinute);
}
else
Lin2Send(pSocket, "cdddddd", 0x7A, 928, 2, 1, st.wHour, 1, st.wMinute);
}

void __cdecl ShowPartyInfoPacket(BYTE* pUser,BYTE * pSocket)
{
BYTE *pParty;
DWORD dwLoot;
pParty = GetParty(pUser);
if (pParty == NULL) return;
dwLoot = *(unsigned int*)(pParty +0x44);
Lin2Send(pSocket, "cd", 0x7A, 1030);
switch (dwLoot) {
case 0: Lin2Send(pSocket, "cd", 0x7A, 1031); break;
case 1: Lin2Send(pSocket, "cd", 0x7A, 1032); break;
case 2: Lin2Send(pSocket, "cd", 0x7A, 1033); break;
case 3: Lin2Send(pSocket, "cd", 0x7A, 1034); break;
case 4: Lin2Send(pSocket, "cd", 0x7A, 1035); break;
}
}

void __cdecl RequestUserCommand(BYTE * pData, BYTE* pUser, BYTE * pSocket)
{
DWORD dwCommand;
BYTE* pBuffer;
pBuffer = pData;
if (pUser!=NULL)
{
dwCommand = *(unsigned int*)pBuffer;
switch(dwCommand)
{
case 0: ShowLocPacket(pUser,pSocket); break;
case 77: ShowTimePacket(pUser,pSocket); break;
case 81: ShowPartyInfoPacket(pUser,pSocket); break;
}
}
}

torune
20.06.2006, 06:19
void partysmallwindow()



void __declspec(naked) PartySmallWindowAll()
{
__asm{
mov eax, 0058C3ACh;
call eax;
FLD QWORD PTR DS:[ESI+160h];
push eax; //MaxMp
mov eax, 0058C3ACh;
call eax;
FLD QWORD PTR DS:[ESI+3E8h];
push eax; //CurrentMp
mov eax, 0058C3ACh;
call eax;
FLD QWORD PTR DS:[ESI+158h];
push eax; //MaxHp
mov eax, 0058C3ACh;
call eax;
push eax; //CurrentHp
push [esi]TSHAREDDATA.MaxCp;
push [esi]TSHAREDDATA.CurrentCp;
ADD ESI,0A0h;
PUSH ESI;
PUSH EDI;
MOV EAX,2000h;
PUSH sFormat_5; //dSdddddddddd
SUB EAX,EBX;
PUSH EAX;
LEA ECX,DWORD PTR SS:[EBP+EBX-2030h];
PUSH ECX;
mov eax, 0053AFA0h;
CALL eax;
ADD ESP,3Ch;
mov edx, 004B5562h
jmp edx;
}
}

void __declspec(naked) PartySmallWindowAllLeaderPatch()
{
__asm{
MOV EDX,DWORD PTR SS:[EBP-14h];
LEA ECX,DWORD PTR SS:[EBP-2030h];
PUSH ECX;
PUSH EBX;
PUSH EDX;

mov eax, DWORD PTR SS:[EBP+8];
mov ecx, eax;
CALL fGetParty;
push [eax+44h]; //loot type
mov eax, [eax+28h];
push [eax+70h]; //leader object id

push 63h;
PUSH sFormat_4;
MOV ECX,DWORD PTR SS:[EBP+8];
MOV EAX,DWORD PTR DS:[ECX+19B8h];
mov edx, 004B5592h;
jmp edx;
}
}
void __declspec(naked) PartySmallWindowUpdate()
{
__asm{
MOV ECX,DWORD PTR SS:[EBP-24h];
MOV EDX,DWORD PTR SS:[EBP-28h];
MOV ESI,DWORD PTR SS:[EBP-2Ch];
MOV EAX,DWORD PTR DS:[EDI+19B8h];

push ecx; //ClassId
PUSH EDX; //level
MOV ECX,DWORD PTR SS:[EBP-18h];
MOV EDX,DWORD PTR SS:[EBP-1Ch];
PUSH ECX; //MaxMp
PUSH EDX; //CurrentMp
MOV ECX,DWORD PTR SS:[EBP-14h];
MOV EDX,DWORD PTR SS:[EBP-30h];
PUSH ECX; //MaxHp
PUSH ESI; //CurrentHp

mov esi, [EBP+8];
mov esi, [esi+0f54h];
push [esi]TSHAREDDATA.MaxCp;
push [esi]TSHAREDDATA.CurrentCp;

PUSH EDX;
PUSH EBX;
push 67h;

PUSH sFormat_6; //cdSdddddddd
push eax;
CALL fSendToSinglePlayer;
MOV EAX, DWORD PTR SS:[EBP+0Ch];
ADD ESP, 34h;
mov edx, 004B5267h;
jmp edx;
}
}

void __declspec(naked) PartySmallWindowAdd()
{
__asm{

PUSH ECX; //CurrentMp
MOV EDX,DWORD PTR SS:[EBP-24h];
MOV ECX,DWORD PTR SS:[EBP-28h];
PUSH EDX; //MaxHp
PUSH ECX; //CurrentMp
MOV EDX,DWORD PTR SS:[EBP-2Ch];
MOV ECX,DWORD PTR SS:[EBP-30h];
push edx;


mov edx, [EBP+8];
mov edx, [edx+0f54h];
push [edx]TSHAREDDATA.MaxCp;
push [edx]TSHAREDDATA.CurrentCp;

push ecx;
push ebx;
PUSH 0;
push 0;
push 64h;

PUSH sFormat_7; //cdddSdddddddddd
push eax;
call fSendToSinglePlayer;
add esp, 44h;
mov edx, 004B540dh;
jmp edx;
}
}

Saito
20.06.2006, 06:26
too bad that you're leaving and thank you soo much for all the efford you have put in the community.

I hope you can resolve your personal issues and come back here :)

torune
20.06.2006, 06:31
there is no coming back like last time

torune
20.06.2006, 06:35
btw
livid and stazis if you want my source code, send a message thru icq.:)

mcrabben7
20.06.2006, 09:25
Too bad to see you go Torune. But, good luck in your real life.

tpuNIsher
20.06.2006, 09:28
I hope this isn't the last we see you here because that would be a great loss to the community. Ah well, hope you come back...
Thanks for these shares, and for the future ones if you do make, what you said you are thinking about..

Respect to you, as a dev. Dunno as a person, but best of luck with whatever you do.

Thank you.


Yours..
-NeosinneR.

TheOrder
20.06.2006, 09:36
Good luck bro , even if I don't know you very well and all you a great guy and the best dev on this community !!!

Btw bro enter MSN for the last time i need to have a chat with u . Tnx !!! And GL in RL

montejo1974
20.06.2006, 10:44
Same as said before ;)

The community lost one of their more important researchers (I prefer that english word than just developer). The community will not be the same without you.

Be lucky.

RipperX
20.06.2006, 11:07
I didn't expect this.. but good luck dude!
btw, if u can give me some help with recipebook i'll be grated ^^

bb and gluck

Aikeleer
20.06.2006, 11:38
U gonna play WoW now? :P

torune
20.06.2006, 11:46
i gotta play a good good study student role now.

torune
20.06.2006, 11:47
and please, noobs, stop spamming my pm begging for source code.
if you wanna play l33t, try to learn more.

HF
20.06.2006, 12:02
and please, noobs, stop spamming my pm begging for source code.
if you wanna play l33t, try to learn more.Ideas.. Why everyone give the work, only when leave?

Ideas second. Maybe you can share your last good l2extend? Or this not exist? Or it commercial release? I think, that this l2extend has lost a urgency with arrival new l2extender.

RipperX
20.06.2006, 12:05
HF, if torune don't want share everything he don't do that, is his source, his property, i guess.

toolpunk
20.06.2006, 12:13
well...
maybe you're gonna join my arts community.
i don't even have one atm, but hey you never know what you end up with in life :P

HF
20.06.2006, 12:19
...
you never know what you end up with in life :Pyour signature image confirms it

toolpunk
20.06.2006, 12:29
yeah, cookies ftw :D

smeli
20.06.2006, 13:02
>....just time consuming

yeah yeah
every man must invent the bicycle on his own, right?

Aikeleer
20.06.2006, 15:16
It's pretty pathetic that people that don't even realise the value of his share start being greedy. I can see why people don't want to share anything on this forum. Shame on you.