Function at 0x413b10
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
mov eax, dword [0x5c8eb0]
xor eax, ebp
mov dword [ebp - 4], eax
push esi
mov esi, dword [ebp + 8]
mov edx, ecx
mov dword [ebp - 0x18], edx
cmp dword [esi + 0x818], 0
je 0x413d75
cmp dword [esi + 0x814], 0
je 0x413d75
mov ecx, dword [esi + 0x808]
test ecx, ecx
je 0x413d64
cmp dword [esi + 0x830], 0
je 0x413d64
movzx eax, word [esi + 0x81c]
dec eax
je 0x413b91
dec eax
je 0x413b73
dec eax
je 0x413ba7
mov ecx, dword [ebp - 0x1c]
jmp 0x413ba7
lea eax, [ebp - 0x10]
push eax
lea eax, [ebp - 0x1c]
push eax
push dword [esi + 0x82c]
call dword [sym.imp.KERNEL32.dll_ClearCommError]
mov ecx, 0x400
sub ecx, dword [ebp - 8]
jmp 0x413ba7
cmp dword [edx + 4], 0
je 0x413ba1
mov dword [esi + 0x808], 0
mov ecx, dword [esi + 0x808]
test ecx, ecx
jle 0x413d64
mov eax, dword [esi + 0x808]
cmp ecx, eax
push ebx
cmovg ecx, eax
xor ebx, ebx
push edi
mov edi, ecx
cmp dword [esi + 0x86c], ebx
je 0x413c4d
cmp word [esi + 0x81c], 2
jne 0x413c4d
movzx eax, word [esi + 0x860]
test ax, ax
je 0x413c3a
cmp word [esi + 0x84c], 1
lea edi, [ebx + 1]
movzx ebx, word [esi + 0x85e]
mov edx, 0xa
mov eax, 0xd
cmove edx, eax
test bx, bx
jne 0x413c20
cmp ecx, edi
jle 0x413c20
mov eax, dword [esi + 0x80c]
add eax, esi
cmp byte [eax + edi + 0x407], dl
je 0x413c20
inc edi
cmp edi, ecx
jl 0x413c12
mov eax, dword [esi + 0x80c]
add eax, esi
cmp byte [eax + edi + 0x407], dl
jne 0x413c4d
movzx ebx, word [esi + 0x860]
jmp 0x413c4d
movzx eax, word [esi + 0x85e]
test ax, ax
je 0x413c4d
mov edi, 1
mov ebx, eax
movzx eax, word [esi + 0x81c]
dec eax
je 0x413cee
dec eax
je 0x413c6c
dec eax
jne 0x413ce9
mov eax, edi
jmp 0x413d22
mov eax, dword [ebp - 0x18]
add eax, 0x10
push eax
lea eax, [ebp - 0x14]
push eax
mov eax, dword [esi + 0x80c]
add eax, 0x408
push edi
add eax, esi
push eax
push dword [esi + 0x82c]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x413cd5
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
jne 0x413cd2
mov eax, dword [ebp - 0x18]
push 0x3e8
push dword [eax + 0x20]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
jne 0x413cd2
push eax
lea eax, [ebp - 0x14]
push eax
mov eax, dword [ebp - 0x18]
add eax, 0x10
push eax
push dword [esi + 0x82c]
call dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
jmp 0x413cd5
mov dword [ebp - 0x14], edi
lea eax, [ebp - 0x10]
push eax
lea eax, [ebp - 0x1c]
push eax
push dword [esi + 0x82c]
call dword [sym.imp.KERNEL32.dll_ClearCommError]
mov eax, dword [ebp - 0x14]
jmp 0x413d25
mov eax, dword [esi + 0x80c]
push 0
add eax, 0x408
add eax, esi
push edi
push eax
mov eax, dword [ebp - 0x18]
push dword [esi + 0x824]
mov eax, dword [eax + 0x68]
call eax
mov dword [ebp - 0x14], eax
cmp eax, 0xffffffff
jne 0x413d25
mov eax, dword [ebp - 0x18]
mov eax, dword [eax + 0x80]
call eax
xor eax, eax
mov dword [ebp - 0x14], eax
sub dword [esi + 0x808], eax
jne 0x413d39
mov dword [esi + 0x80c], 0
jmp 0x413d3f
add dword [esi + 0x80c], eax
cmp edi, eax
jne 0x413d62
test ebx, ebx
jle 0x413d62
push 0
push ebx
push 2
push dword [esi + 0x810]
mov dword [esi + 0x830], 0
call dword [sym.imp.USER32.dll_SetTimer]
pop edi
pop ebx
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0054a5f8
mov esp, ebp
pop ebp
ret 4
mov ecx, dword [ebp - 4]
mov dword [esi + 0x808], 0
xor ecx, ebp
pop esi
call fcn.0054a5f8
mov esp, ebp
pop ebp
ret 4