Function at 0x403570
Capabilities:
Write file on windows

Disassembly:
sub esp, 0x110
push ebx
push ebp
push esi
push edi
mov edi, dword [esp + 0x124]
xor ebp, ebp
cmp edi, ebp
je 0x40359d
mov ebx, dword [esp + 0x128]
cmp ebx, ebp
je 0x40359d
mov esi, dword [esp + 0x12c]
cmp esi, ebp
jne 0x4035b1
push 0x57
call fcn.0040bae0
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x110
ret
push 0x104
push edi
lea eax, [esp + 0x24]
push eax
call fcn.0040a1b0
mov dl, 0x5c
lea ecx, [esp + 0x1c]
call fcn.0040a060
cmp eax, ebp
je 0x403620
lea ecx, [esp + 0x1c]
push ecx
mov byte [eax], 0
call fcn.004020a0
add esp, 4
test eax, eax
jne 0x403620
call dword [sym.imp.KERNEL32.dll_GetLastError]
push ebp
mov esi, eax
push esi
lea edx, [esp + 0x24]
push edx
push 0x7d
call fcn.00402600
push esi
call fcn.0042e350
push eax
lea eax, [esp + 0x34]
push eax
push str.ERROR:_unable_to_create_directory__s_n_s_n_n
call fcn.0042e200
add esp, 0x20
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x110
ret
push edi
mov dword [esp + 0x18], ebp
call fcn.004037b0
add esp, 4
test eax, eax
jne 0x403665
call dword [sym.imp.KERNEL32.dll_GetLastError]
push ebp
mov esi, eax
push esi
push edi
push 0x7e
call fcn.00402600
push esi
call fcn.0042e350
push eax
push edi
push str.ERROR:_unable_to_get_write_permission_on_file__s_n_s_n_n
call fcn.0042e200
add esp, 0x20
pop edi
pop esi
mov eax, ebp
pop ebp
pop ebx
add esp, 0x110
ret
cmp dword [esp + 0x134], ebp
je 0x403679
push edi
call fcn.00402dc0
add esp, 4
jmp 0x40367b
mov eax, edi
push ebp
push ebp
push 2
push ebp
push ebp
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ecx, eax
cmp ecx, 0xffffffff
mov dword [esp + 0x10], ecx
jne 0x4036ce
call dword [sym.imp.KERNEL32.dll_GetLastError]
push ebp
mov esi, eax
push esi
push edi
push 0x7e
call fcn.00402600
push esi
call fcn.0042e350
push eax
push edi
push str.ERROR:_unable_to_create_file__s_n_s_n_n
call fcn.0042e200
mov eax, dword [esp + 0x34]
add esp, 0x20
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x110
ret
test esi, esi
jbe 0x40371d
cmp esi, 0x40000
mov edi, esi
jb 0x4036e1
mov edi, 0x40000
mov edx, dword [esp + 0x10]
push 0
lea ecx, [esp + 0x1c]
push ecx
push edi
push ebx
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40370b
mov eax, dword [esp + 0x18]
cmp edi, eax
jne 0x40370b
sub esi, eax
add ebx, eax
add ebp, eax
test esi, esi
ja 0x4036d2
mov edi, dword [esp + 0x124]
mov esi, dword [esp + 0x12c]
mov ecx, dword [esp + 0x10]
cmp ebp, esi
je 0x40372a
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x40374e
mov eax, dword [esp + 0x130]
test eax, eax
je 0x403743
push eax
push eax
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_SetFileTime]
mov ecx, dword [esp + 0x10]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
jne 0x403785
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0
mov esi, eax
push esi
push edi
push 0x7f
call fcn.00402600
push esi
call fcn.0042e350
push eax
push edi
push str.ERROR:_unable_to_write_file__s_n_s_n_n
call fcn.0042e200
mov eax, dword [esp + 0x34]
add esp, 0x20
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x110
ret
push edi
call fcn.00401bd0
add esp, 4
pop edi
pop esi
mov dword [esp + 0xc], 1
mov eax, dword [esp + 0xc]
pop ebp
pop ebx
add esp, 0x110
ret