Function at 0x4019c0
Capabilities:
Read file on windows

Disassembly:
lea ecx, [esp + 4]
and esp, 0xfffffff0
push dword [ecx - 4]
push ebp
mov ebp, esp
push edi
push esi
push ebx
push ecx
sub esp, 0x28
mov ebx, dword [ecx]
mov eax, dword [ebx]
test eax, eax
je 0x401c50
mov dword [esp + 8], 2
mov dword [esp + 4], 0
mov dword [esp], eax
call sub.msvcr100.dll_fseek
mov eax, dword [ebx]
mov dword [esp], eax
call sub.msvcr100.dll_ftell
mov edx, eax
mov esi, eax
mov eax, ebx
call fcn.004015b0
test eax, eax
js 0x401af0
mov eax, dword [ebx + 0x18]
mov edi, dword [sym.imp.WS2_32.dll_ntohl]
mov dword [ebx + 0x406c], 0
mov dword [esp], eax
call edi
sub esi, eax
mov eax, dword [ebx + 0x1c]
sub esp, 4
mov dword [ebx + 4], esi
mov dword [esp], eax
call edi
sub esp, 4
add eax, esi
mov dword [esp + 8], 0
mov dword [esp + 4], eax
mov eax, dword [ebx]
mov dword [esp], eax
call sub.msvcr100.dll_fseek
mov eax, dword [ebx + 0x20]
mov dword [esp], eax
call edi
sub esp, 4
mov dword [esp], eax
call sub.msvcr100.dll_malloc
test eax, eax
mov dword [ebx + 8], eax
je 0x401cb0
mov eax, dword [ebx + 0x20]
mov esi, dword [ebx]
mov dword [esp], eax
call edi
sub esp, 4
mov dword [esp + 0xc], esi
mov dword [esp + 8], 1
mov dword [esp + 4], eax
mov eax, dword [ebx + 8]
mov dword [esp], eax
call sub.msvcr100.dll_fread
test eax, eax
je 0x401c70
mov esi, dword [ebx + 8]
mov eax, dword [ebx + 0x20]
mov dword [esp], eax
call edi
add eax, esi
sub esp, 4
mov dword [ebx + 0xc], eax
mov eax, dword [ebx]
mov dword [esp], eax
call sub.msvcr100.dll_ferror
test eax, eax
mov esi, eax
jne 0x401c90
mov eax, dword [ebx]
test eax, eax
je 0x401ae1
mov dword [esp], eax
call sub.msvcr100.dll_fclose
mov dword [ebx], 0
lea esp, [ebp - 0x10]
mov eax, esi
pop ecx
pop ebx
pop esi
pop edi
pop ebp
lea esp, [ecx - 4]
ret
mov dword [esp + 8], 0
mov dword [esp + 4], 0
lea esi, [ebp - 0x1e]
mov eax, dword [ebx]
mov dword [ebp - 0x1c], 0
mov dword [esp], eax
call sub.msvcr100.dll_fseek
mov eax, dword [ebx]
mov dword [esp + 8], 2
mov dword [esp + 4], 1
mov dword [esp], esi
mov dword [esp + 0xc], eax
call sub.msvcr100.dll_fread
cmp byte [ebp - 0x1e], 0x4d
jne 0x401c3b
cmp byte [ebp - 0x1d], 0x5a
jne 0x401c3b
mov dword [esp + 8], 0
mov dword [esp + 4], 0x3c
lea edi, [ebp - 0x1c]
mov eax, dword [ebx]
mov dword [esp], eax
call sub.msvcr100.dll_fseek
mov eax, dword [ebx]
mov dword [esp + 8], 1
mov dword [esp + 4], 4
mov dword [esp], edi
mov dword [esp + 0xc], eax
call sub.msvcr100.dll_fread
mov eax, dword [ebp - 0x1c]
mov dword [esp + 8], 0
add eax, 0x18
mov dword [esp + 4], eax
mov eax, dword [ebx]
mov dword [esp], eax
call sub.msvcr100.dll_fseek
mov eax, dword [ebx]
mov dword [esp], esi
mov esi, 0xffffffff
mov dword [esp + 8], 1
mov dword [esp + 4], 2
mov dword [esp + 0xc], eax
call sub.msvcr100.dll_fread
cmp byte [ebp - 0x1e], 0xb
jne 0x401ae1
movzx eax, byte [ebp - 0x1d]
cmp al, 1
je 0x401ca6
cmp al, 2
jne 0x401c3b
mov eax, 0xa8
add eax, dword [ebp - 0x1c]
mov dword [esp + 8], 0
mov dword [esp + 4], eax
mov eax, dword [ebx]
mov dword [esp], eax
call sub.msvcr100.dll_fseek
mov eax, dword [ebx]
mov dword [esp + 8], 1
mov dword [esp + 4], 4
mov dword [esp], edi
mov dword [esp + 0xc], eax
call sub.msvcr100.dll_fread
mov esi, dword [ebp - 0x1c]
cmp esi, 0
je 0x401c3b
jle 0x401c3b
lea edi, [esi - 8]
mov edx, esi
mov eax, ebx
call fcn.004015b0
test eax, eax
jns 0x401a15
sub esi, 1
cmp esi, edi
jne 0x401c23
lea esp, [ebp - 0x10]
mov esi, 0xffffffff
mov eax, esi
pop ecx
pop ebx
pop esi
pop edi
pop ebp
lea esp, [ecx - 4]
ret
lea eax, [ebx + 0x68]
mov dword [esp + 4], 0x40d050
mov dword [esp], eax
call fcn.004031b0
test eax, eax
mov dword [ebx], eax
jne 0x4019e0
jmp 0x401c3b
mov dword [esp], str.Could_not_read_from_file.
mov esi, 0xffffffff
call fcn.00401ee0
jmp 0x401ae1
mov dword [esp], str.Error_on_file
mov esi, 0xffffffff
call fcn.00401ee0
jmp 0x401ae1
mov eax, 0x98
jmp 0x401bdf
mov dword [esp], str.Could_not_allocate_buffer_for_TOC.
mov esi, 0xffffffff
call fcn.00401ee0
jmp 0x401ae1