Function at 0x401cd0
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x1c
push ebx
mov ebx, ecx
push esi
push edi
test ebx, ebx
jne 0x401cec
lea eax, [ecx - 0x2b]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [ebx + 8]
mov edi, eax
mov esi, dword [ebx + 0xc]
mov dword [esp + 0xc], eax
test eax, eax
jle 0x401eb9
cmp dword [esi], 0
jne 0x401d2b
mov edx, dword [esi + 0xc]
mov eax, dword [esi + 8]
cmp edx, eax
jbe 0x401d2b
push dword [esi + 4]
mov ecx, ebx
push eax
call fcn.00402100
add esp, 8
test eax, eax
jne 0x401f96
mov eax, dword [esi + 8]
mov dword [esi + 0xc], eax
dec edi
add esi, 0x14
test edi, edi
jg 0x401d00
mov edx, dword [esp + 0xc]
mov edi, edx
mov eax, dword [ebx + 0xc]
lea esi, [edx - 1]
lea esi, [esi + esi*4]
lea esi, [eax + esi*4]
cmp dword [esi], 0
jne 0x401d70
mov edx, dword [esi + 0xc]
mov eax, dword [esi + 8]
cmp edx, eax
jae 0x401d70
push dword [esi + 4]
mov ecx, ebx
push eax
call fcn.00402100
add esp, 8
test eax, eax
jne 0x401f96
mov eax, dword [esi + 8]
mov dword [esi + 0xc], eax
dec edi
sub esi, 0x14
test edi, edi
jg 0x401d45
mov eax, dword [ebx + 0xc]
mov ecx, dword [esp + 0xc]
mov dword [esp + 0x10], eax
mov dword [esp + 0x14], ecx
cmp dword [eax], 0
je 0x401ea3
mov ecx, dword [eax + 0x10]
add ecx, dword [eax + 0xc]
mov esi, dword [eax + 4]
mov edi, dword [eax + 8]
mov dword [esp + 0x1c], ecx
jne 0x401e37
test esi, esi
jne 0x401db1
xor eax, eax
jmp 0x401e93
mov eax, dword [ebx + 4]
test eax, eax
jne 0x401ddd
push 0x4000
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov dword [ebx + 4], eax
test eax, eax
jne 0x401ddd
mov eax, 0xffffff94
jmp 0x401e93
push 0x4000
push 0
push eax
call fcn.00404660
add esp, 0xc
cmp esi, 0x4000
jbe 0x401e25
push dword [ebx + 4]
mov edx, edi
mov ecx, ebx
push 0x4000
call fcn.004026e0
add esp, 8
test eax, eax
jne 0x401f96
sub esi, 0x4000
add edi, 0x4000
cmp esi, 0x4000
ja 0x401df5
push dword [ebx + 4]
mov edx, edi
mov ecx, ebx
push esi
call fcn.004026e0
add esp, 8
jmp 0x401e93
mov eax, dword [ebx]
lea ecx, [esp + 0x18]
push 0
push ecx
push edi
push eax
mov dword [esp + 0x30], eax
mov dword [esp + 0x28], 0
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x401e6a
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x401e6a
mov eax, 0xffffffd8
jmp 0x401e93
push 0
lea eax, [esp + 0x28]
push eax
push esi
push dword [esp + 0x28]
push dword [esp + 0x30]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x401e8e
cmp dword [esp + 0x24], esi
jne 0x401e8e
xor eax, eax
jmp 0x401e93
mov eax, 0xffffffdc
test eax, eax
jne 0x401f96
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x14]
dec ecx
add eax, 0x14
mov dword [esp + 0x10], eax
mov dword [esp + 0x14], ecx
test ecx, ecx
jg 0x401d87
jmp 0x401ebb
mov eax, esi
mov edi, dword [eax - 0x10]
add edi, dword [eax - 0xc]
lea eax, [esp + 0x24]
mov esi, dword [ebx]
push 0
push eax
push edi
push esi
mov dword [esp + 0x34], 0
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x401ee9
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x401ef0
push esi
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
cmp dword [esp + 0xc], 0
mov esi, dword [ebx + 0xc]
jle 0x401f59
mov eax, dword [esp + 0xc]
nop
cmp dword [esi], 0
je 0x401f4d
mov eax, dword [esi + 0x10]
test eax, eax
je 0x401f49
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov ecx, dword [ebx + 8]
mov edx, dword [esi + 0x10]
mov eax, dword [ebx + 0xc]
test ecx, ecx
jle 0x401f49
nop dword [eax]
cmp dword [eax], 0
je 0x401f41
cmp dword [eax + 0x10], edx
jne 0x401f41
mov dword [eax + 0x10], 0
dec ecx
add eax, 0x14
test ecx, ecx
jg 0x401f30
mov eax, dword [esp + 0xc]
dec eax
add esi, 0x14
mov dword [esp + 0xc], eax
test eax, eax
jg 0x401f00
mov eax, dword [ebx + 0xc]
xor edx, edx
mov dword [ebx + 8], 1
mov ecx, ebx
mov dword [eax], 0
mov eax, dword [ebx + 0xc]
mov dword [eax + 4], edi
mov eax, dword [ebx + 0xc]
mov dword [eax + 8], 0
mov eax, dword [ebx + 0xc]
mov dword [eax + 0xc], 0
mov eax, dword [ebx + 0xc]
mov dword [eax + 0x10], 0
call fcn.00402610
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret