Function at 0x405c20
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x14
push ebx
push esi
mov esi, ecx
push edi
mov ebx, dword [esi + 8]
mov byte [esi + 0x11c], 0
cmp ebx, 0xffffffff
je 0x405e6d
cmp byte [esi + 4], 0
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
jne 0x405e6d
mov edi, dword [esi + 0x2a0]
mov eax, 0x67b23a55
mov ecx, dword [esi + 0x2a4]
sub ecx, edi
mov dword [esp + 0x1c], edi
imul ecx
sar edx, 7
mov eax, edx
shr eax, 0x1f
add eax, edx
mov dword [esp + 0x10], eax
cmp dword [esi + 0x110], eax
je 0x405d72
cmp dword [esi + 0x10c], 0xa
jg 0x405cf2
mov ecx, dword [esp + 0x1c]
xor edi, edi
test eax, eax
jle 0x405cdf
xor ebx, ebx
nop dword [eax]
mov eax, dword [esi + 0x2a0]
add eax, ebx
mov dword [esp + 0x1c], eax
cmp dword [eax + 0x100], 0
je 0x405cc7
push edi
mov ecx, esi
call fcn.00405b50
mov ecx, dword [esp + 0x1c]
mov dword [ecx + 0x114], eax
inc edi
add ebx, 0x13c
cmp edi, dword [esp + 0x10]
jl 0x405ca0
mov ebx, dword [esi + 8]
mov edi, dword [esi + 0x2a0]
jmp 0x405ce1
mov edi, ecx
mov byte [esi + 0x118], 1
mov dword [esi + 0x10c], 0xb
mov ecx, dword [esi + 0x2a4]
mov eax, 0x67b23a55
sub ecx, edi
imul ecx
sar edx, 7
mov eax, edx
shr eax, 0x1f
add eax, edx
mov dword [esi + 0x110], eax
cmp ebx, 0xffffffff
je 0x405d43
push 0
lea eax, [esp + 0x18]
xorps xmm0, xmm0
push eax
mov eax, dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
push ebx
movlpd qword [esp + 0x20], xmm0
call eax
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x10], eax
cmp eax, 0xffffffff
jne 0x405d49
call edi
jmp 0x405d49
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [esi + 8]
cmp ecx, 0xffffffff
je 0x405d78
push 0
lea eax, [esp + 0x14]
mov dword [esp + 0x14], 0
push eax
push 0x110
lea eax, [esi + 0xc]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
jmp 0x405d78
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
cmp byte [esi + 4], 0
jne 0x405e6d
cmp byte [esi + 0x118], 0
je 0x405e6d
mov ecx, dword [esi + 8]
cmp ecx, 0xffffffff
je 0x405dc3
mov eax, dword [esi + 0x114]
lea edx, [esp + 0x14]
push 0
push edx
push eax
push ecx
mov dword [esp + 0x20], eax
mov dword [esp + 0x24], 0
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov dword [esp + 0x10], eax
cmp eax, 0xffffffff
jne 0x405dc3
call edi
mov ebx, dword [esi + 8]
cmp ebx, 0xffffffff
je 0x405e0c
mov edi, dword [esi + 0x2a0]
lea ecx, [esp + 0x10]
push 0
push ecx
mov ecx, dword [esi + 0x2a4]
mov eax, 0x67b23a55
sub ecx, edi
mov dword [esp + 0x18], 0
imul ecx
sar edx, 7
mov eax, edx
shr eax, 0x1f
add eax, edx
imul eax, eax, 0x13c
push eax
push edi
push ebx
mov ebx, dword [sym.imp.KERNEL32.dll_WriteFile]
call ebx
jmp 0x405e12
mov ebx, dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [esi + 8]
mov byte [esi + 0x118], 0
cmp eax, 0xffffffff
je 0x405e4a
push 0
lea ecx, [esp + 0x18]
xorps xmm0, xmm0
push ecx
push 0
push eax
mov eax, dword [sym.imp.KERNEL32.dll_SetFilePointer]
movlpd qword [esp + 0x20], xmm0
call eax
mov dword [esp + 0x10], eax
cmp eax, 0xffffffff
jne 0x405e4a
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [esi + 8]
cmp ecx, 0xffffffff
je 0x405e6d
push 0
lea eax, [esp + 0x14]
mov dword [esp + 0x14], 0
push eax
push 0x110
lea eax, [esi + 0xc]
push eax
push ecx
call ebx
mov eax, dword [esi + 0x2a0]
cmp eax, dword [esi + 0x2a4]
je 0x405e81
mov dword [esi + 0x2a4], eax
mov eax, dword [esi + 0x2ac]
lea ebx, [esi + 0x2ac]
mov dword [esp + 0x10], eax
mov edi, dword [eax + 4]
cmp byte [edi + 0xd], 0
jne 0x405ec4
nop word [eax + eax]
push dword [edi + 8]
mov ecx, ebx
push ebx
call fcn.00407930
mov eax, edi
mov edi, dword [edi]
push 0x20
push eax
call fcn.0040db60
add esp, 8
cmp byte [edi + 0xd], 0
je 0x405ea0
mov eax, dword [esp + 0x10]
mov dword [eax + 4], eax
mov dword [eax], eax
mov dword [eax + 8], eax
mov dword [ebx + 4], 0
mov eax, dword [esi + 8]
cmp eax, 0xffffffff
je 0x405ee9
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [esi + 8], 0xffffffff
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret