Function at 0x4057d0
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push ebx
sub esp, 0x24
cmp dword [ebp + 8], 0
jne 0x4057e7
mov eax, 0
jmp 0x405a8c
call fcn.004056cc
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
jne 0x4057ff
mov eax, 0
jmp 0x405a8c
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 0x40584d
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 0x405a8c
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 0x405889
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 0x4058a9
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 0x4058c9
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 0x405915
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 0x405961
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 0x405a89
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 0x405a77
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 0x405997
mov eax, dword [ebp - 0x10]
add esp, 0x24
pop ebx
pop ebp
ret