Luigi Auriemma

aluigi.org (ARCHIVE-ONLY FORUM!)
It is currently 19 Jul 2012 20:15

All times are UTC [ DST ]





Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Problem with ventrilo udp algo
PostPosted: 19 Apr 2008 01:08 

Joined: 19 Apr 2008 00:59
Posts: 42
First, love your research, helped me get over a part with the udp. (don't know much about sendto/recvfrom)

Well I noticed in

http://aluigi.altervista.org/papers/ventrcon.zip

in ventrilo3_handshake.c

You have...

Code:
    tmp[0] = key >> 24;
    tmp[1] = key >> 16;
    tmp[2] = key >> 8;
    tmp[3] = key;
    for(i = 16; i < len; i++) {
        data[i] += tmp[i & 3];
    }


Well when I was looking through it I saw...

Code:
00451AB0  /$  33C0               XOR EAX,EAX                                           ;  Encrypt sendto
00451AB2  |.  8A4424 04          MOV AL,BYTE PTR SS:[ESP+4]
00451AB6  |.  56                 PUSH ESI
00451AB7  |.  83E0 0F            AND EAX,0F
00451ABA  |.  0FAF4424 0C        IMUL EAX,DWORD PTR SS:[ESP+C]
00451ABF  |.  8BF0               MOV ESI,EAX
00451AC1  |.  B8 10000000        MOV EAX,10
00451AC6  |.  66:3941 0A         CMP WORD PTR DS:[ECX+A],AX
00451ACA  |.  76 27              JBE SHORT Ventrilo.00451AF3
00451ACC  |.  53                 PUSH EBX
00451ACD  |.  8D49 00            LEA ECX,DWORD PTR DS:[ECX]
00451AD0  |>  3D 00020000        /CMP EAX,200
00451AD5  |.  7D 1B              |JGE SHORT Ventrilo.00451AF2
00451AD7  |.  8A1C08             |MOV BL,BYTE PTR DS:[EAX+ECX]
00451ADA  |.  8BD6               |MOV EDX,ESI
00451ADC  |.  83E2 03            |AND EDX,3
00451ADF  |.  8A5414 0C          |MOV DL,BYTE PTR SS:[ESP+EDX+C]
00451AE3  |.  02DA               |ADD BL,DL
00451AE5  |.  881C08             |MOV BYTE PTR DS:[EAX+ECX],BL
00451AE8  |.  0FB751 0A          |MOVZX EDX,WORD PTR DS:[ECX+A]
00451AEC  |.  46                 |INC ESI
00451AED  |.  40                 |INC EAX
00451AEE  |.  3BC2               |CMP EAX,EDX
00451AF0  |.^ 7C DE              \JL SHORT Ventrilo.00451AD0
00451AF2  |>  5B                 POP EBX                                               ;  001850F0
00451AF3  |>  5E                 POP ESI                                               ;  001850F0
00451AF4  \.  C2 0800            RETN 8



Which if you look at the start. There is a small number passed which takes the first byte of tmp, ands with F and multiplies with the passed number and that is where tmp starts. Heres some code to understand what I am saying.

idx being the idx of the ventrilo3_auth (might be a bit different).
Code:
    tmp[0] = key >> 24;
    tmp[1] = key >> 16;
    tmp[2] = key >> 8;
    tmp[3] = key;
    idx = (tmp[0] & 0xF) * idx;
    for(i = 16; i < len; i++) {
        data[i] += tmp[(idx + i) & 3];
    }



Anyways... Don't think it makes a difference, just wanted to point it out.


Top
 Profile  
 
 
 Post subject:
PostPosted: 19 Apr 2008 09:50 

Joined: 13 Aug 2007 21:44
Posts: 4068
Location: http://aluigi.org
the operation you see at the beginning is a check on the length of the packet which must be a multiplier of 16, in my code I used a check on the total length of the packet which must be not minor than a certain size


Top
 Profile  
 
 Post subject:
PostPosted: 19 Apr 2008 14:47 

Joined: 19 Apr 2008 00:59
Posts: 42
aluigi wrote:
the operation you see at the beginning is a check on the length of the packet which must be a multiplier of 16, in my code I used a check on the total length of the packet which must be not minor than a certain size


Well if you read over it carefully. esi is not xored before the start. So esi stays what it is. (which edx is changed to esi to get the key position)

Also if you check out going packets of the ventrilo client you can also see that the key is shifted one of the packets because of this.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for: