Function at 0x49bda5
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x70
push ebx
push esi
push edi
mov ebx, ecx
call fcn.0049bfc6
push dword [ebp + 0x1c]
and dword [ebp - 0xc], 0
mov esi, eax
lea ecx, [ebp - 0x70]
mov dword [ebp - 0x10], esi
mov dword [ebp - 8], edx
call fcn.0049c061
mov edi, dword [ebp + 0x14]
mov eax, 0x10000
mov dword [ebp - 4], edi
cmp edi, eax
jb 0x49bdde
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x18]
and dword [ebp - 0x40], 0
push 0
push edi
lea ecx, [ebp - 0x70]
mov dword [ebp - 0x50], eax
call fcn.0049c0ca
mov ecx, dword [ebp + 8]
mov edx, edi
mov edi, dword [ebp + 0xc]
add edx, ecx
push 0
pop eax
adc eax, edi
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 8]
add esi, 0x10000
adc eax, 0
mov dword [ebp - 0x20], edi
mov edi, dword [ebp + 0x14]
mov dword [ebp - 0x1c], ecx
mov dword [ebp - 0x24], edx
cmp dword [ebp - 0x14], eax
jb 0x49be64
ja 0x49be28
cmp edx, esi
jbe 0x49be64
cmp dword [ebp - 0x6c], 0
je 0x49be3d
lea ecx, [ebp - 0x70]
call fcn.0049af50
mov edx, dword [ebp - 0x24]
mov esi, eax
jmp 0x49be3f
xor esi, esi
test esi, esi
js 0x49bf6f
push dword [ebp + 0x1c]
lea eax, [ebx + 8]
push dword [ebp - 0x14]
mov ecx, dword [eax]
push edx
push eax
call dword [ecx + 0x18]
xor ecx, ecx
test eax, eax
setns cl
mov dword [ebp - 0xc], ecx
mov ecx, dword [ebp + 8]
mov edx, dword [ebp + 0xc]
and dword [ebp - 0x28], 0
cmp dword [ebp - 0x6c], 0
mov dword [ebp - 0x30], ecx
mov dword [ebp - 0x2c], edx
je 0x49be83
lea ecx, [ebp - 0x70]
call fcn.0049af50
mov esi, eax
jmp 0x49be85
xor esi, esi
test esi, esi
js 0x49bf53
mov esi, dword [ebp - 4]
lea eax, [ebp - 0x38]
push eax
lea eax, [ebp - 0x18]
push eax
push esi
push dword [ebp + 0x10]
push dword [ebx + 0x18]
call dword [sym.imp.KERNEL32.dll_WriteFile]
cmp dword [ebx + 0x20], 0
je 0x49bed4
test eax, eax
jne 0x49bef7
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
jne 0x49bed8
push 1
lea eax, [ebp - 0x18]
push eax
lea eax, [ebp - 0x38]
push eax
push dword [ebx + 0x18]
call fcn.00497dc4
add esp, 0x10
movzx eax, al
test eax, eax
jne 0x49bef7
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
test esi, esi
jle 0x49bef2
and esi, 0xffff
or esi, 0x80070000
test esi, esi
jne 0x49bf53
mov esi, dword [ebp - 4]
mov eax, dword [ebp - 0x18]
mov ecx, dword [ebp + 0x18]
add dword [ecx], eax
mov ecx, dword [ebp - 0x1c]
add dword [ebp + 0x10], eax
mov edx, dword [ebp - 0x20]
sub edi, eax
add ecx, eax
adc edx, 0
mov dword [ebp - 0x1c], ecx
mov dword [ebp - 0x20], edx
cmp dword [ebp - 8], edx
ja 0x49bf27
jb 0x49bf21
cmp dword [ebp - 0x10], ecx
ja 0x49bf27
mov dword [ebp - 0x10], ecx
mov dword [ebp - 8], edx
cmp esi, eax
jne 0x49bf4e
xor esi, esi
test edi, edi
je 0x49bf4a
mov eax, 0x10000
cmp edi, eax
jae 0x49bf42
mov dword [ebp - 4], edi
jmp 0x49be67
mov dword [ebp - 4], eax
jmp 0x49be67
xor eax, eax
jmp 0x49bf56
mov esi, 0x80004005
mov eax, dword [ebp - 0xc]
test eax, eax
je 0x49bf6f
mov edx, dword [ebp - 8]
push 0
push edx
mov edx, dword [ebp - 0x10]
lea eax, [ebx + 8]
mov ecx, dword [eax]
push edx
push eax
call dword [ecx + 0x18]
jmp 0x49bf7b
mov edx, dword [ebp - 0x10]
mov dword [ebx + 0x48], edx
mov edx, dword [ebp - 8]
mov dword [ebx + 0x4c], edx
lea ecx, [ebp - 0x70]
call fcn.0048bfbf
pop edi
mov eax, esi
pop esi
pop ebx
leave
ret 0x18