Function at 0x4057c0
Capabilities:
Get file size
Read file on windows

Disassembly:
sub esp, 0x120
push ebx
push ebp
push esi
push edi
call fcn.00405640
lea eax, [esp + 0x2c]
push 0x104
xor ebp, ebp
push eax
push ebp
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea edi, [esp + 0x2c]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
add ecx, 0xfffffffe
mov al, 0x5c
cmp byte [esp + ecx + 0x2c], al
je 0x405807
cmp ecx, ebp
jl 0x405807
mov dl, byte [esp + ecx + 0x2b]
dec ecx
cmp dl, al
jne 0x4057fa
cmp ecx, 0xffffffff
je 0x405811
mov byte [esp + ecx + 0x2d], 0
mov edi, str.UPnp.dat
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x2c]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
push ebp
mov esi, edi
mov ebx, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
push 0x80
mov ecx, ebx
push 3
push ebp
and ecx, 3
push ebp
lea eax, [esp + 0x40]
push closesocket
rep movsb byte es:[edi], byte [esi]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ebx, eax
cmp ebx, 0xffffffff
mov dword [esp + 0x28], ebx
je 0x405ac4
push ebp
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
test eax, eax
je 0x405abd
lea ecx, [esp + 0x1c]
push ebp
push ecx
lea edx, [esp + 0x20]
push 4
push edx
push ebx
mov dword [esp + 0x30], ebp
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [esp + 0x18]
mov dword [esp + 0x14], ebp
cmp eax, ebp
jle 0x405abd
push 0x22
call sub.MFC42.DLL_operatornew
mov edx, eax
mov ecx, 8
xor eax, eax
mov edi, edx
rep stosd dword es:[edi], eax
add esp, 4
mov dword [esp + 0x24], edx
stosw word es:[edi], ax
lea eax, [esp + 0x1c]
push 0
push eax
push 0x22
push edx
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov edx, dword [0x7365d4]
mov esi, edx
test esi, esi
mov dword [esp + 0x20], esi
jl 0x405aa8
cmp esi, edx
jl 0x405a97
lea ebp, [esi + 1]
test ebp, ebp
jl 0x405a97
jne 0x405927
mov eax, dword [0x7365d0]
test eax, eax
je 0x40590e
push 0x8000
push 0
push eax
call dword [sym.imp.KERNEL32.dll_VirtualFree]
xor ebx, ebx
xor eax, eax
mov dword [0x7365d0], ebx
mov dword [0x7365d8], eax
mov dword [0x7365d4], eax
jmp 0x405a9d
mov ebx, dword [0x7365d0]
test ebx, ebx
jne 0x405988
cmp ebp, 0x3fffffff
ja 0x405a9d
lea edi, [ebp*4]
push 4
push 0x1000
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov ebx, eax
test ebx, ebx
mov dword [0x7365d0], ebx
je 0x405a9d
mov ecx, edi
xor eax, eax
mov edx, ecx
mov edi, ebx
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
rep stosb byte es:[edi], al
mov dword [0x7365d8], ebp
mov dword [0x7365d4], ebp
jmp 0x405a97
mov ecx, dword [0x7365d8]
cmp ebp, ecx
jg 0x4059c1
cmp ebp, edx
jle 0x4059b6
mov ecx, ebp
lea edi, [ebx + edx*4]
sub ecx, edx
xor eax, eax
shl ecx, 2
mov edx, ecx
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
rep stosb byte es:[edi], al
mov ebx, dword [0x7365d0]
mov dword [0x7365d4], ebp
jmp 0x405a9d
mov eax, dword [0x7365dc]
test eax, eax
jne 0x4059f2
mov eax, edx
cdq
and edx, 7
add eax, edx
sar eax, 3
cmp eax, 4
jl 0x4059ed
cmp eax, 0x400
jle 0x4059e8
mov eax, 0x400
jmp 0x4059f2
cmp eax, 4
jge 0x4059f2
mov eax, 4
add eax, ecx
cmp ebp, eax
jge 0x4059fe
mov dword [esp + 0x10], eax
jmp 0x405a04
mov dword [esp + 0x10], ebp
mov eax, ebp
cmp eax, ecx
jl 0x405a9d
cmp eax, 0x3fffffff
ja 0x405a9d
push 4
push 0x1000
shl eax, 2
push eax
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov ebx, eax
test ebx, ebx
je 0x405a97
mov ecx, dword [0x7365d4]
mov esi, dword [0x7365d0]
mov edi, ebx
rep movsd dword es:[edi], dword [esi]
mov edx, dword [0x7365d4]
cmp ebp, edx
jle 0x405a93
mov ecx, ebp
lea edi, [ebx + edx*4]
sub ecx, edx
xor eax, eax
shl ecx, 2
mov edx, ecx
push 0x8000
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
push 0
and ecx, 3
rep stosb byte es:[edi], al
mov eax, dword [0x7365d0]
push eax
call dword [sym.imp.KERNEL32.dll_VirtualFree]
mov ecx, dword [esp + 0x10]
mov esi, dword [esp + 0x20]
mov dword [0x7365d0], ebx
mov dword [0x7365d4], ebp
mov dword [0x7365d8], ecx
jmp 0x405a9d
mov esi, dword [esp + 0x20]
mov ebx, dword [0x7365d0]
mov edx, dword [esp + 0x24]
mov dword [ebx + esi*4], edx
mov ebx, dword [esp + 0x28]
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x18]
inc eax
cmp eax, ecx
mov dword [esp + 0x14], eax
jl 0x4058a0
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x120
ret