Function at 0x40d2d8
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x54
push ebx
push esi
push edi
mov dword [0x41fef0], 0
push 0x204
call sub.CRTDLL.DLL_malloc
mov esi, eax
push 0x204
call sub.CRTDLL.DLL_malloc
add esp, 8
mov dword [ebp - 0x34], eax
or esi, esi
je 0x40d30f
or eax, eax
jne 0x40d349
or esi, esi
je 0x40d31a
push esi
call sub.CRTDLL.DLL_free
pop ecx
cmp dword [ebp - 0x34], 0
je 0x40d329
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 0x40d796
push 0x42171e
push dword [ebp + 0xc]
call sub.CRTDLL.DLL_fopen
add esp, 8
mov dword [ebp - 0x30], eax
or eax, eax
je 0x40d783
push 0x10017
call sub.CRTDLL.DLL_malloc
add esp, 4
mov edi, eax
or edi, edi
jne 0x40d392
push esi
call sub.CRTDLL.DLL_free
add esp, 4
push dword [ebp - 0x34]
call sub.CRTDLL.DLL_free
add esp, 4
xor eax, eax
jmp 0x40d796
push dword [ebp - 0x30]
call sub.CRTDLL.DLL__fileno
push eax
call sub.CRTDLL.DLL__filelength
add esp, 8
mov ebx, eax
cmp ebx, 0x10015
jae 0x40d3b2
mov dword [ebp - 0x54], ebx
jmp 0x40d3b9
mov dword [ebp - 0x54], 0x10015
push 0
mov eax, ebx
sub eax, dword [ebp - 0x54]
push eax
push dword [ebp - 0x30]
call sub.CRTDLL.DLL_fseek
add esp, 0xc
or eax, eax
je 0x40d3ff
push edi
call sub.CRTDLL.DLL_free
add esp, 4
push esi
call sub.CRTDLL.DLL_free
add esp, 4
push dword [ebp - 0x34]
call sub.CRTDLL.DLL_free
add esp, 4
push dword [ebp - 0x30]
call sub.CRTDLL.DLL_fclose
add esp, 4
xor eax, eax
jmp 0x40d796
push dword [ebp - 0x30]
push 1
push dword [ebp - 0x54]
push edi
call sub.CRTDLL.DLL_fread
add esp, 0x10
or eax, eax
jne 0x40d443
push edi
call sub.CRTDLL.DLL_free
add esp, 4
push esi
call sub.CRTDLL.DLL_free
add esp, 4
push dword [ebp - 0x34]
call sub.CRTDLL.DLL_free
add esp, 4
push dword [ebp - 0x30]
call sub.CRTDLL.DLL_fclose
add esp, 4
xor eax, eax
jmp 0x40d796
mov dword [ebp - 0x50], 0
mov ebx, dword [ebp - 0x54]
sub ebx, 4
jmp 0x40d47b
cmp byte [edi + ebx], 0x50
jne 0x40d474
cmp byte [ebx + edi + 1], 0x4b
jne 0x40d474
cmp byte [ebx + edi + 2], 5
jne 0x40d474
cmp byte [ebx + edi + 3], 6
jne 0x40d474
lea eax, [ebx + edi + 4]
mov dword [ebp - 0x50], eax
cmp dword [ebp - 0x50], 0
jne 0x40d47f
dec ebx
or ebx, ebx
jge 0x40d452
cmp dword [ebp - 0x50], 0
jne 0x40d4ab
push edi
call sub.CRTDLL.DLL_free
push esi
call sub.CRTDLL.DLL_free
push dword [ebp - 0x30]
call sub.CRTDLL.DLL_fclose
push dword [ebp - 0x34]
call sub.CRTDLL.DLL_free
add esp, 0x10
xor eax, eax
jmp 0x40d796
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 0x40d4f5
push edi
call sub.CRTDLL.DLL_free
add esp, 4
push esi
call sub.CRTDLL.DLL_free
add esp, 4
push dword [ebp - 0x30]
call sub.CRTDLL.DLL_fclose
add esp, 4
push dword [ebp - 0x34]
call sub.CRTDLL.DLL_free
add esp, 4
xor eax, eax
jmp 0x40d796
movzx eax, word [ebp - 0x3c]
or eax, eax
jle 0x40d51f
mov eax, dword [0x420318]
cmp byte [eax + 0x22c], 0
je 0x40d51f
push 0x40
add eax, 0x10
push eax
mov eax, dword [ebp - 0x50]
add eax, 0x12
push eax
push 0
call sub.USER32.DLL_MessageBoxA
push 0
mov eax, dword [ebp + 0x14]
add eax, dword [ebp - 0x40]
push eax
push dword [ebp - 0x30]
call sub.CRTDLL.DLL_fseek
add esp, 0xc
or eax, eax
je 0x40d566
push edi
call sub.CRTDLL.DLL_free
add esp, 4
push esi
call sub.CRTDLL.DLL_free
add esp, 4
push dword [ebp - 0x30]
call sub.CRTDLL.DLL_fclose
add esp, 4
push dword [ebp - 0x34]
call sub.CRTDLL.DLL_free
add esp, 4
xor eax, eax
jmp 0x40d796
push 0x2e
push edi
call sub.CRTDLL.DLL_realloc
add esp, 8
mov edi, eax
or edi, edi
jne 0x40d59d
push esi
call sub.CRTDLL.DLL_free
add esp, 4
push dword [ebp - 0x34]
call sub.CRTDLL.DLL_free
add esp, 4
push dword [ebp - 0x30]
call sub.CRTDLL.DLL_fclose
add esp, 4
xor eax, eax
jmp 0x40d796
xor ebx, ebx
jmp 0x40d753
push dword [ebp - 0x30]
push 1
push 0x2e
push edi
call sub.CRTDLL.DLL_fread
add esp, 0x10
or eax, eax
jne 0x40d5e7
push edi
call sub.CRTDLL.DLL_free
add esp, 4
push esi
call sub.CRTDLL.DLL_free
add esp, 4
push dword [ebp - 0x34]
call sub.CRTDLL.DLL_free
add esp, 4
push dword [ebp - 0x30]
call sub.CRTDLL.DLL_fclose
add esp, 4
xor eax, eax
jmp 0x40d796
push 4
push 0x421719
push edi
call sub.CRTDLL.DLL_memcmp
add esp, 0xc
or eax, eax
je 0x40d62a
push edi
call sub.CRTDLL.DLL_free
add esp, 4
push esi
call sub.CRTDLL.DLL_free
add esp, 4
push dword [ebp - 0x34]
call sub.CRTDLL.DLL_free
add esp, 4
push dword [ebp - 0x30]
call sub.CRTDLL.DLL_fclose
add esp, 4
xor eax, eax
jmp 0x40d796
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 dword [ebp - 0x30]
push 1
movzx eax, word [ebp - 0x14]
push eax
push esi
call sub.CRTDLL.DLL_fread
add esp, 0x1c
or eax, eax
jne 0x40d68a
push edi
call sub.CRTDLL.DLL_free
add esp, 4
push esi
call sub.CRTDLL.DLL_free
add esp, 4
push dword [ebp - 0x34]
call sub.CRTDLL.DLL_free
add esp, 4
push dword [ebp - 0x30]
call sub.CRTDLL.DLL_fclose
add esp, 4
xor eax, eax
jmp 0x40d796
movzx eax, word [ebp - 0x14]
mov byte [esi + eax], 0
movzx eax, word [ebp - 0x14]
mov byte [esi + eax], 0
cmp byte [ebp - 0x2b], 0xb
jne 0x40d6af
cmp byte [ebp - 0x2c], 0x32
je 0x40d6af
mov dword [ebp - 0x38], 0
jmp 0x40d6b6
mov dword [ebp - 0x38], 1
cmp dword [ebp - 0x38], 0
je 0x40d6c7
push dword [ebp - 0x34]
push esi
call sub.USER32.DLL_OemToCharA
jmp 0x40d6d0
push esi
push dword [ebp - 0x34]
call fcn.00411b78
push 0x12d
push dword [ebp + 8]
call sub.USER32.DLL_GetDlgItem
push dword [ebp - 0x34]
push 0
push 0x180
push eax
call sub.USER32.DLL_SendMessageA
push 0x12e
push dword [ebp + 8]
call sub.USER32.DLL_GetDlgItem
push dword [ebp - 0x34]
push 0
push 0x180
push eax
call sub.USER32.DLL_SendMessageA
push 1
movzx eax, word [ebp - 0x12]
movzx edx, word [ebp - 0x10]
add eax, edx
push eax
push dword [ebp - 0x30]
call sub.CRTDLL.DLL_fseek
add esp, 0xc
or eax, eax
je 0x40d752
push edi
call sub.CRTDLL.DLL_free
add esp, 4
push esi
call sub.CRTDLL.DLL_free
add esp, 4
push dword [ebp - 0x34]
call sub.CRTDLL.DLL_free
add esp, 4
push dword [ebp - 0x30]
call sub.CRTDLL.DLL_fclose
add esp, 4
xor eax, eax
jmp 0x40d796
inc ebx
movzx eax, word [ebp - 0x46]
cmp ebx, eax
jl 0x40d5a4
push esi
call sub.CRTDLL.DLL_free
push dword [ebp - 0x34]
call sub.CRTDLL.DLL_free
push edi
call sub.CRTDLL.DLL_free
push dword [ebp - 0x30]
call sub.CRTDLL.DLL_fclose
add esp, 0x10
xor eax, eax
inc eax
jmp 0x40d796
push esi
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