Function at 0x416130
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ecx, 0x4afd25
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x5c
mov ebx, dword [ebp + 8]
mov dword [esp + 4], ecx
mov eax, dword [ebp + 0xc]
mov dword [esp], eax
call fcn.0044ebb0
mov dword [ebp - 0x48], eax
test eax, eax
je 0x4a3ca7
mov dword [esp], 0xc
call fcn.00450d80
mov edi, dword [ebp - 0x48]
mov dword [eax], 0x4cdd88
mov esi, eax
lea eax, [ebp - 0x48]
mov dword [esi + 4], eax
mov eax, 6
mov dword [esp + 8], eax
mov eax, 1
mov dword [esp + 4], eax
lea eax, [ebp - 0x3e]
mov dword [esp + 0xc], edi
mov dword [esp], eax
call sub.msvcrt.dll_fread
cmp eax, 6
je 0x4161d0
mov dword [esp], edi
call sub.msvcrt.dll_fclose
mov dword [esp], 8
call fcn.004a2290
mov dword [esp], str.unable_to_read_header_from_file
mov ecx, eax
mov ebx, eax
call fcn.00495130
jmp 0x4a3cdc
movzx eax, word [ebp - 0x3e]
mov dword [ebp - 0x4c], eax
test eax, eax
jne 0x416280
movzx eax, word [ebp - 0x3c]
dec eax
cmp ax, 1
ja 0x416280
cmp word [ebp - 0x3a], 0
je 0x416280
mov dword [ebx], 0
mov dword [ebx + 4], 0
mov dword [ebx + 8], 0
mov dword [ebp - 0x1c], 0
mov eax, dword [ebp - 0x4c]
mov ecx, 0xc
mov dword [ebp - 0x2c], eax
mov eax, 1
mov dword [esp + 4], eax
lea eax, [ebp - 0x28]
mov dword [esp + 0xc], edi
mov dword [esp + 8], ecx
mov dword [esp], eax
call sub.msvcrt.dll_fread
cmp eax, 0xc
je 0x416298
mov edx, dword [ebx]
cmp edx, dword [ebx + 4]
je 0x4164c7
xor edi, edi
lea esi, [esi]
lea eax, [edi + edi*4]
mov eax, dword [edx + eax*4 + 0x10]
test eax, eax
je 0x416265
mov dword [esp], eax
call fcn.00450de0
mov edx, dword [ebx]
mov ecx, dword [ebx + 4]
inc edi
mov eax, ecx
sub eax, edx
sar eax, 2
imul eax, eax, 0xcccccccd
cmp edi, eax
jb 0x416250
jmp 0x4a3c4a
mov dword [ebp - 0x3c], 0
mov dword [esp], edi
call sub.msvcrt.dll_fclose
jmp 0x4a3c15
mov eax, dword [ebp - 0x20]
mov dword [ebp - 0x50], eax
cmp eax, 0x100000
ja 0x416479
mov dword [esp + 0xc], edi
mov eax, 4
mov dword [esp + 8], eax
mov eax, 1
mov dword [esp + 4], eax
lea eax, [ebp - 0x44]
mov dword [esp], eax
call sub.msvcrt.dll_fread
cmp eax, 4
je 0x416310
mov edx, dword [ebx]
cmp edx, dword [ebx + 4]
je 0x4a3cfc
xor edi, edi
lea esi, [esi]
lea eax, [edi + edi*4]
mov eax, dword [edx + eax*4 + 0x10]
test eax, eax
je 0x4162f5
mov dword [esp], eax
call fcn.00450de0
mov edx, dword [ebx]
mov ecx, dword [ebx + 4]
inc edi
mov eax, ecx
sub eax, edx
sar eax, 2
imul eax, eax, 0xcccccccd
cmp edi, eax
jb 0x4162e0
jmp 0x4a3cf5
mov dword [esp], edi
lea eax, [ebp - 0x38]
mov dword [esp + 4], eax
call sub.msvcrt.dll_fgetpos
xor eax, eax
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x44]
mov dword [esp], edi
mov dword [esp + 4], eax
call sub.msvcrt.dll_fseek
test eax, eax
jne 0x416439
mov eax, dword [ebp - 0x50]
mov dword [esp], eax
call fcn.00450da0
mov dword [ebp - 0x1c], eax
mov edx, 1
mov dword [esp + 0xc], edi
mov ecx, dword [ebp - 0x50]
mov dword [esp + 4], edx
mov dword [esp], eax
mov dword [esp + 8], ecx
call sub.msvcrt.dll_fread
mov ecx, dword [ebp - 0x50]
cmp ecx, eax
jne 0x4163db
test ecx, ecx
je 0x4163db
mov dword [esp], edi
lea eax, [ebp - 0x38]
mov dword [esp + 4], eax
call sub.msvcrt.dll_fsetpos
mov edx, eax
mov eax, dword [ebx + 4]
test edx, edx
jne 0x4163db
cmp dword [ebx + 8], eax
je 0x416420
mov edx, dword [ebp - 0x2c]
add eax, 0x14
mov dword [eax - 0x14], edx
mov edx, dword [ebp - 0x28]
mov dword [eax - 0x10], edx
mov edx, dword [ebp - 0x24]
mov dword [eax - 0xc], edx
mov edx, dword [ebp - 0x20]
mov dword [eax - 8], edx
mov edx, dword [ebp - 0x1c]
mov dword [eax - 4], edx
mov dword [ebx + 4], eax
mov eax, dword [ebp - 0x4c]
inc eax
cmp word [ebp - 0x3a], ax
movzx ecx, ax
mov dword [ebp - 0x4c], ecx
ja 0x41620d
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 4]
lea esp, [ebp - 0xc]
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret
mov edx, dword [ebx]
cmp edx, dword [ebx + 4]
je 0x4a3bb5
xor edi, edi
lea esi, [esi]
nop
lea eax, [edi + edi*4]
mov eax, dword [edx + eax*4 + 0x10]
test eax, eax
je 0x416405
mov dword [esp], eax
call fcn.00450de0
mov edx, dword [ebx]
mov ecx, dword [ebx + 4]
inc edi
mov eax, ecx
sub eax, edx
sar eax, 2
imul eax, eax, 0xcccccccd
cmp edi, eax
jb 0x4163f0
jmp 0x4a3ba7
mov dword [esp], eax
lea edx, [ebp - 0x2c]
mov ecx, ebx
mov dword [esp + 4], edx
call fcn.00496060
sub esp, 8
jmp 0x4163b6
mov dword [esp], ebx
call fcn.00415f10
mov dword [esp], 8
call fcn.004a2290
mov dword [ebp - 0x4c], eax
mov ecx, eax
mov edi, eax
mov dword [esp], str.corrupted_icon_file__too_small
call fcn.00495130
push ecx
mov dword [esp + 8], fcn.00495290
mov dword [esp + 4], 0x4cd1cc
mov dword [esp], edi
call fcn.004a2820
mov dword [esp], ebx
call fcn.00415f10
mov dword [esp], 8
call fcn.004a2290
mov dword [ebp - 0x4c], eax
mov ecx, eax
mov edi, eax
mov dword [esp], str.invalid_icon_file_size
call fcn.00495130
push eax
mov dword [esp + 8], fcn.00495290
mov dword [esp + 4], 0x4cd1cc
mov dword [esp], edi
call fcn.004a2820
mov edi, eax
jmp 0x4a3bf4
jmp 0x4a3c51
cmp edx, ecx
lea esi, [esi]
je 0x4a3bb5
mov dword [ebx + 4], edx
mov dword [esp], 8
call fcn.004a2290
mov dword [ebp - 0x4c], eax
mov ecx, eax
mov dword [esp], str.unable_to_read_icon_from_file
call fcn.00495130
push eax
mov dword [esp + 8], fcn.00495290
mov dword [esp + 4], 0x4cd1cc
mov eax, dword [ebp - 0x4c]
mov dword [esp], eax
call fcn.004a2820
mov edi, eax
jmp 0x4a3bff
mov eax, dword [ebp - 0x4c]
mov dword [esp], eax
call fcn.004a2510
mov ecx, ebx
call fcn.004942e0
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 4]
mov dword [esp], edi
call fcn.00471810
mov dword [esp], 8
call fcn.004a2290
mov dword [esp], str.invalid_icon_file
mov ecx, eax
mov ebx, eax
call fcn.00495130
push eax
mov dword [esp + 8], fcn.00495290
mov dword [esp + 4], 0x4cd1cc
mov dword [esp], ebx
call fcn.004a2820
cmp edx, ecx
je 0x4a3c51
mov dword [ebx + 4], edx
mov dword [esp], 8
call fcn.004a2290
mov dword [ebp - 0x4c], eax
mov ecx, eax
mov dword [esp], str.unable_to_read_entry_from_file
call fcn.00495130
push edx
mov dword [esp + 8], fcn.00495290
mov dword [esp + 4], 0x4cd1cc
mov eax, dword [ebp - 0x4c]
mov dword [esp], eax
call fcn.004a2820
mov edi, eax
jmp 0x4a3c06
mov dword [esp], 8
call fcn.004a2290
mov dword [esp], str.cant_open_file
mov ecx, eax
mov ebx, eax
call fcn.00495130
push edx
mov dword [esp + 8], fcn.00495290
mov dword [esp + 4], 0x4cd1cc
mov dword [esp], ebx
call fcn.004a2820
push eax
mov dword [esp + 8], fcn.00495290
mov dword [esp + 4], 0x4cd1cc
mov dword [esp], ebx
call fcn.004a2820
cmp edx, ecx
je 0x4a3cfc
mov dword [ebx + 4], edx
mov dword [esp], 8
call fcn.004a2290
mov dword [ebp - 0x4c], eax
mov ecx, eax
mov dword [esp], str.unable_to_read_offset_from_file
call fcn.00495130
push eax
mov dword [esp + 8], fcn.00495290
mov dword [esp + 4], 0x4cd1cc
mov eax, dword [ebp - 0x4c]
mov dword [esp], eax
call fcn.004a2820
mov edi, eax
jmp 0x4a3bf4