Function at 0x40ceb0
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x58
push ebx
push esi
push edi
mov dword [0x41fef0], 0
push 0x204
call sub.CRTDLL.DLL_malloc
mov dword [ebp - 0x30], eax
push 0x204
call sub.CRTDLL.DLL_malloc
add esp, 8
mov dword [ebp - 0x34], eax
cmp dword [ebp - 0x30], 0
je 0x40ceea
or eax, eax
jne 0x40cf28
cmp dword [ebp - 0x30], 0
je 0x40cef9
push dword [ebp - 0x30]
call sub.CRTDLL.DLL_free
pop ecx
cmp dword [ebp - 0x34], 0
je 0x40cf08
push dword [ebp - 0x34]
call sub.CRTDLL.DLL_free
pop ecx
push 0x10
mov eax, dword [0x420318]
add eax, 0x10
push eax
push dword [0x4131e4]
push dword [ebp + 8]
call sub.USER32.DLL_MessageBoxA
xor eax, eax
jmp 0x40d37b
push 0x4216be
push dword [ebp + 0xc]
call sub.CRTDLL.DLL_fopen
add esp, 8
mov ebx, eax
or ebx, ebx
je 0x40d366
push 0x10017
call sub.CRTDLL.DLL_malloc
add esp, 4
mov edi, eax
or edi, edi
jne 0x40cf72
push dword [ebp - 0x30]
call sub.CRTDLL.DLL_free
add esp, 4
push dword [ebp - 0x34]
call sub.CRTDLL.DLL_free
add esp, 4
xor eax, eax
jmp 0x40d37b
push ebx
call sub.CRTDLL.DLL__fileno
push eax
call sub.CRTDLL.DLL__filelength
add esp, 8
mov esi, eax
cmp esi, 0x10015
jae 0x40cf90
mov dword [ebp - 0x54], esi
jmp 0x40cf97
mov dword [ebp - 0x54], 0x10015
push 0
mov eax, esi
sub eax, dword [ebp - 0x54]
push eax
push ebx
call sub.CRTDLL.DLL_fseek
add esp, 0xc
or eax, eax
je 0x40cfdb
push edi
call sub.CRTDLL.DLL_free
add esp, 4
push dword [ebp - 0x30]
call sub.CRTDLL.DLL_free
add esp, 4
push dword [ebp - 0x34]
call sub.CRTDLL.DLL_free
add esp, 4
push ebx
call sub.CRTDLL.DLL_fclose
add esp, 4
xor eax, eax
jmp 0x40d37b
push ebx
push 1
push dword [ebp - 0x54]
push edi
call sub.CRTDLL.DLL_fread
add esp, 0x10
or eax, eax
jne 0x40d01d
push edi
call sub.CRTDLL.DLL_free
add esp, 4
push dword [ebp - 0x30]
call sub.CRTDLL.DLL_free
add esp, 4
push dword [ebp - 0x34]
call sub.CRTDLL.DLL_free
add esp, 4
push ebx
call sub.CRTDLL.DLL_fclose
add esp, 4
xor eax, eax
jmp 0x40d37b
mov dword [ebp - 0x50], 0
mov esi, dword [ebp - 0x54]
sub esi, 4
jmp 0x40d055
cmp byte [edi + esi], 0x50
jne 0x40d04e
cmp byte [esi + edi + 1], 0x4b
jne 0x40d04e
cmp byte [esi + edi + 2], 5
jne 0x40d04e
cmp byte [esi + edi + 3], 6
jne 0x40d04e
lea eax, [esi + edi + 4]
mov dword [ebp - 0x50], eax
cmp dword [ebp - 0x50], 0
jne 0x40d059
dec esi
or esi, esi
jge 0x40d02c
cmp dword [ebp - 0x50], 0
jne 0x40d085
push edi
call sub.CRTDLL.DLL_free
push dword [ebp - 0x30]
call sub.CRTDLL.DLL_free
push ebx
call sub.CRTDLL.DLL_fclose
push dword [ebp - 0x34]
call sub.CRTDLL.DLL_free
add esp, 0x10
xor eax, eax
jmp 0x40d37b
push 0x12
push dword [ebp - 0x50]
lea eax, [ebp - 0x4c]
push eax
call sub.CRTDLL.DLL_memcpy
add esp, 0xc
mov ax, word [ebp - 0x4c]
cmp ax, word [ebp - 0x4a]
je 0x40d0cf
push edi
call sub.CRTDLL.DLL_free
add esp, 4
push dword [ebp - 0x30]
call sub.CRTDLL.DLL_free
add esp, 4
push ebx
call sub.CRTDLL.DLL_fclose
add esp, 4
push dword [ebp - 0x34]
call sub.CRTDLL.DLL_free
add esp, 4
xor eax, eax
jmp 0x40d37b
movzx eax, word [ebp - 0x3c]
or eax, eax
jle 0x40d11f
mov eax, dword [0x420318]
cmp byte [eax + 0x22c], 0
je 0x40d11f
push dword [ebp + 8]
call sub.USER32.DLL_GetParent
or eax, eax
je 0x40d0fe
push dword [ebp + 8]
call sub.USER32.DLL_GetParent
mov dword [ebp - 0x58], eax
jmp 0x40d104
mov edx, dword [ebp + 8]
mov dword [ebp - 0x58], edx
push 0x40
mov edx, dword [0x420318]
add edx, 0x10
push edx
mov edx, dword [ebp - 0x50]
add edx, 0x12
push edx
push dword [ebp - 0x58]
call sub.USER32.DLL_MessageBoxA
push 0
mov eax, dword [ebp + 0x18]
add eax, dword [ebp - 0x40]
push eax
push ebx
call sub.CRTDLL.DLL_fseek
add esp, 0xc
or eax, eax
je 0x40d164
push edi
call sub.CRTDLL.DLL_free
add esp, 4
push dword [ebp - 0x30]
call sub.CRTDLL.DLL_free
add esp, 4
push ebx
call sub.CRTDLL.DLL_fclose
add esp, 4
push dword [ebp - 0x34]
call sub.CRTDLL.DLL_free
add esp, 4
xor eax, eax
jmp 0x40d37b
push 0x2e
push edi
call sub.CRTDLL.DLL_realloc
add esp, 8
mov edi, eax
or edi, edi
jne 0x40d19b
push dword [ebp - 0x30]
call sub.CRTDLL.DLL_free
add esp, 4
push dword [ebp - 0x34]
call sub.CRTDLL.DLL_free
add esp, 4
push ebx
call sub.CRTDLL.DLL_fclose
add esp, 4
xor eax, eax
jmp 0x40d37b
xor esi, esi
jmp 0x40d336
push ebx
push 1
push 0x2e
push edi
call sub.CRTDLL.DLL_fread
add esp, 0x10
or eax, eax
jne 0x40d1e3
push edi
call sub.CRTDLL.DLL_free
add esp, 4
push dword [ebp - 0x30]
call sub.CRTDLL.DLL_free
add esp, 4
push dword [ebp - 0x34]
call sub.CRTDLL.DLL_free
add esp, 4
push ebx
call sub.CRTDLL.DLL_fclose
add esp, 4
xor eax, eax
jmp 0x40d37b
push 4
push 0x4216b9
push edi
call sub.CRTDLL.DLL_memcmp
add esp, 0xc
or eax, eax
je 0x40d226
push edi
call sub.CRTDLL.DLL_free
add esp, 4
push dword [ebp - 0x30]
call sub.CRTDLL.DLL_free
add esp, 4
push dword [ebp - 0x34]
call sub.CRTDLL.DLL_free
add esp, 4
push ebx
call sub.CRTDLL.DLL_fclose
add esp, 4
xor eax, eax
jmp 0x40d37b
push 0x2a
mov eax, edi
add eax, 4
push eax
lea eax, [ebp - 0x2c]
push eax
call sub.CRTDLL.DLL_memcpy
mov eax, dword [ebp - 0x18]
add dword [0x41fef0], eax
push ebx
push 1
movzx eax, word [ebp - 0x14]
push eax
push dword [ebp - 0x30]
call sub.CRTDLL.DLL_fread
add esp, 0x1c
or eax, eax
jne 0x40d286
push edi
call sub.CRTDLL.DLL_free
add esp, 4
push dword [ebp - 0x30]
call sub.CRTDLL.DLL_free
add esp, 4
push dword [ebp - 0x34]
call sub.CRTDLL.DLL_free
add esp, 4
push ebx
call sub.CRTDLL.DLL_fclose
add esp, 4
xor eax, eax
jmp 0x40d37b
movzx eax, word [ebp - 0x14]
mov edx, dword [ebp - 0x30]
mov byte [edx + eax], 0
cmp byte [ebp - 0x2b], 0xb
jne 0x40d2a6
cmp byte [ebp - 0x2c], 0x32
je 0x40d2a6
mov dword [ebp - 0x38], 0
jmp 0x40d2ad
mov dword [ebp - 0x38], 1
cmp dword [ebp - 0x38], 0
je 0x40d2c0
push dword [ebp - 0x34]
push dword [ebp - 0x30]
call sub.USER32.DLL_OemToCharA
jmp 0x40d2cb
push dword [ebp - 0x30]
push dword [ebp - 0x34]
call fcn.00411ab4
push dword [ebp - 0x34]
push 0
push 0x180
push dword [ebp + 0x10]
call sub.USER32.DLL_SendMessageA
push dword [ebp - 0x34]
push 0
push 0x180
push dword [ebp + 0x14]
call sub.USER32.DLL_SendMessageA
push 1
movzx eax, word [ebp - 0x12]
movzx edx, word [ebp - 0x10]
add eax, edx
push eax
push ebx
call sub.CRTDLL.DLL_fseek
add esp, 0xc
or eax, eax
je 0x40d335
push edi
call sub.CRTDLL.DLL_free
add esp, 4
push dword [ebp - 0x30]
call sub.CRTDLL.DLL_free
add esp, 4
push dword [ebp - 0x34]
call sub.CRTDLL.DLL_free
add esp, 4
push ebx
call sub.CRTDLL.DLL_fclose
add esp, 4
xor eax, eax
jmp 0x40d37b
inc esi
movzx eax, word [ebp - 0x46]
cmp esi, eax
jl 0x40d1a2
push dword [ebp - 0x30]
call sub.CRTDLL.DLL_free
push dword [ebp - 0x34]
call sub.CRTDLL.DLL_free
push edi
call sub.CRTDLL.DLL_free
push ebx
call sub.CRTDLL.DLL_fclose
add esp, 0x10
xor eax, eax
inc eax
jmp 0x40d37b
push dword [ebp - 0x30]
call sub.CRTDLL.DLL_free
push dword [ebp - 0x34]
call sub.CRTDLL.DLL_free
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret