Newbie Spellweaver
- Joined
- Sep 25, 2005
- Messages
- 78
- Reaction score
- 1
Well hi to all coders, i had been hear than some teams got freaking troubles on understand how new protocol for items works for new clients, so i develop some weeks ago this fuction for reeplase some old one in GS and it will help alot to coders on change the protocol to new clients, so here i left it:
Well this fuction is a reeplase of the current call:
Most knowed has the item byte converter, wich is used alot of times for take the itembyte, but i will set a example:
well you can check there the difference between 1.02 and 1.0h, what change is the itemID wich is under [] and 2 new bits, one when its holded the section wich belongs to that item, and the last byte wich is for new items.
what this fuction make is convert the 1.0h value wich on example is 66 and return on ECX regist 06 (value used for 1.02), on EAX will be returned if the instruction was sucefull completed with the value 1 (1 = correct, 0 = wrong). The fuction present also a empty space wich is defined on -data and .const
section wich is for hold the itemID and the itemSection, so you can easy later can use that empty space for you new packets. (GS to client)
the source has been compiled on a DLL, and its tested also works fully, this is only a little help to coders than want to mod the item protocol for any new client and hope you guys can make it fast :juggle:.
Wish best luck to my brothers of real coding, FeN$x.
Ciao
Code:
.Const
ITEMSECTIONSPACE Equ 40H
ITEMINDEXSPACE Equ 40H
.Data
ItemSection DB ITEMSECTIONSPACE Dup(0)
GlobalItemIndex DB ITEMINDEXSPACE Dup(0)
CalculateItemID Proc
Local CMyItemID:DWord
Local CMyItemIndex:DWord
Push Ebx
Push Esi
Push Edi
Mov Ecx, DWord Ptr Ss:[Ebp + 8H]
Mov CMyItemID, Ecx
Xor Eax, Eax
Mov Eax, 1
Cmp Ecx, 0
Je CalculateItemIDEnd
Xor Eax, Eax
CSubNumbers:
Add Eax, 1
Sub Ecx, 10H
Cmp Ecx, 0
Je CMoveItemID
Cmp Ecx, 0FFFFFFFFH
Jle CMoveItemID
Jmp CSubNumbers
CMoveItemID:
Mov Ecx, CMyItemID
Cmp Ecx, 1FH
Jle CDecreaseBytebyone
Cmp Ecx, 21H
Jge CCheckAll
Jmp CCalculateItemSection
CCheckAll:
Cmp Ecx, 20H
Je CCalculateItemSection
Cmp Ecx, 40H
Je CCalculateItemSection
Cmp Ecx, 60H
Je CCalculateItemSection
Cmp Ecx, 80H
Je CCalculateItemSection
Cmp Ecx, 0A0H
Je CCalculateItemSection
Cmp Ecx, 0C0H
Je CCalculateItemSection
Cmp Ecx, 0E0H
Je CCalculateItemSection
Cmp Ecx, 100H
Je CCalculateItemSection
Cmp Ecx, 120H
Je CCalculateItemSection
Cmp Ecx, 140H
Je CCalculateItemSection
Cmp Ecx, 160H
Je CCalculateItemSection
Cmp Ecx, 180H
Je CCalculateItemSection
Cmp Ecx, 1A0H
Je CCalculateItemSection
Cmp Ecx, 1C0H
Je CCalculateItemSection
Cmp Ecx, 1E0H
Je CCalculateItemSection
CDecreaseBytebyone:
Sub Eax, 1
CCalculateItemSection:
IMul Eax, Eax, 10H
Mov CMyItemIndex, Eax
Mov Ecx, CMyItemID
Sub Ecx, Eax
Mov DWord Ptr GlobalItemIndex, Ecx
CheckByteSection:
Mov Eax, CMyItemIndex
Cmp Eax, 10H
Je Cits0
Cmp Eax, 20H
Je Cits10
Cmp Eax, 40H
Je Cits20
Cmp Eax, 60H
Je Cits30
Cmp Eax, 80H
Je Cits40
Cmp Eax, 0A0H
Je Cits50
Cmp Eax, 0C0H
Je Cits60
Cmp Eax, 0E0H
Je Cits70
Cmp Eax, 100H
Je Cits80
Cmp Eax, 120H
Je Cits90
Cmp Eax, 140H
Je Cits100
Cmp Eax, 160H
Je Cits110
Cmp Eax, 180H
Je Cits120
Cmp Eax, 1A0H
Je Cits130
Cmp Eax, 1C0H
Je Cits140
Cmp Eax, 1E0H
Je Cits150
Xor Eax, Eax
Jmp CalculateItemIDEnd
Cits0:
Mov ItemSection, 0
Xor Eax, Eax
Mov Eax, 1
Jmp CalculateItemIDEnd
Cits10:
Mov ItemSection, 10H
Xor Eax, Eax
Mov Eax, 1
Jmp CalculateItemIDEnd
Cits20:
Mov ItemSection, 20H
Xor Eax, Eax
Mov Eax, 1
Jmp CalculateItemIDEnd
Cits30:
Mov ItemSection, 30H
Xor Eax, Eax
Mov Eax, 1
Jmp CalculateItemIDEnd
Cits40:
Mov ItemSection, 40H
Xor Eax, Eax
Mov Eax, 1
Jmp CalculateItemIDEnd
Cits50:
Mov ItemSection, 50H
Xor Eax, Eax
Mov Eax, 1
Jmp CalculateItemIDEnd
Cits60:
Mov ItemSection, 60H
Xor Eax, Eax
Mov Eax, 1
Jmp CalculateItemIDEnd
Cits70:
Mov ItemSection, 70H
Xor Eax, Eax
Mov Eax, 1
Jmp CalculateItemIDEnd
Cits80:
Mov ItemSection, 80H
Xor Eax, Eax
Mov Eax, 1
Jmp CalculateItemIDEnd
Cits90:
Mov ItemSection, 90H
Xor Eax, Eax
Mov Eax, 1
Jmp CalculateItemIDEnd
Cits100:
Mov ItemSection, 0A0H
Xor Eax, Eax
Mov Eax, 1
Jmp CalculateItemIDEnd
Cits110:
Mov ItemSection, 0B0H
Xor Eax, Eax
Mov Eax, 1
Jmp CalculateItemIDEnd
Cits120:
Mov ItemSection, 0C0H
Xor Eax, Eax
Mov Eax, 1
Jmp CalculateItemIDEnd
Cits130:
Mov ItemSection, 0D0H
Xor Eax, Eax
Mov Eax, 1
Jmp CalculateItemIDEnd
Cits140:
Mov ItemSection, 0E0H
Xor Eax, Eax
Mov Eax, 1
Jmp CalculateItemIDEnd
Cits150:
Mov ItemSection, 0F0H
Xor Eax, Eax
Mov Eax, 1
CalculateItemIDEnd:
Pop Edi
Pop Esi
Pop Ebx
Mov Esp, Ebp
Pop Ebp
Ret
CalculateItemID EndP
Well this fuction is a reeplase of the current call:
Code:
00434AB8 E8 67F6FCFF CALL GameServ.00404124
Most knowed has the item byte converter, wich is used alot of times for take the itembyte, but i will set a example:
Code:
C2 00 0E 31 00 01 00 [06] 00 28 00 24 30 00 //1.02 ->Halberd
C2 00 0C 31 00 01 00 [66] 00 FF 00 00 //1.0h ->Halberd
well you can check there the difference between 1.02 and 1.0h, what change is the itemID wich is under [] and 2 new bits, one when its holded the section wich belongs to that item, and the last byte wich is for new items.
what this fuction make is convert the 1.0h value wich on example is 66 and return on ECX regist 06 (value used for 1.02), on EAX will be returned if the instruction was sucefull completed with the value 1 (1 = correct, 0 = wrong). The fuction present also a empty space wich is defined on -data and .const
section wich is for hold the itemID and the itemSection, so you can easy later can use that empty space for you new packets. (GS to client)
the source has been compiled on a DLL, and its tested also works fully, this is only a little help to coders than want to mod the item protocol for any new client and hope you guys can make it fast :juggle:.
Wish best luck to my brothers of real coding, FeN$x.
Ciao
Last edited: