Post Pacific

Post Pacific (https://postpacific.mmorpg-game.online/index.php)
-   Lineage 2 Server Modifications ONLY! (https://postpacific.mmorpg-game.online/forumdisplay.php?f=28)
-   -   [Work In progress] Humble Beginnings of an L2Server C++ DLL (https://postpacific.mmorpg-game.online/showthread.php?t=4833)

testdude 18.06.2006 22:59

the user struct in the l2server, as told to me by alien003, is stored in ECX for any User:: function, so then all you really need to do is hook the dword table address for userinfo, get all the info u need out of the user struct when the userinfo packet is sent, and store it in a struct... i found that the best way to store the info in the struct is by char id for easy lookup, though i didnt really look into it all that much, i also found it best to store the socket in the struct, aswell as charname and sid, so that for packets such as autoss you can look up in the table by socket, as thats the only thing u will have from the packet, though i dont know if there are any functions to get sid or charid or name from the socket in the l2server, so i dont really know, this was just easyest for what i did as i wasnt sure about any functions at the time...

Alien003 18.06.2006 23:40

DS:[socket + 1394h] = User Struct

8)

testdude 19.06.2006 00:04

wait a minute... so... the socket as in the one for the user? cos if so im gonna scream ^_^

mcrabben7 19.06.2006 00:16

Is the location where I hook packets (50F8F4) inside this same User scope so that I can get the information? Will the pointer to the start of the packet + 1394h give me the user struct? Also, I don't even know where to begin knowing what is in the User struct. Is there any good way to know what part of it is what, how big each entry is, etc.?

testdude 19.06.2006 00:22

if im not mistaken what u have labled as the "start of the packet" is the socket, i dont know where u hooked the packets so i dunno, but i dont think its the same place i did mine xD


also, good way to find out what is where in user struct, debug userinfo packet

mcrabben7 19.06.2006 00:34

Alright, thanks for the reply. I have (some) reference on what is in the UserInfo packet, so I'll try that. Thanks.

Alien003 19.06.2006 00:38

Quote:

Originally Posted by testdude
wait a minute... so... the socket as in the one for the user? cos if so im gonna scream ^_^

scream :P

dunno what arguments your hook function is using, I'm catching them using the function table, just like normal packets

my functions prototypes are

BOOL function(void* pSocket, const char* pData);

DS:[pSocket + 1394h] = pUser

DS:[DS:[pUser + 0f54h] + numberFromAI] = same parameter as in AI

DS:[pUser + 0f60h] = CInventory


and just correcting a thing testdude said

Quote:

the user struct in the l2server, as told to me by alien003, is stored in ECX for any User:: function
thats only valid at the start of the function, after that it's ALWAYS copyed to other register , usually EDI, ESI or EBX

max_rain 19.06.2006 05:57

Procedures with offsets

Вложения из исходного сообщения (сами файлы в копии отсутствуют):
1190_142.rar — 14909 байт

Saito 19.06.2006 10:38

Great work mcabben7,

Good luck with project Elhaym

Looks very promissing

Grillo 19.06.2006 12:28

I wish my C++ knowledge was better, I can only create small stupid programs.
But I was wondering if the function , when u double click on an item, it changes in another item is possible to add in this dll, or is that function AI, don't know much about it.

max_rain 19.06.2006 12:34

grillo, pm me in icq or msn

GeNtOo 19.06.2006 13:04

nice project, if I can i try help too :)

GeNtOo 19.06.2006 13:21

hmm maybe this is good but i dont think so:(

Code:

//ally limit

const WORD AllyLimit = 0x83 F8 0C 72 38 90 90 90 90
const WORD AllyLimit_1 = 0x0C //0C Clans amount +1 exp.: 0C=12 +1 so in ally 13clans (1slot for owner)


//allyLimit

DWORD * NewAllyLimitAddr = (DWORD *)0x00512877;
        *NewAllyLimitAddr  = (DWORD)AllyLimit;


DWORD * NewAllyLimit_1Addr = (DWORD *)0x00512879;
        *NewAllyLimit_1Addr  = (DWORD)AllyLimit_1;

lil updated

Alien003 19.06.2006 14:53

Quote:

Originally Posted by max_rain
Procedures with offsets

hey how about giving credit or posting a link to the original topic??? :evil:
https://postpacific.mmorpg-game.onli...ic.php?p=43314
(its updated btw)

GeNtOo 19.06.2006 15:03

CLan ppl limits

Code:

//clan limits

const WORD CLan_0 = 0x0A
const WORD CLan_1 = 0x0F
const WORD CLan_2 = 0x14
const WORD CLan_3 = 0x19
const WORD CLan_4 = 0x1E
const WORD CLan_5 = 0x28

//clan limits

DWORD * NewCLan_0Addr = (DWORD *)0x0051038C;
        *NewCLan_0Addr  = (DWORD)CLan_0;
               
DWORD * NewCLan_1Addr = (DWORD *)0x005103D6;
        *NewCLan_1Addr  = (DWORD)CLan_1;
               
DWORD * NewCLan_2Addr = (DWORD *)0x005103E0;
        *NewCLan_2Addr  = (DWORD)CLan_2;
               
DWORD * NewCLan_3Addr = (DWORD *)0x005103EA;
        *NewCLan_3Addr  = (DWORD)CLan_3;
               
DWORD * NewCLan_4Addr = (DWORD *)0x005103F4;
        *NewCLan_4Addr  = (DWORD)CLan_4;
               
DWORD * NewCLan_5Addr = (DWORD *)0x005103FE;
        *NewCLan_5Addr  = (DWORD)CLan_5;


GeNtOo 19.06.2006 15:04

tomorrow ill work on clan penaltys :)

Enishi 19.06.2006 17:42

Turns out I cant compile the dll cuz i'm missing windows.h ._.
Free version of VS2K5 ftl :(

BeBu 19.06.2006 17:55

get the plattform sdk here :
http://www.microsoft.com/msdownload/...sdk/sdkupdate/

Enishi 19.06.2006 18:43

Quote:

Originally Posted by GeNtOo
CLan ppl limits

Code:

//clan limits

const WORD CLan_0 = 0x0A
const WORD CLan_1 = 0x0F
const WORD CLan_2 = 0x14
const WORD CLan_3 = 0x19
const WORD CLan_4 = 0x1E
const WORD CLan_5 = 0x28

//clan limits

DWORD * NewCLan_0Addr = (DWORD *)0x0051038C;
        *NewCLan_0Addr  = (DWORD)CLan_0;
               
DWORD * NewCLan_1Addr = (DWORD *)0x005103D6;
        *NewCLan_1Addr  = (DWORD)CLan_1;
               
DWORD * NewCLan_2Addr = (DWORD *)0x005103E0;
        *NewCLan_2Addr  = (DWORD)CLan_2;
               
DWORD * NewCLan_3Addr = (DWORD *)0x005103EA;
        *NewCLan_3Addr  = (DWORD)CLan_3;
               
DWORD * NewCLan_4Addr = (DWORD *)0x005103F4;
        *NewCLan_4Addr  = (DWORD)CLan_4;
               
DWORD * NewCLan_5Addr = (DWORD *)0x005103FE;
        *NewCLan_5Addr  = (DWORD)CLan_5;


Thanks Bebu :D
Ok so i'm totally noob at this but i'm trying to learn...how would I use the code above in the DLL?

Cthalupa 19.06.2006 18:43

I fully support your right to make money off of your hard work, as it's certainly a worthy endeavor you're partaking in, and if it comes to fruit, will be a great boon on the community.

However...

Quote:

Permission is hereby granted, free of charge, to any person obtaining a copy of this
software and associated documentation files (the "Software"), to deal in the Software
without restriction, including without limitation the rights to use, copy, modify,
merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so
By releasing it under the MIT license, you just allowed everyone to do basicly whatever they want with it, as long as they include the license file, etc.


Yet right under that, you say people aren't allowed to sell it, or use it at all in anything that involves them making money, including using it on servers where the operator makes a profit. You can't release something under a license, and then say "disregard part so and so". It leaves you no legal options if someone is violating the terms you mean to set, but are allowed in the actual license you released it under.

So, if you're against people using this for money, you might want to choose a different license to release it under :)

Saito 19.06.2006 19:03

yeah I'm sure the people running a ilegal l2 off server will back off the MIT license ~_~

zako 19.06.2006 19:10

I'll look into this, And see what i can contribute, I also pmed you macraben

mcrabben7 19.06.2006 23:03

Meh, I'll rewrite my own License file then :P The code you have now is only a skeleton frame. That much of the code is just fine, M.I.T. license or not :P

BTW, Packet Dump of an AutoSS packet:

Packet Dump: d0 05 00 ba 05 00 00 01 00 00 00 :)

Enishi 19.06.2006 23:06

Would someone mind posting the steps one would take to complete a basic fix...like getting the packet info and so on.
Trying to learn so what i'm gonna work on is changing the systemmessage when you heal/someone heals you.
"BlahblahHP has been restored by blahblah"

mcrabben7 19.06.2006 23:21

The code I posted already gets the packet headers for you. If you want to get a specific part of the packet, set header (I renamed it to pBuffer now) to + x bytes, depending where the data you want is. Then read a DWORD (4 bytes) worth of data and store it for your use.

Here is a packet dump function which I will share:
Code:

// Allows for the complete dump of a packet to the log file
//
// Parameters:
// DWORD * packet - the address of the start of the packet (pBuffer)
// DWORD bytes - how many bytes to dump to the log file
//
void DumpPacket(DWORD * packet, DWORD bytes)
{
        WORD temp = 0;
        DWORD * packetAddr = 0;
        packetAddr = packet;
        file << ">>>>>>>>> Packet Dump: ";
        for(unsigned int i=0; i < bytes; ++i)
        {
                temp = (BYTE)*(packetAddr);
                if(temp<16) {
                        file << "0" << temp << " ";
                } else {
                        file << temp << " ";
                }
                __asm { add        packetAddr, 1 }
        }
        file << "\n";
        file.flush();
}

Send it the address of the start of the packet. In my code I uploaded, send it header. I have since then renamed header to pBuffer, packet to pSocket, and changed packetStart in all functions to pSocket. Those names make more sense about what the pointer points to.

Also, here is how you access the SystemMessage functionality in L2Server. See L2J for an idea of all the possible combinations and values. It is a pretty robust packet format.

Code:

//SystemMessage
format = "cdddd";
__asm
{
        push        itemID                        //itemID
        push        3                                //??
        push        1                                //??
        push        msgID                        //system message ID
        push        0x7A                        //packet header
        push        format                        //packet format 'cdddd'
        push        pSocket                        //pushes the address of the start of the packet
        call        fCUserSocketSend
        add                esp, 0x1C                //fix our stack pointer (7 * 0x04 = 0x1C)
}

Take careful note of how the packet format is cddd + however many parameters you give it extra. That will have to be accounted for. Like I said, see L2J for the outline of how that is structured.

Enishi: I am not sure exactly which packet handles healing. It might be an internal call to send a SystemMessage packet that will need to be hooked and changed to show the HP healed. I'm not sure on this yet. if it is a specific packet for healing, then hook it, call your own function, and write the code to handle it.


All times are GMT. The time now is 16:12.