Function at 0x405764
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push ebx
sub esp, 0x24
cmp dword [ebp + 8], 0
jne 0x40577b
mov eax, 0
jmp 0x405a20
call fcn.00405660
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
jne 0x405793
mov eax, 0
jmp 0x405a20
mov dword [esp], 0x5c
call sub.msvcrt.dll_malloc
mov edx, eax
mov eax, dword [ebp - 0x10]
mov dword [eax], edx
mov eax, dword [ebp - 0x10]
mov eax, dword [eax]
test eax, eax
jne 0x4057e1
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0x11
mov dword [esp + 4], 1
mov dword [esp], str.Allocation_Error_n
call sub.msvcrt.dll_fwrite
mov eax, 0
jmp 0x405a20
mov eax, dword [ebp - 0x10]
mov eax, dword [eax]
mov dword [esp + 8], 0x5c
mov edx, dword [ebp + 8]
mov dword [esp + 4], edx
mov dword [esp], eax
call sub.msvcrt.dll_memcpy
mov eax, dword [ebp + 8]
mov eax, dword [eax + 4]
test eax, eax
je 0x40581d
mov eax, dword [ebp - 0x10]
mov ebx, dword [eax]
mov eax, dword [ebp + 8]
mov eax, dword [eax + 4]
mov dword [esp], eax
call sub.msvcrt.dll__strdup
mov dword [ebx + 4], eax
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0xc]
test eax, eax
je 0x40583d
mov eax, dword [ebp - 0x10]
mov ebx, dword [eax]
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0xc]
mov dword [esp], eax
call sub.msvcrt.dll__strdup
mov dword [ebx + 0xc], eax
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x14]
test eax, eax
je 0x40585d
mov eax, dword [ebp - 0x10]
mov ebx, dword [eax]
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x14]
mov dword [esp], eax
call sub.msvcrt.dll__strdup
mov dword [ebx + 0x14], eax
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x1c]
test eax, eax
je 0x4058a9
mov eax, dword [ebp - 0x10]
mov ebx, dword [eax]
mov eax, dword [ebp + 8]
mov ax, word [eax + 0x18]
movzx eax, ax
mov dword [esp], eax
call sub.msvcrt.dll_malloc
mov dword [ebx + 0x1c], eax
mov eax, dword [ebp + 8]
mov ax, word [eax + 0x18]
movzx ecx, ax
mov eax, dword [ebp + 8]
mov edx, dword [eax + 0x1c]
mov eax, dword [ebp - 0x10]
mov eax, dword [eax]
mov eax, dword [eax + 0x1c]
mov dword [esp + 8], ecx
mov dword [esp + 4], edx
mov dword [esp], eax
call sub.msvcrt.dll_memcpy
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x24]
test eax, eax
je 0x4058f5
mov eax, dword [ebp - 0x10]
mov ebx, dword [eax]
mov eax, dword [ebp + 8]
mov ax, word [eax + 0x20]
movzx eax, ax
mov dword [esp], eax
call sub.msvcrt.dll_malloc
mov dword [ebx + 0x24], eax
mov eax, dword [ebp + 8]
mov ax, word [eax + 0x20]
movzx ecx, ax
mov eax, dword [ebp + 8]
mov edx, dword [eax + 0x24]
mov eax, dword [ebp - 0x10]
mov eax, dword [eax]
mov eax, dword [eax + 0x24]
mov dword [esp + 8], ecx
mov dword [esp + 4], edx
mov dword [esp], eax
call sub.msvcrt.dll_memcpy
mov eax, dword [ebp + 8]
mov al, byte [eax + 0x51]
test al, al
je 0x405a1d
mov eax, dword [ebp - 0x10]
mov ebx, dword [eax]
mov eax, dword [ebp + 8]
mov al, byte [eax + 0x51]
movzx eax, al
shl eax, 2
mov dword [esp], eax
call sub.msvcrt.dll_malloc
mov dword [ebx + 0x54], eax
mov dword [ebp - 0xc], 0
jmp 0x405a0b
mov dword [esp], 0x10
call sub.msvcrt.dll_malloc
mov dword [ebp - 0x14], eax
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x54]
mov edx, dword [ebp - 0xc]
shl edx, 2
add eax, edx
mov eax, dword [eax]
mov ax, word [eax]
mov edx, dword [ebp - 0x14]
mov word [edx], ax
mov eax, dword [ebp - 0x14]
mov ax, word [eax]
movzx eax, ax
inc eax
mov dword [esp], eax
call sub.msvcrt.dll_malloc
mov edx, eax
mov eax, dword [ebp - 0x14]
mov dword [eax + 4], edx
mov eax, dword [ebp - 0x14]
mov ax, word [eax]
movzx ecx, ax
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x54]
mov edx, dword [ebp - 0xc]
shl edx, 2
add eax, edx
mov eax, dword [eax]
mov edx, dword [eax + 4]
mov eax, dword [ebp - 0x14]
mov eax, dword [eax + 4]
mov dword [esp + 8], ecx
mov dword [esp + 4], edx
mov dword [esp], eax
call sub.msvcrt.dll_memcpy
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x54]
mov edx, dword [ebp - 0xc]
shl edx, 2
add eax, edx
mov eax, dword [eax]
mov ax, word [eax + 8]
mov edx, dword [ebp - 0x14]
mov word [edx + 8], ax
mov eax, dword [ebp - 0x14]
mov ax, word [eax + 8]
movzx eax, ax
inc eax
mov dword [esp], eax
call sub.msvcrt.dll_malloc
mov edx, eax
mov eax, dword [ebp - 0x14]
mov dword [eax + 0xc], edx
mov eax, dword [ebp - 0x14]
mov ax, word [eax + 8]
movzx ecx, ax
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x54]
mov edx, dword [ebp - 0xc]
shl edx, 2
add eax, edx
mov eax, dword [eax]
mov edx, dword [eax + 0xc]
mov eax, dword [ebp - 0x14]
mov eax, dword [eax + 0xc]
mov dword [esp + 8], ecx
mov dword [esp + 4], edx
mov dword [esp], eax
call sub.msvcrt.dll_memcpy
inc dword [ebp - 0xc]
mov eax, dword [ebp + 8]
mov al, byte [eax + 0x51]
movzx eax, al
cmp eax, dword [ebp - 0xc]
jg 0x40592b
mov eax, dword [ebp - 0x10]
add esp, 0x24
pop ebx
pop ebp
ret