Post Pacific

Post Pacific (https://postpacific.mmorpg-game.online/index.php)
-   Lineage 2 General (https://postpacific.mmorpg-game.online/forumdisplay.php?f=31)
-   -   [L2C]1st step on Authd (https://postpacific.mmorpg-game.online/showthread.php?t=4553)

torune 25.05.2006 03:56

[L2C]1st step on Authd
 
currently its a dummy login system which only gotta display login name and password you input
however the blowfish and iocp are completed.

*No RSA atm*

all blowfish functions are inline for speed optimization.

btw you also need to have sql server running

i didnt encrypt the exe file, so if you are worry about anything, just read the asm code.

/* update */
1.
1.1 implemented same encryption algorithm as l2pass
1.2 send back LoginOK packet
1.3 packet checksum implemented
bug: Game Guard Auth packet no working, no idea why.

torune 25.05.2006 04:04

small bug fixed

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

Lerxst 25.05.2006 04:04

l2C or l2C++?
So far great work, lol you work pretty effin fast O.o.

elcapo 25.05.2006 04:42

what about a "open source" project? it could be awsome! I wanna start again, on a L2C with torune as manager.

Thalone 25.05.2006 07:51

if its in c++ i can help you out maybe torune... im too used to oop to go back to C though, so hopefully cpp ^_^

torune 25.05.2006 09:11

prelude: same design mechanism as l2server (function pointer array)

/* update */
1.
1.1 implemented same encryption algorithm as l2pass (encryption function is inlined for optimization)
1.2 send back LoginOK packet
1.3 packet checksum implemented

bug: Game Guard Auth packet no working, no idea why.

FidoW 25.05.2006 10:42

wow, this is amazing, you go to code a full AuthD ? ... and what about a "open source" project like elcapo said ?... maybe a interesting way to start develepping a good authd... all together coding this... like L2J Proyect... i see a lot of changes recently like asm tutorial and this... maybe a new way to bring L2OFF to the top! :)

tpuNIsher 25.05.2006 12:55

This is OPEN source..
Read his post :p
it is not encrypted.

Sauron 25.05.2006 14:11

Quote:

Originally Posted by tpuNIsher
This is OPEN source..
Read his post :p
it is not encrypted.

do you know what a source is?

FidoW 25.05.2006 14:16

seems like he dont know...

Mirror 25.05.2006 14:23

unless he is 31337 and read .exe as if it were source :p j/k

edit :

@torune : how much difficulty adds inline assembly and how much performance ? is it worth it ? ( debugging it etc )

torune 25.05.2006 14:37

for time critical stuff, i like to save as much as i can
a single function call also takes couple cpu circle.

Code:

bool CIOCP::RequestAuthLogin(IOCP_IO_PTR lp_io, BYTE* pData)
{
        char* pname, *ppass;
        BYTE *pBuffer, *pBuffEx, *pPwd;
        int length;
        //printf("RequestAuthLogin\n");
        pBuffer = pData;
        pname = (char*)pBuffer;
        pBuffer += 14;
        ppass = (char*)pBuffer;

        pPwd = (BYTE*)GlobalAlloc(GMEM_ZEROINIT, 16);       
        getPwd(ppass, pPwd, lstrlenA(ppass));

.............

void __inline CIOCP::getPwd(char * pData, BYTE* pOut, int length)
{
        UINT key[16];
        UINT dst[16];
        int i = 0, nBytes = length + 1;
.......
}

and will it become opensource or not, I wont be able to answer it atm.

RipperX 25.05.2006 15:18

2Torune: Fucking awesome! Good Job! =)
I'm C Programmer, maybe we can do something together.

Thx!!

kgptzac 25.05.2006 15:37

:O we have a l2c section here :)

testdude 25.05.2006 15:48

no, we have an l2c#, c and c# are 2 completely different languages, c# is .net

torune 25.05.2006 17:36

i have to commite that c# is simply and easy to learn,
however when you are looking for performance and time critical related design, i will suggest we get back to c/c++.

testdude 25.05.2006 17:43

and .net smells

RipperX 25.05.2006 17:50

Quote:

and .net smells
smells = sucks ? true ?
sorry i'm spanish :P

[ontopic]
I'm trying to program CacheD =P (for querys, bla bla)
[/ontopic]

torune 25.05.2006 17:54

i never think too much about performance until the moment i met C++ template meta-programming.
my instructor demonstrated two piece of c++ codes which shocked the entire class.
a simple Factorial Function with timer, normally we would use recursion on this on and most of us think it's the fastest way to achieve it.
guess what, its not.
takes about couple minutes to do 40! (or seconds i cant remember)
the other one is Zero second.

ya i know, it got nothing to do with c++/c# comparison. [offtopic]

Mirror 25.05.2006 19:51

recursion fast ? recursion is easy to program and high level but sucks up alot of resources and produces alot of overhead

torune 25.05.2006 20:17

if you read carefully: fastest way to achieve it.

Mirror 26.05.2006 09:48

yes correct :) thus 'fastest way to achieve it' means 'fastest way to make the function' and equal to 'easy to program' which is right. but as you explained "it's not, it takes two minutes to do 40!" which translates it as "fastest" the way i perceived it ;)

btw gl with the project, i doubt my C knowledge can help you in this - if you are looking for more ppl - and also my asm knowledge is not bigger than printing stuff in screen with DOS interrupts and opening files.

p.s. i could participate in the script and geodata parsers ( GS ) if you're interested but after my uni exams

Digital 26.05.2006 10:01

hmm.. so... u guys intend to go ahead with l2c++?
if u guys are serious about it...
i could dedicate a full section for u guys to head the project...
i'm quite sure we'll catch up in no time ;)

Mirror 26.05.2006 10:19

