Function at 0x4729f0
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
sub esp, 0x50
mov esi, dword [ebp + 0x10]
mov edi, dword [ebp + 0xc]
test esi, esi
jne 0x472a20
mov dword [esp], 0x3e5
call sub.KERNEL32.dll_SetLastError
sub esp, 4
xor eax, eax
lea esp, [ebp - 8]
pop esi
pop edi
pop ebp
ret
mov dword [esp + 4], edi
lea eax, [edi + esi]
mov dword [esp + 8], eax
mov dword [esp], 1
call fcn.0041a020
mov dword [ebp - 0x30], edi
mov dword [ebp - 0x34], 0
jmp 0x472ac7
call sub.KERNEL32.dll_GetLastError
cmp eax, 0x57
je 0x472bc4
cmp eax, 0x3e5
jne 0x472c38
xor eax, eax
cmp dword [ebp - 0x38], 1
seta al
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x2c]
mov dword [esp + 8], eax
lea eax, [ebp - 0x28]
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.KERNEL32.dll_GetOverlappedResult
sub esp, 0x10
test eax, eax
je 0x472c38
mov eax, dword [ebp - 0x2c]
test eax, eax
je 0x472c42
add dword [ebp - 0x30], eax
sub esi, eax
mov edx, dword [ebp + 0x14]
add dword [ebp - 0x34], eax
test edx, edx
je 0x472ab5
cmp eax, 0x7fff
jbe 0x472b80
cmp dword [ebp + 0x14], 1
je 0x472bb8
test esi, esi
je 0x472b80
mov eax, dword [ebp + 0x14]
sub eax, 2
cmp eax, 1
mov dword [ebp - 0x38], eax
jbe 0x472b90
cmp esi, 0x8000
mov edi, esi
jbe 0x472ae8
mov edi, 0x8000
mov dword [ebp - 0x1c], 0
mov eax, 1
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x1c]
mov dword [esp + 8], eax
xor eax, eax
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.KERNEL32.dll_SetFilePointer
mov dword [ebp - 0x20], eax
mov eax, dword [0x697c50]
sub esp, 0x10
mov dword [esp], eax
call sub.KERNEL32.dll_ResetEvent
mov eax, dword [0x697c50]
sub esp, 4
mov dword [ebp - 0x18], eax
lea eax, [ebp - 0x28]
mov dword [esp + 0x10], eax
lea eax, [ebp - 0x2c]
mov dword [esp + 0xc], eax
mov dword [esp + 8], edi
mov eax, dword [ebp - 0x30]
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.KERNEL32.dll_WriteFile
sub esp, 0x14
test eax, eax
je 0x472a46
mov eax, dword [ebp - 0x2c]
test eax, eax
jne 0x472a9b
mov dword [esp], 0x26
call sub.KERNEL32.dll_SetLastError
sub esp, 4
mov esi, esi
lea edi, [edi]
mov eax, dword [ebp - 0x34]
lea esp, [ebp - 8]
pop esi
pop edi
pop ebp
ret
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.KERNEL32.dll_GetFileType
sub esp, 4
dec eax
je 0x472ad9
cmp dword [ebp + 0x14], 3
jne 0x472ad9
mov dword [esp], 0x3e5
jmp 0x472b6f
mov dword [ebp + 0x14], 3
jmp 0x472abf
mov dword [esp + 8], edi
xor eax, eax
mov dword [esp + 0x10], eax
lea eax, [ebp - 0x2c]
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x30]
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.KERNEL32.dll_WriteFile
sub esp, 0x14
test eax, eax
jne 0x472b5d
call sub.KERNEL32.dll_GetLastError
cmp eax, 0x57
jne 0x472a54
mov dword [esp + 8], edi
xor ecx, ecx
lea eax, [ebp - 0x2c]
mov dword [esp + 0x10], ecx
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x30]
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.KERNEL32.dll_WriteConsoleA
sub esp, 0x14
test eax, eax
jne 0x472b5d
call sub.KERNEL32.dll_GetLastError
jmp 0x472a54
mov eax, 0xffffffff
jmp 0x472a13
cmp dword [ebp - 0x38], 1
ja 0x472b68
jmp 0x472baf