Function at 0x403630
Capabilities:
Write file on windows

Disassembly:
sub esp, 0x110
push ebx
mov ebx, dword [esp + 0x11c]
push ebp
push esi
mov esi, dword [esp + 0x128]
push edi
mov edi, dword [esp + 0x124]
mov eax, edi
neg eax
sbb eax, eax
mov ecx, ebx
neg ecx
sbb ecx, ecx
and eax, ecx
mov edx, esi
neg edx
sbb edx, edx
test edx, eax
jne 0x40367b
push 0x57
call fcn.0040bec0
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.0040a2c0
mov dl, 0x5c
lea ecx, [esp + 0x1c]
call fcn.0040a210
xor ebp, ebp
cmp eax, ebp
je 0x4036ec
lea ecx, [esp + 0x1c]
push ecx
mov byte [eax], 0
call fcn.00402090
add esp, 4
test eax, eax
jne 0x4036ec
call dword [sym.imp.KERNEL32.dll_GetLastError]
push ebp
mov esi, eax
push esi
lea edx, [esp + 0x24]
push edx
push 0x7d
call fcn.00402630
push esi
call fcn.00424790
push eax
lea eax, [esp + 0x34]
push eax
push str.ERROR:_unable_to_create_directory__s_n_s_n_n
call fcn.00424640
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.00403880
add esp, 4
test eax, eax
jne 0x403731
call dword [sym.imp.KERNEL32.dll_GetLastError]
push ebp
mov esi, eax
push esi
push edi
push 0x7e
call fcn.00402630
push esi
call fcn.00424790
push eax
push edi
push str.ERROR:_unable_to_get_write_permission_on_file__s_n_s_n_n
call fcn.00424640
add esp, 0x20
pop edi
pop esi
mov eax, ebp
pop ebp
pop ebx
add esp, 0x110
ret
cmp dword [esp + 0x134], ebp
je 0x403745
push edi
call fcn.00402e70
add esp, 4
jmp 0x403747
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 0x40379a
call dword [sym.imp.KERNEL32.dll_GetLastError]
push ebp
mov esi, eax
push esi
push edi
push 0x7e
call fcn.00402630
push esi
call fcn.00424790
push eax
push edi
push str.ERROR:_unable_to_create_file__s_n_s_n_n
call fcn.00424640
mov eax, dword [esp + 0x34]
add esp, 0x20
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x110
ret
test esi, esi
jbe 0x4037eb
mov edi, edi
cmp esi, 0x40000
mov edi, esi
jb 0x4037af
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 0x4037d9
mov eax, dword [esp + 0x18]
cmp edi, eax
jne 0x4037d9
sub esi, eax
add ebx, eax
add ebp, eax
test esi, esi
ja 0x4037a0
mov edi, dword [esp + 0x124]
mov esi, dword [esp + 0x12c]
mov ecx, dword [esp + 0x10]
cmp ebp, esi
je 0x4037f8
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x40381c
mov eax, dword [esp + 0x130]
test eax, eax
je 0x403811
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 0x403853
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0
mov esi, eax
push esi
push edi
push 0x7f
call fcn.00402630
push esi
call fcn.00424790
push eax
push edi
push str.ERROR:_unable_to_write_file__s_n_s_n_n
call fcn.00424640
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