@digital, personally i believe it's too late, chronicle5 coming out soon and will be the final one, since in half first of 2007 l3 will come out which doesn't give more than 1 max 1.5 year of life to l2. BUT if ppl are interested i'm in, the trip matters, not the end point

Digital 26.05.2006 10:44

right... c5's coming out soon.. but that's for l2 isnt it?
and for l3.. basically the things that had a major would be the client isnt it?
i dun expect ncsoft to recode EVERYTHING and probably reuse proven and tested code... and not to mention scripts and data
i dun believe they'll really spend time rewriting every single one of them

e.g l3 does have authd doesnt it? how abt server? npc? geodata? item?
they would probably exist and carry the same information...

i dun believe l2 elphy to be lv1 and in l3 elphy to be lv100, do we?
or for any weapon, item, etc

and yes, the trip matters, not the end point.
this trip will let u gain skills and knowledge nothing else could give...
less working for ncsoft ;)

do let me know if there's any one support or disapproving?

toolpunk 26.05.2006 10:47

nope, as far as i know l2 will go on after c5.
just a new storyline and all, but it will take some time till l3 comes out.
also notice that it will be using unreal engine 3 which is not even available yet.
well, maybe i'm totally wrong^^

Mirror 26.05.2006 10:51

yes they will keep most of the code same but my hunch is that packet format will be totally different but that is not a big prob i guess.

well as i said i'm in

RipperX 26.05.2006 14:51

I think that we could do a definitive source, then when a new cronichle is out only modify some things we have the new server =)

For L2C: I'm In!

torune 27.05.2006 19:55

http://www.torune.com/lineage2/AuthdC.rar
packet assembling function added (dummy copy from original with small modification)

the following code is from l2server.
Code:

int VAssemble(char* buf, int bufLen, const char* format, va_list ap)
{
        //guard(int VAssemble(char* buf, int bufLen, const char* format, va_list ap));

        const char* f = format;
        char* start = buf;
        char* end = buf + bufLen;
        int t;
        char* p;
        int len;
        int i;

        double d;

        while ((t = *format++))
        {
                switch (t)
                {
                case 's':
                        p = va_arg(ap, char*);
                        if (p)
                        {
                                len = strlen(p);
                                if (buf + len + 1 > end)
                                {
                                        goto overflow;
                                }
                                strcpy(buf, p);
                                buf += len + 1;
                        }
                        else
                        {
                                // p is null. Is it correct?
                                if (buf + 1 > end)
                                {
                                        goto overflow;
                                }
                                *buf++ = 0;
                        }
                        break;
                case 'S':
                        {
                                wchar_t* p = va_arg(ap, wchar_t*);
                                if (p)
                                {
                                        len = (wcslen(p) + 1)* sizeof(wchar_t);
                                        if (buf + len > end)
                                        {
                                                goto overflow;
                                        }
                                        memcpy(buf, p, len);
                                        buf += len;
                                }
                                else
                                {
                                        // p is null. Is it correct?
                                        if (buf + 2 > end)
                                        {
                                                goto overflow;
                                        }
                                        *buf++ = 0;
                                        *buf++ = 0;
                                }
                        }
                        break;
                case 'b':            // blind copy
                        len = va_arg(ap, int);
                        p = va_arg(ap, char*);
                        if (buf + len > end)
                        {
                                goto overflow;
                        }
                        memcpy(buf, p, len);
                        buf += len;
                        break;
                case 'c':
                        i = va_arg(ap, int);
                        if (buf + 1 > end)
                        {
                                goto overflow;
                        }
                        *buf++ = i;
                        break;
                case 'h':
                        i = va_arg(ap, int);
                        if (buf + 2 > end)
                        {
                                goto overflow;
                        }
#ifdef _WIN32
                        *((short *)buf) = i;
                        buf += 2;
#else
                        *buf++ = i;
                        *buf++ = i >> 8;
#endif
                        break;
                case 'd':
                        i = va_arg(ap, int);
                        if (buf + 4 > end)
                        {
                                goto overflow;
                        }
#ifdef _WIN32
                        *((int *)buf) = i;
                        buf += 4;
#else
                        *buf++ = i;
                        *buf++ = i >> 8;
                        *buf++ = i >> 16;
                        *buf++ = i >> 24;
#endif
                        break;

                case 'f':
                        d = va_arg(ap, double);
                        if (buf + 8 > end)
                        {
                                goto overflow;
                        }
#ifdef _WIN32
                        CopyMemory(buf, &d, 8);
                        /*
                        *(((int*)buf)+0) = *(((int*)&d)+0);
                        *(((int*)buf)+1) = *(((int*)&d)+1);
                        */
                        /*
                        *((double *)buf) = d;
                        */
                        buf += 8;
#else
                        *buf++ = d;
                        *buf++ = d >> 8;
                        *buf++ = d >> 16;
                        *buf++ = d >> 24;
                        *buf++ = d >> 32
                        *buf++ = d >> 40;
                        *buf++ = d >> 48;
                        *buf++ = d >> 56;
#endif
                        break;

                }
        }
        return (buf - start);
overflow:
        Log.Add(LOG_ERROR, L"Buffer overflow in Assemble");
        return 0;

        //unguard;
}


RipperX 27.05.2006 20:31

Quote:

Originally Posted by torune
http://www.torune.com/lineage2/AuthdC.rar
packet assembling function added (dummy copy from original with small modification)

the following code is from l2server.
....

Simple Amazing I want your brain and your messenger/icq/jabber/fucking contact
Do u want a cup of coffe ? =P

gLuck!

GMan 28.05.2006 05:44

quicq question, if you guys go ahead and build an auth and mabey more, are you planning on adding the petition system stuff back into them?


All times are GMT. The time now is 23:18.