Function at 0x409440
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x489b10
mov eax, dword fs:[0]
push eax
mov eax, 0x8050
call fcn.00459cc0
mov eax, dword [0x4d9754]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x8054], ecx
mov eax, dword [ebp + 0xc]
or esi, 0xffffffff
mov ebx, dword [ebp + 8]
xor edi, edi
mov dword [ebp - 0x805c], eax
mov dword [ebp - 0x8058], esi
mov dword [ebp - 4], edi
test eax, eax
jne 0x40949e
lea eax, [edi + 0x57]
jmp 0x4097c2
push ecx
lea ecx, [ebp - 0x8048]
mov dword [ebp - 0x8028], 0
mov dword [ebp - 0x8024], 0
mov dword [ebp - 0x8020], 0
mov dword [ebp - 0x8044], 0
mov dword [ebp - 0x8048], 0
call fcn.004099a0
add esp, 4
test eax, eax
jne 0x4097c2
cmp dword [ebx + 0x18], 8
lea eax, [ebx + 4]
jb 0x4094f2
mov eax, dword [eax]
push 0
push 0x80
push 2
push 0
push 3
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
mov dword [ebp - 0x8050], ebx
cmp ebx, 0xffffffff
je 0x4097bc
mov esi, ebx
mov dword [ebp - 0x8058], esi
jmp 0x409530
mov eax, dword [ebp - 0x8054]
push dword [eax + 4]
lea eax, [ebp - 0x8044]
push eax
push 0x4000
lea eax, [ebp - 0x4010]
push eax
call dword [ebp - 0x805c]
test eax, eax
je 0x409753
cmp dword [ebp - 0x8044], 0
je 0x40961c
lea eax, [ebp - 0x4010]
mov dword [ebp - 0x8048], eax
jmp 0x409580
lea eax, [ebp - 0x8010]
mov dword [ebp - 0x8038], 0x4000
xor edx, edx
mov dword [ebp - 0x803c], eax
lea ecx, [ebp - 0x8048]
call fcn.00409be0
mov edi, eax
cmp edi, 2
je 0x409749
cmp edi, 0xfffffffc
je 0x4096ca
cmp edi, 0xfffffffd
je 0x4096ca
push 0
lea eax, [ebp - 0x804c]
mov dword [ebp - 0x804c], 0
push eax
mov ebx, 0x4000
lea eax, [ebp - 0x8010]
sub ebx, dword [ebp - 0x8038]
push ebx
push eax
push dword [ebp - 0x8050]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4096c2
cmp dword [ebp - 0x804c], ebx
jne 0x4096bd
cmp dword [ebp - 0x8038], 0
je 0x409580
cmp edi, 1
jne 0x409530
cmp dword [ebp - 0x8028], 0
je 0x409685
mov edx, dword [ebp - 0x8024]
test edx, edx
je 0x409685
mov ecx, dword [ebp - 0x802c]
test ecx, ecx
je 0x409685
lea eax, [ebp - 0x8048]
cmp dword [ecx], eax
jne 0x409685
mov eax, dword [ecx + 4]
sub eax, 0x3f34
cmp eax, 0x1f
ja 0x409685
mov eax, dword [ecx + 0x38]
test eax, eax
je 0x40966f
push eax
push dword [ebp - 0x8020]
call edx
mov edx, dword [ebp - 0x8024]
add esp, 8
mov ecx, dword [ebp - 0x802c]
push ecx
push dword [ebp - 0x8020]
call edx
add esp, 8
mov dword [ebp - 0x802c], 0
mov ebx, dword [ebp - 0x8050]
push ebx
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
cmp edi, 1
jne 0x4096b0
mov ecx, dword [ebp - 0x8054]
lea eax, [ecx + 8]
push eax
lea eax, [ecx + 0x18]
push eax
lea eax, [ecx + 0x10]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_SetFileTime]
dec edi
neg edi
sbb edi, edi
and edi, 0xfffffffd
jmp 0x4097c4
or edi, 0xffffffff
jmp 0x4096ca
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
cmp dword [ebp - 0x8028], 0
je 0x4097c4
mov edx, dword [ebp - 0x8024]
test edx, edx
je 0x4097c4
mov ecx, dword [ebp - 0x802c]
test ecx, ecx
je 0x4097c4
lea eax, [ebp - 0x8048]
cmp dword [ecx], eax
jne 0x4097c4
mov eax, dword [ecx + 4]
sub eax, 0x3f34
cmp eax, 0x1f
ja 0x4097c4
mov eax, dword [ecx + 0x38]
test eax, eax
je 0x409731
push eax
push dword [ebp - 0x8020]
call edx
mov edx, dword [ebp - 0x8024]
add esp, 8
mov ecx, dword [ebp - 0x802c]
push ecx
push dword [ebp - 0x8020]
call edx
add esp, 8
mov dword [ebp - 0x802c], 0
jmp 0x4097c4
mov edi, 0xfffffffd
jmp 0x4096ca
cmp dword [ebp - 0x8028], 0
je 0x4097bc
mov edx, dword [ebp - 0x8024]
test edx, edx
je 0x4097bc
mov ecx, dword [ebp - 0x802c]
test ecx, ecx
je 0x4097bc
lea eax, [ebp - 0x8048]
cmp dword [ecx], eax
jne 0x4097bc
mov eax, dword [ecx + 4]
sub eax, 0x3f34
cmp eax, 0x1f
ja 0x4097bc
mov eax, dword [ecx + 0x38]
test eax, eax
je 0x4097a6
push eax
push dword [ebp - 0x8020]
call edx
mov edx, dword [ebp - 0x8024]
add esp, 8
mov ecx, dword [ebp - 0x802c]
push ecx
push dword [ebp - 0x8020]
call edx
add esp, 8
mov dword [ebp - 0x802c], 0
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
cmp esi, 0xffffffff
je 0x4097d9
cmp dword [sym.imp.KERNEL32.dll_CloseHandle], 0
je 0x4097d9
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, edi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0045978b
mov esp, ebp
pop ebp
ret 8