Function at 0x406090
Capabilities:
Write file on windows

Disassembly:
sub esp, 0x210
push ebx
push ebp
push esi
push edi
mov edi, dword [esp + 0x224]
push 0x3a
push edi
call fcn.0044f470
mov ebx, dword [sym.imp.KERNEL32.dll_CreateFileA]
add esp, 8
test eax, eax
je 0x406140
mov al, byte [edi]
or al, byte [0x4eb920]
je 0x406140
mov eax, dword [0x4eb91c]
test eax, eax
je 0x406442
mov ebp, dword [sym.imp.KERNEL32.dll_lstrcpyA]
push 0x4eb920
lea ecx, [esp + 0x1c]
push ecx
call ebp
lea edx, [esp + 0x18]
push edi
push edx
call fcn.00414c70
add esp, 8
push 0
push 0x80
push 2
push 0
push 0
push 0x40000000
lea eax, [esp + 0x30]
push eax
call ebx
mov esi, eax
cmp esi, 0xffffffff
je 0x406146
mov edx, dword [esp + 0x22c]
mov eax, dword [esp + 0x228]
push 0
lea ecx, [esp + 0x14]
push ecx
push edx
push eax
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
push esi
jne 0x40643c
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x406146
mov ebp, dword [sym.imp.KERNEL32.dll_lstrcpyA]
mov al, byte [0xd0a5a0]
test al, al
je 0x4061c9
mov cl, byte [edi]
or cl, al
je 0x4061c9
mov eax, dword [0x4eb91c]
test eax, eax
je 0x406442
push 0xd0a5a0
lea edx, [esp + 0x1c]
push edx
call ebp
lea eax, [esp + 0x18]
push edi
push eax
call fcn.00414c70
add esp, 8
push 0
push 0x80
push 2
push 0
push 0
push 0x40000000
lea ecx, [esp + 0x30]
push ecx
call ebx
mov esi, eax
cmp esi, 0xffffffff
je 0x4061c9
mov eax, dword [esp + 0x22c]
mov ecx, dword [esp + 0x228]
push 0
lea edx, [esp + 0x14]
push edx
push eax
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
push esi
jne 0x40643c
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [0xd0a7a8]
test eax, eax
mov dword [esp + 0x10], 0
jle 0x406281
mov ebp, 0x8eea50
mov dl, byte [edi]
or dl, byte [ebp]
je 0x40625e
mov eax, dword [0x4eb91c]
test eax, eax
je 0x406442
push ebp
lea eax, [esp + 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
lea ecx, [esp + 0x18]
push edi
push ecx
call fcn.00414c70
add esp, 8
push 0
push 0x80
push 2
push 0
push 0
push 0x40000000
lea edx, [esp + 0x30]
push edx
call ebx
mov esi, eax
cmp esi, 0xffffffff
je 0x40625e
mov ecx, dword [esp + 0x22c]
mov edx, dword [esp + 0x228]
push 0
lea eax, [esp + 0x18]
push eax
push ecx
push edx
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
push esi
jne 0x40643c
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x10]
mov ecx, dword [0xd0a7a8]
inc eax
add ebp, 0x104
cmp eax, ecx
mov dword [esp + 0x10], eax
jl 0x4061e3
mov ebp, dword [sym.imp.KERNEL32.dll_lstrcpyA]
mov al, byte [0xd09f80]
test al, al
je 0x406304
mov cl, byte [edi]
or cl, al
je 0x406304
mov eax, dword [0x4eb91c]
test eax, eax
je 0x406442
push 0xd09f80
lea edx, [esp + 0x1c]
push edx
call ebp
lea eax, [esp + 0x18]
push edi
push eax
call fcn.00414c70
add esp, 8
push 0
push 0x80
push 2
push 0
push 0
push 0x40000000
lea ecx, [esp + 0x30]
push ecx
call ebx
mov esi, eax
cmp esi, 0xffffffff
je 0x406304
mov eax, dword [esp + 0x22c]
mov ecx, dword [esp + 0x228]
push 0
lea edx, [esp + 0x18]
push edx
push eax
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
push esi
jne 0x40643c
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov al, byte [0xd0a28c]
test al, al
je 0x406387
mov dl, byte [edi]
or dl, al
je 0x406387
mov eax, dword [0x4eb91c]
test eax, eax
je 0x406442
push 0xd0a28c
lea eax, [esp + 0x1c]
push eax
call ebp
lea ecx, [esp + 0x18]
push edi
push ecx
call fcn.00414c70
add esp, 8
push 0
push 0x80
push 2
push 0
push 0
push 0x40000000
lea edx, [esp + 0x30]
push edx
call ebx
mov esi, eax
cmp esi, 0xffffffff
je 0x406387
mov ecx, dword [esp + 0x22c]
mov edx, dword [esp + 0x228]
push 0
lea eax, [esp + 0x18]
push eax
push ecx
push edx
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
push esi
jne 0x40643c
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov al, byte [edi]
or al, byte [0xd0a084]
je 0x406401
mov eax, dword [0x4eb91c]
test eax, eax
je 0x406442
push 0xd0a084
lea ecx, [esp + 0x1c]
push ecx
call ebp
lea edx, [esp + 0x18]
push edi
push edx
call fcn.00414c70
add esp, 8
push 0
push 0x80
push 2
push 0
push 0
push 0x40000000
lea eax, [esp + 0x30]
push eax
call ebx
mov esi, eax
cmp esi, 0xffffffff
je 0x406401
mov edx, dword [esp + 0x22c]
mov eax, dword [esp + 0x228]
push 0
lea ecx, [esp + 0x18]
push ecx
push edx
push eax
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
push esi
jne 0x40643c
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov al, byte [0xd0a188]
test al, al
je 0x406452
mov ecx, dword [esp + 0x22c]
mov edx, dword [esp + 0x228]
push ecx
push edx
push edi
push 0xd0a188
call fcn.00405fd0
add esp, 0x10
test eax, eax
je 0x406452
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x210
ret
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x210
ret
push edi
lea eax, [esp + 0x120]
push str.File_Write_Error._n_s
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
lea ecx, [esp + 0x11c]
push ecx
push 0xd09bfc
call ebp
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x210
ret