Function at 0x402030
Capabilities:
Get file size

Disassembly:
sub esp, 0x114
mov eax, dword [0x41f050]
xor eax, esp
mov dword [esp + 0x110], eax
push ebx
mov ebx, dword [esp + 0x11c]
push ebp
push esi
push edi
push 0
lea eax, [ebx + 0x10]
push 0x4201b0
push eax
mov dword [esp + 0x20], ebx
lea esi, [ebx + 0xf0]
call fcn.00401710
add esp, 0xc
test byte [0x41e3d0], 1
mov ecx, eax
mov dword [esp + 0x18], ecx
je 0x402080
mov eax, dword [ecx]
mov dword [ebx + 0x14], eax
xor ebp, ebp
mov dword [esp + 0x10], ebp
jmp 0x402094
mov ecx, dword [esp + 0x18]
cmp byte [ebp + 0x41e0dc], 0
je 0x4020b3
mov dl, byte [ebp + 0x41e0d8]
mov byte [esi], dl
mov al, byte [ebp + 0x41e0dc]
add esi, 1
mov byte [esi], al
add esi, 1
mov eax, dword [ebp + 0x41e0d8]
add eax, 0xffffffff
cmp eax, 0xfe
ja case.0x4020ce.1
movzx edx, byte [eax + 0x402380]
jmp dword [edx*4 + 0x40234c]
mov al, byte [esp + 0x12c]
mov byte [esi], al
jmp case.0x4020ce.1
test byte [0x41e3d0], 8
je case.0x4020ce.1
mov ecx, dword [ecx]
mov dword [esi], ecx
jmp case.0x4020ce.1
mov edx, dword [0x4201b0]
mov dword [esi], edx
jmp case.0x4020ce.1
mov eax, dword [0x4201b8]
mov dword [esi], eax
jmp case.0x4020ce.1
mov ecx, dword [0x4201b4]
mov dword [esi], ecx
jmp case.0x4020ce.1
mov eax, dword [0x42033c]
mov edx, eax
shl edx, 4
sub edx, eax
add edx, edx
add edx, edx
push edx
call sub.WSOCK32.dll_htonl
mov dword [esi], eax
jmp case.0x4020ce.1
mov eax, dword [0x42033c]
cdq
sub eax, edx
sar eax, 1
mov ecx, eax
shl ecx, 4
sub ecx, eax
add ecx, ecx
add ecx, ecx
push ecx
call sub.WSOCK32.dll_htonl
mov dword [esi], eax
jmp case.0x4020ce.1
push 0
push 0x80
push 3
push 0
push 1
push closesocket
push 0x4201bc
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
je case.0x4020ce.1
mov byte [esi], 0xd
add esi, 1
push 0
mov byte [esi], 2
push edi
add esi, 1
call dword [sym.imp.KERNEL32.dll_GetFileSize]
shr eax, 9
add eax, 1
push eax
call sub.WSOCK32.dll_htons
mov word [esi], ax
push edi
add esi, 2
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp case.0x4020ce.1
cmp byte [0x4202bc], 0
je case.0x4020ce.1
mov byte [esi], 0xf
push 0x4202bc
add esi, 1
call dword [sym.imp.KERNEL32.dll_lstrlenA]
movzx edx, al
push edx
mov byte [esi], al
lea eax, [esi + 1]
push 0x4202bc
push eax
call fcn.0040ce20
movzx ecx, byte [esi]
add esp, 0xc
lea esi, [esi + ecx + 1]
jmp case.0x4020ce.1
xor ebx, ebx
lea esp, [esp]
cmp dword [ebx + 0x420340], 0
lea edi, [ebx + 0x420344]
je 0x4022ec
mov dl, byte [edi - 4]
lea eax, [esp + 0x1c]
push eax
push str.0x_X
mov byte [esi], dl
push edi
add esi, 1
call fcn.0040d27e
add esp, 0xc
test eax, eax
jle 0x402241
mov byte [esi], 4
mov ecx, dword [esp + 0x1c]
mov dword [esi + 1], ecx
jmp 0x4022e5
push str._IP_
push edi
call fcn.0040d190
mov ebp, eax
add esp, 8
test ebp, ebp
je 0x4022c7
push 0x100
lea edx, [esp + 0x24]
push 0
push edx
call fcn.0040c6c0
mov eax, ebp
sub eax, ebx
add esp, 0xc
sub eax, 0x420344
add eax, 1
push eax
push edi
lea ecx, [esp + 0x28]
push ecx
call dword [sym.imp.KERNEL32.dll_lstrcpynA]
mov eax, dword [esp + 0x14]
mov edx, dword [eax + 0x10]
add eax, 0x10
push edx
call sub.WSOCK32.dll_inet_ntoa
mov edi, dword [sym.imp.KERNEL32.dll_lstrcatA]
push eax
lea eax, [esp + 0x24]
push eax
call edi
add ebp, 4
push ebp
lea ecx, [esp + 0x24]
push ecx
call edi
lea edx, [esp + 0x20]
push edx
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov byte [esi], al
movzx eax, al
push eax
lea ecx, [esp + 0x24]
push ecx
lea edx, [esi + 1]
push edx
jmp 0x4022d9
push edi
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov byte [esi], al
movzx eax, al
push eax
push edi
lea ecx, [esi + 1]
push ecx
call fcn.0040ce20
mov ebp, dword [esp + 0x1c]
add esp, 0xc
movzx edx, byte [esi]
lea esi, [esi + edx + 1]
add ebx, 0x84
cmp ebx, 0x528
jb 0x402200
mov ebx, dword [esp + 0x14]
jmp case.0x4020ce.1
mov byte [esi], 0xff
add esi, 1
mov byte [esi], 0
add esi, 1
mov byte [esi], 0
add esi, 1
movsx eax, byte [ebp + 0x41e0dc]
add ebp, 5
add esi, eax
cmp ebp, 0x46
mov dword [esp + 0x10], ebp
jb 0x402090
mov ecx, dword [esp + 0x120]
pop edi
mov eax, esi
pop esi
sub eax, ebx
pop ebp
pop ebx
xor ecx, esp
call fcn.0040c6a6
add esp, 0x114
ret