Function at 0x406460
Capabilities:
Resolve function by parsing pe exports

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x6c
mov eax, dword [ebp + 8]
mov edx, dword [ebp + 8]
mov eax, dword [eax + 0x48]
mov dword [ebp - 0x60], eax
mov eax, dword [edx + 0x7c]
cmp eax, dword [edx + 0x4c]
je 0x406bfb
mov ecx, dword [ebp + 8]
movzx ebx, word [ecx + 0x18]
nop
lea esi, [esi]
mov edx, dword [ebp + 8]
mov ecx, dword [ebp + 8]
mov edx, dword [edx + 0x4c]
mov dword [ebp - 0x6c], edx
mov edi, dword [ecx + 0x50]
mov esi, edi
sub esi, edx
mov dword [ebp - 0x58], esi
mov edx, dword [ecx + 0x64]
mov eax, dword [ecx + 0x80]
cmp eax, edx
jbe 0x4064b5
mov eax, edx
mov ecx, dword [ebp + 8]
mov edx, eax
movsx eax, word [ecx + 8]
movzx eax, byte [eax + 0x40d18c]
mov dword [ebp - 0x54], eax
mov eax, edx
cmp byte [ecx + 0x1a], 0
je 0x406500
test edx, edx
jne 0x406a60
mov esi, dword [ebp - 0x60]
mov eax, dword [ebp - 0x58]
cmp eax, dword [esi + 0x50]
jae 0x4064e7
and dword [ebp - 0x54], 0xfffffffe
mov edx, 1
mov eax, 1
jmp 0x406500
mov ecx, dword [ebp - 0x60]
mov esi, dword [ecx + 0x50]
cmp eax, esi
jbe 0x40650c
mov eax, esi
sub eax, dword [ebp - 0x58]
mov dword [ebp - 0x5c], eax
js 0x406a90
cmp dword [ebp - 0x5c], ebx
mov dword [ebp - 0x48], 0
jle 0x40652e
mov dword [ebp - 0x5c], ebx
mov dword [ebp - 0x48], 1
mov ecx, dword [ebp - 0x5c]
mov eax, dword [ebp - 0x6c]
lea edx, [edi + ecx]
add eax, esi
cmp edx, eax
js 0x406ac2
mov eax, dword [ebp - 0x60]
mov edx, dword [ebp - 0x60]
mov eax, dword [eax + 0x40]
mov dword [ebp - 0x68], eax
mov ecx, dword [edx + 0x3c]
sub eax, ecx
mov ecx, dword [ebp - 0x5c]
mov dword [ebp - 0x40], eax
test ecx, ecx
je 0x4065a0
cmp dword [ebp - 0x5c], ebx
je 0x406600
mov eax, dword [ebp - 0x5c]
mov edx, dword [ebp - 0x58]
add eax, edx
cmp esi, eax
jbe 0x406600
mov ecx, dword [ebp + 8]
cmp byte [ecx + 0x1a], 0
jne 0x406600
mov edx, dword [ecx + 0x98]
mov eax, edx
shr eax, 1
cmp dword [ebp - 0x5c], eax
jae 0x406be2
mov eax, dword [ebp + 8]
cmp edi, dword [eax + 0x7c]
js 0x406600
lea esi, [esi]
mov eax, dword [ebp - 0x40]
test eax, eax
jle 0x4065db
mov edx, dword [ebp + 8]
mov eax, 0xffff
movzx ecx, byte [edx + 0xa1]
mov edx, dword [ebp - 0x40]
shl eax, cl
cmp edx, eax
jle 0x4065c1
mov edx, eax
mov ecx, dword [ebp + 8]
mov eax, dword [ecx + 0x78]
sub eax, dword [ecx + 0x6c]
sub edx, eax
lea eax, [ebx + ebx]
cmp edx, eax
jge 0x406600
lea eax, [edx + edx]
cmp eax, dword [ebp - 0x68]
jge 0x406600
mov eax, dword [ebp + 8]
movzx edx, word [eax + 0x1c]
test dl, 1
jne 0x406600
test byte [ebp - 0x54], 6
je 0x406b1c
jmp 0x406600
test byte [ebp - 0x54], 2
je 0x406619
mov esi, dword [ebp + 8]
mov eax, dword [esi + 0x60]
test byte [esi + 0x1c], 8
mov dword [esi + 0x50], eax
je 0x406ad0
mov dword [ebp - 0x4c], 0
mov dword [ebp - 0x44], 0x28
mov edx, dword [ebp - 0x4c]
mov eax, ebx
sub eax, edx
cmp dword [ebp - 0x5c], eax
jbe 0x40663d
mov dword [ebp - 0x5c], eax
mov dword [ebp - 0x48], 1
mov eax, dword [ebp - 0x5c]
test eax, eax
je 0x4069b0
mov eax, dword [ebp + 8]
cmp byte [eax + 0x1a], 0
je 0x40665b
cmp dword [ebp - 0x5c], 1
je 0x406bce
mov edx, dword [ebp + 8]
mov ecx, dword [edx + 0x7c]
cmp dword [edx + 0x50], ecx
js 0x406bba
mov esi, dword [ebp - 0x5c]
inc dword [0x4132f0]
add dword [0x4132f4], esi
call fcn.004093d0
test eax, eax
mov dword [ebp - 0x50], eax
je 0x406c2d
mov edx, dword [ebp - 0x50]
mov eax, dword [0x4134e0]
add dword [edx + 0x1c], eax
mov ecx, dword [ebp - 0x44]
mov edi, dword [edx + 0x1c]
mov eax, ecx
add eax, edi
mov dword [edx + 0x20], ecx
push eax
mov esi, dword [ebp - 0x5c]
push esi
mov ebx, dword [ebp - 0x58]
push ebx
mov eax, dword [ebp - 0x60]
add eax, 0x50
push eax
call fcn.004016b0
mov esi, dword [ebp - 0x50]
add esp, 0x10
mov ebx, dword [ebp - 0x5c]
add dword [esi + 0x20], ebx
mov eax, ebx
mov ecx, dword [ebp - 0x58]
mov edx, dword [ebp - 0x60]
add eax, ecx
cmp eax, dword [edx + 0x50]
je 0x406b13
mov edx, dword [ebp - 0x50]
mov ecx, 0xa
mov esi, dword [ebp + 8]
cld
mov ebx, dword [edx + 0x1c]
add esi, 0x20
mov edi, ebx
rep movsd dword es:[edi], dword [esi]
movzx ecx, byte [ebp - 0x54]
and cl, 1
mov byte [ebp - 0x61], cl
je 0x406710
mov esi, dword [ebp + 8]
test byte [esi + 0x1c], 0x10
je 0x406710
mov eax, dword [esi + 0x50]
cmp eax, dword [esi + 0x7c]
je 0x406bd9
lea esi, [esi]
mov eax, dword [ebp - 0x5c]
test eax, eax
jne 0x406730
test byte [ebp - 0x54], 3
jne 0x406730
mov eax, dword [ebp + 8]
cmp word [eax + 0xc], 0
je 0x406ba0
nop
lea esi, [esi]
mov edx, dword [ebp + 8]
sub esp, 0xc
mov eax, dword [edx + 0x50]
push eax
call sub.WS2_32.DLL_htonl
mov dword [ebx + 0x18], eax
add esp, 0xc
mov esi, dword [ebp + 8]
sub esp, 0xc
mov edi, dword [esi + 0x6c]
push edi
call sub.WS2_32.DLL_htonl
mov dword [ebx + 0x1c], eax
add esp, 0xc
mov esi, dword [ebp - 0x4c]
test esi, esi
jne 0x406a28
movzx eax, byte [ebp - 0x54]
mov byte [ebx + 0x21], al
mov edx, dword [ebp - 0x60]
mov eax, dword [edx + 0x40]
shr eax, 2
cmp dword [ebp - 0x40], eax
jge 0x40678f
mov ecx, dword [ebp + 8]
movzx eax, word [ecx + 0x18]
cmp dword [ebp - 0x40], eax
setge al
movzx eax, al
neg eax
and dword [ebp - 0x40], eax
mov esi, dword [ebp + 8]
mov edx, 0xffff
mov eax, dword [ebp - 0x40]
movzx ecx, byte [esi + 0xa1]
shl edx, cl
cmp eax, edx
jle 0x4067a9
mov eax, edx
mov esi, dword [ebp + 8]
mov edi, dword [esi + 0x6c]
mov edx, dword [esi + 0x78]
sub edx, edi
mov edi, eax
cmp eax, edx
jge 0x4067bc
mov edi, edx
mov eax, edi
sub esp, 0xc
sar eax, cl
movzx eax, ax
push eax
call sub.WS2_32.DLL_htons
mov word [ebx + 0x22], ax
add esp, 0xc
mov eax, dword [ebp + 8]
mov esi, dword [eax + 0x54]
mov edx, dword [eax + 0x4c]
mov eax, esi
sub eax, edx
test eax, eax
jle 0x4069f0
mov ecx, dword [ebx + 0x18]
sub esp, 0xc
push ecx
call sub.WS2_32.DLL_ntohl
sub esi, eax
movzx eax, si
push eax
call sub.WS2_32.DLL_htons
or byte [ebx + 0x21], 0x20
mov word [ebx + 0x26], ax
add esp, 0xc
mov eax, dword [ebp - 0x4c]
mov edx, dword [ebp - 0x5c]
add eax, edx
test eax, eax
jne 0x406a06
mov eax, dword [ebp - 0x5c]
sub esp, 8
mov esi, dword [ebp - 0x44]
add esi, eax
push esi
mov eax, dword [ebp - 0x50]
push eax
call fcn.00407150
add esp, 0x10
mov word [ebx + 0x24], ax
mov ecx, dword [ebp + 8]
cmp byte [ecx + 0x1a], 0
je 0x4068f5
cmp word [ecx + 0xc], 0
je 0x4068f5
mov ecx, dword [ebp + 8]
mov edx, dword [ebp - 0x5c]
mov eax, dword [ecx + 0x50]
add edx, eax
mov eax, edx
sub eax, dword [ecx + 0x7c]
test eax, eax
jle 0x406870
mov dword [ecx + 0x7c], edx
lea esi, [esi]
lea edi, [edi]
mov eax, dword [ebp - 0x50]
sub esp, 8
mov dword [eax + 0x20], esi
mov word [ebx + 2], si
mov eax, dword [0x413630]
mov byte [ebx + 8], al
mov edx, dword [ebp - 0x60]
movzx eax, byte [edx + 0x24]
mov byte [ebx + 1], al
mov eax, dword [ebp - 0x50]
push eax
push edx
call fcn.00408120
add esp, 0x10
test eax, eax
mov ecx, eax
jne 0x406b70
inc dword [0x4132ec]
test edi, edi
jle 0x4068c8
mov ebx, dword [ebp + 8]
mov edx, edi
mov edi, dword [ebx + 0x6c]
mov esi, dword [ebx + 0x78]
add edx, edi
mov eax, edx
sub eax, esi
test eax, eax
jle 0x4068c8
mov dword [ebx + 0x78], edx
mov esi, dword [ebp + 8]
mov eax, dword [esi + 0x6c]
mov dword [esi + 0xac], eax
mov eax, dword [esi + 0x1c]
and eax, 0xfffffffc
mov word [esi + 0x1c], ax
mov eax, dword [ebp - 0x48]
test eax, eax
je 0x406b70
mov eax, dword [ebp + 8]
movzx ebx, word [eax + 0x18]
jmp 0x406490
mov eax, dword [ebp + 8]
test byte [ebp - 0x54], 3
mov eax, dword [eax + 0x50]
mov dword [ebp - 0x70], eax
je 0x406930
test byte [ebp - 0x54], 2
je 0x406911
mov edx, dword [ebp + 8]
inc eax
mov dword [edx + 0x50], eax
cmp byte [ebp - 0x61], 0
je 0x406930
mov ecx, dword [ebp + 8]
mov eax, dword [ecx + 0x1c]
inc dword [ecx + 0x50]
or eax, 0x10
mov word [ecx + 0x1c], ax
mov esi, esi
lea edi, [edi]
mov eax, dword [ebp + 8]
mov edx, dword [ebp - 0x5c]
mov ecx, dword [eax + 0x50]
add edx, ecx
mov dword [eax + 0x50], edx
mov eax, edx
mov ecx, dword [ebp + 8]
sub eax, dword [ecx + 0x7c]
test eax, eax
jle 0x406972
cmp word [ecx + 0x8a], 0
mov dword [ecx + 0x7c], edx
jne 0x406972
mov edx, 1
mov word [ecx + 0x8a], dx
mov eax, dword [ebp - 0x70]
mov dword [ecx + 0x8c], eax
inc dword [0x4132c8]
mov edx, dword [ebp + 8]
cmp word [edx + 0xa], 0
jne 0x406870
mov eax, dword [edx + 0x50]
cmp eax, dword [edx + 0x4c]
je 0x406870
mov eax, dword [edx + 0x14]
cmp word [edx + 0xc], 0
mov word [edx + 0xa], ax
je 0x406870
mov word [edx + 0xc], 0
mov word [edx + 0x12], 0
jmp 0x406870
mov ecx, dword [ebp + 8]
test byte [ecx + 0x1c], 1
je 0x406a76
inc dword [0x413300]
call fcn.004093d0
test eax, eax
mov dword [ebp - 0x50], eax
je 0x406c2d
mov esi, dword [ebp - 0x50]
mov eax, dword [0x4134e0]
add dword [esi + 0x1c], eax
mov eax, dword [ebp - 0x44]
mov dword [esi + 0x20], eax
jmp 0x4066d5
mov ecx, dword [ebp + 8]
mov dword [ecx + 0x54], edx
mov eax, dword [ebp - 0x4c]
mov edx, dword [ebp - 0x5c]
add eax, edx
test eax, eax
je 0x40681a
mov esi, dword [ebp - 0x5c]
sub esp, 0xc
mov edx, dword [ebp - 0x4c]
lea eax, [esi + edx + 0x14]
movzx eax, ax
push eax
call sub.WS2_32.DLL_htons
add esp, 0xc
mov word [ebx + 0xa], ax
jmp 0x40681a
mov ecx, dword [ebp - 0x4c]
sub esp, 4
lea eax, [ebp - 0x2e]
lea edx, [ebx + 0x28]
push ecx
push eax
push edx
call sub.ntdll.dll_memcpy
mov eax, dword [ebp - 0x4c]
add esp, 0x10
add eax, 0x14
shr eax, 2
mov dl, al
movzx eax, byte [ebx + 0x20]
shl dl, 4
and al, 0xf
or al, dl
mov byte [ebx + 0x20], al
jmp 0x406765
mov ecx, dword [ebp + 8]
mov eax, edx
mov word [ecx + 0xc], 0
mov word [ecx + 0x12], 0
jmp 0x406500
test byte [ebp - 0x54], 7
je 0x406b80
inc dword [0x413310]
jmp 0x4069c3
test edx, edx
mov dword [ebp - 0x5c], 0
jne 0x406518
mov esi, dword [ebp + 8]
mov word [esi + 0xa], 0
mov eax, dword [ebp - 0x6c]
mov dword [esi + 0x50], eax
mov edi, eax
mov edx, dword [ebp - 0x60]
mov dword [ebp - 0x5c], 0
mov esi, dword [edx + 0x50]
jmp 0x406518
and dword [ebp - 0x54], 0xfffffffe
jmp 0x406541
sub esp, 8
mov byte [ebp - 0x2e], 2
mov byte [ebp - 0x2d], 4
push 0
push esi
call fcn.00402220
movzx eax, ax
mov dword [esp], eax
call sub.WS2_32.DLL_htons
mov dword [ebp - 0x4c], 4
mov dword [ebp - 0x44], 0x2c
movzx eax, ax
add esp, 0xc
mov word [ebp - 0xe], ax
mov word [ebp - 0x2c], ax
movzx ebx, word [esi + 0x18]
jmp 0x406627
or dword [ebp - 0x54], 8
jmp 0x4066d5
mov eax, dword [eax + 0x54]
mov ecx, dword [ebp - 0x6c]
sub eax, ecx
test eax, eax
jg 0x406600
test byte [ebp - 0x54], 1
je 0x406b46
test dl, 0x10
je 0x406600
cmp edi, dword [ebp - 0x6c]
nop
je 0x406600
test esi, esi
je 0x406b5f
mov ebx, dword [ebp + 8]
cmp word [ebx + 0xa], 0
jne 0x406b5f
cmp word [ebx + 0xc], 0
je 0x406c3c
inc dword [0x413370]
xor ecx, ecx
mov esi, esi
lea edi, [edi]
lea esp, [ebp - 0xc]
mov eax, ecx
pop ebx
pop esi
pop edi
pop ebp
ret
mov ebx, dword [ebp + 8]
mov eax, dword [ebx + 0x54]
mov edx, dword [ebx + 0x4c]
sub eax, edx
test eax, eax
jle 0x406c22
inc dword [0x413308]
jmp 0x4069c3
mov ecx, dword [ebp + 8]
sub esp, 0xc
mov eax, dword [ecx + 0x7c]
push eax
call sub.WS2_32.DLL_htonl
add esp, 0xc
mov dword [ebx + 0x18], eax
jmp 0x406745
mov ebx, dword [ebp - 0x5c]
inc dword [0x4132f8]
add dword [0x4132fc], ebx
jmp 0x406679
inc dword [0x413304]
jmp 0x406679
dec eax
mov dword [esi + 0x50], eax
jmp 0x406710
test edx, edx
jne 0x406600
mov eax, dword [ebp + 8]
cmp edi, dword [eax + 0x7c]
jns 0x4065a0
jmp 0x406600
mov eax, dword [edx + 0x88]
cmp ax, word [edx + 0x14]
jge 0x406c13
mov esi, dword [ebp + 8]
movzx ebx, word [esi + 0x18]
jmp 0x406490
movzx ebx, word [edx + 0x18]
mov dword [edx + 0x80], ebx
jmp 0x406490
inc dword [0x41330c]
jmp 0x4069c3
lea esp, [ebp - 0xc]
mov ecx, 1
pop ebx
mov eax, ecx
pop esi
pop edi
pop ebp
ret
mov word [ebx + 0x12], 0
push ebx
call fcn.00406400
pop ecx
jmp 0x406b5f