Post Pacific  

Go Back   Post Pacific > Lineage 2 > Lineage 2 Server Modifications ONLY!
FAQ Community Calendar Today's Posts Search

Notices

 
 
Thread Tools Search this Thread Display Modes
Old 18.06.2006, 22:59   #26
testdude
Архивный участник
 
Join Date: Nov 2005
Posts: 504
Default

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...
testdude is offline  
Old 18.06.2006, 23:40   #27
Alien003
Архивный участник
 
Join Date: Jun 2005
Posts: 143
Default

DS:[socket + 1394h] = User Struct

8)
Alien003 is offline  
Old 19.06.2006, 00:04   #28
testdude
Архивный участник
 
Join Date: Nov 2005
Posts: 504
Default

wait a minute... so... the socket as in the one for the user? cos if so im gonna scream ^_^
testdude is offline  
Old 19.06.2006, 00:16   #29
mcrabben7
Архивный участник
 
Join Date: Apr 2006
Posts: 461
Default

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.?
mcrabben7 is offline  
Old 19.06.2006, 00:22   #30
testdude
Архивный участник
 
Join Date: Nov 2005
Posts: 504
Default

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
testdude is offline  
Old 19.06.2006, 00:34   #31
mcrabben7
Архивный участник
 
Join Date: Apr 2006
Posts: 461
Default

Alright, thanks for the reply. I have (some) reference on what is in the UserInfo packet, so I'll try that. Thanks.
mcrabben7 is offline  
Old 19.06.2006, 00:38   #32
Alien003
Архивный участник
 
Join Date: Jun 2005
Posts: 143
Default

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
Alien003 is offline  
Old 19.06.2006, 05:57   #33
max_rain
Архивный участник
 
Join Date: Apr 2006
Posts: 42
Default

Procedures with offsets

Вложения из исходного сообщения (сами файлы в копии отсутствуют):
1190_142.rar — 14909 байт
max_rain is offline  
Old 19.06.2006, 10:38   #34
Saito
Архивный участник
 
Join Date: May 2006
Posts: 39
Default

Great work mcabben7,

Good luck with project Elhaym

Looks very promissing
Saito is offline  
Old 19.06.2006, 12:28   #35
Grillo
Архивный участник
 
Join Date: Oct 2005
Posts: 73
Default

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.
Grillo is offline  
Old 19.06.2006, 12:34   #36
max_rain
Архивный участник
 
Join Date: Apr 2006
Posts: 42
Default

grillo, pm me in icq or msn
max_rain is offline  
Old 19.06.2006, 13:04   #37
GeNtOo
Архивный участник
 
Join Date: Jan 2006
Posts: 69
Default

nice project, if I can i try help too
GeNtOo is offline  
Old 19.06.2006, 13:21   #38
GeNtOo
Архивный участник
 
Join Date: Jan 2006
Posts: 69
Default

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
GeNtOo is offline  
Old 19.06.2006, 14:53   #39
Alien003
Архивный участник
 
Join Date: Jun 2005
Posts: 143
Default

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)
Alien003 is offline  
Old 19.06.2006, 15:03   #40
GeNtOo
Архивный участник
 
Join Date: Jan 2006
Posts: 69
Default

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 is offline  
Old 19.06.2006, 15:04   #41
GeNtOo
Архивный участник
 
Join Date: Jan 2006
Posts: 69
Default

tomorrow ill work on clan penaltys
GeNtOo is offline  
Old 19.06.2006, 17:42   #42
Enishi
Архивный участник
 
Join Date: Apr 2005
Posts: 354
Default

Turns out I cant compile the dll cuz i'm missing windows.h ._.
Free version of VS2K5 ftl
Enishi is offline  
Old 19.06.2006, 17:55   #43
BeBu
Архивный участник
 
Join Date: Feb 2006
Posts: 8
Default

get the plattform sdk here :
http://www.microsoft.com/msdownload/...sdk/sdkupdate/
BeBu is offline  
Old 19.06.2006, 18:43   #44
Enishi
Архивный участник
 
Join Date: Apr 2005
Posts: 354
Default

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
Ok so i'm totally noob at this but i'm trying to learn...how would I use the code above in the DLL?
Enishi is offline  
Old 19.06.2006, 18:43   #45
Cthalupa
Архивный участник
 
Join Date: Jun 2006
Posts: 7
Default

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
Cthalupa is offline  
Old 19.06.2006, 19:03   #46
Saito
Архивный участник
 
Join Date: May 2006
Posts: 39
Default

yeah I'm sure the people running a ilegal l2 off server will back off the MIT license ~_~
Saito is offline  
Old 19.06.2006, 19:10   #47
zako
Архивный участник
 
Join Date: May 2006
Posts: 3
Default

I'll look into this, And see what i can contribute, I also pmed you macraben
zako is offline  
Old 19.06.2006, 23:03   #48
mcrabben7
Архивный участник
 
Join Date: Apr 2006
Posts: 461
Default

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
mcrabben7 is offline  
Old 19.06.2006, 23:06   #49
Enishi
Архивный участник
 
Join Date: Apr 2005
Posts: 354
Default

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"
Enishi is offline  
Old 19.06.2006, 23:21   #50
mcrabben7
Архивный участник
 
Join Date: Apr 2006
Posts: 461
Default

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.
mcrabben7 is offline  
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 22:21.