Function at 0x4d01c0
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x50
push esi
mov dword [ebp - 0x2c], ecx
push 1
mov ecx, dword [ebp - 0x2c]
call fcn.004cfb80
movzx eax, al
test eax, eax
jne 0x4d01e3
or eax, 0xffffffff
jmp 0x4d03a5
mov ecx, dword [ebp - 0x2c]
mov dword [ebp - 0x30], ecx
mov edx, dword [ebp - 0x30]
mov eax, dword [ebp + 0xc]
cmp eax, dword [edx + 0x54]
jb 0x4d020f
ja 0x4d0201
mov ecx, dword [ebp - 0x30]
mov edx, dword [ebp + 8]
cmp edx, dword [ecx + 0x50]
jbe 0x4d020f
mov eax, dword [ebp + 8]
mov dword [ebp - 0x38], eax
mov ecx, dword [ebp + 0xc]
mov dword [ebp - 0x34], ecx
jmp 0x4d021e
mov edx, dword [ebp - 0x2c]
mov eax, dword [edx + 0x50]
mov dword [ebp - 0x38], eax
mov ecx, dword [edx + 0x54]
mov dword [ebp - 0x34], ecx
mov edx, dword [ebp - 0x2c]
mov eax, dword [ebp - 0x38]
sub eax, dword [edx + 0x50]
mov ecx, dword [ebp - 0x34]
sbb ecx, dword [edx + 0x54]
mov dword [ebp - 0x10], eax
mov dword [ebp - 0xc], ecx
mov edx, dword [ebp - 0x10]
mov dword [ebp - 8], edx
mov eax, dword [ebp - 0xc]
mov dword [ebp - 4], eax
push 0
push 0
mov ecx, dword [ebp - 4]
push ecx
mov edx, dword [ebp - 8]
push edx
mov eax, dword [ebp - 0x2c]
mov ecx, dword [eax + 0x7c]
push ecx
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
jne 0x4d0273
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.00513440
add esp, 4
or eax, 0xffffffff
jmp 0x4d03a5
mov edx, dword [ebp - 0x2c]
mov dword [ebp - 0x3c], edx
mov eax, dword [ebp - 0x3c]
mov ecx, dword [ebp + 0xc]
cmp ecx, dword [eax + 0x54]
ja 0x4d02a5
jb 0x4d0291
mov edx, dword [ebp - 0x3c]
mov eax, dword [ebp + 8]
cmp eax, dword [edx + 0x50]
jae 0x4d02a5
mov ecx, dword [ebp - 0x2c]
mov edx, dword [ecx + 0x50]
sub edx, dword [ebp + 8]
mov eax, dword [ecx + 0x54]
sbb eax, dword [ebp + 0xc]
mov dword [ebp - 0x40], edx
jmp 0x4d02ac
mov dword [ebp - 0x40], 0
mov ecx, dword [ebp - 0x40]
mov dword [ebp - 0x1c], ecx
mov eax, dword [ebp + 0x14]
cdq
mov ecx, eax
mov esi, edx
add ecx, dword [ebp - 0x10]
adc esi, dword [ebp - 0xc]
mov eax, dword [ebp - 0x1c]
cdq
sub ecx, eax
sbb esi, edx
mov edx, dword [ebp - 0x2c]
mov dword [ebp - 0x48], ecx
mov dword [ebp - 0x44], esi
mov dword [ebp - 0x4c], edx
mov eax, dword [ebp - 0x4c]
mov ecx, dword [ebp - 0x44]
cmp ecx, dword [eax + 0x5c]
ja 0x4d02f7
jb 0x4d02ec
mov edx, dword [ebp - 0x4c]
mov eax, dword [ebp - 0x48]
cmp eax, dword [edx + 0x58]
jae 0x4d02f7
mov ecx, dword [ebp + 0x14]
sub ecx, dword [ebp - 0x1c]
mov dword [ebp - 0x50], ecx
jmp 0x4d0309
mov edx, dword [ebp - 0x2c]
mov eax, dword [edx + 0x58]
sub eax, dword [ebp - 0x10]
mov ecx, dword [edx + 0x5c]
sbb ecx, dword [ebp - 0xc]
mov dword [ebp - 0x50], eax
mov edx, dword [ebp - 0x50]
mov dword [ebp - 0x14], edx
mov dword [ebp - 0x18], 0
push 0
lea eax, [ebp - 0x18]
push eax
mov ecx, dword [ebp - 0x14]
push ecx
mov edx, dword [ebp + 0x10]
add edx, dword [ebp - 0x1c]
push edx
mov eax, dword [ebp - 0x2c]
mov ecx, dword [eax + 0x7c]
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x4d0375
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x70
jne 0x4d0359
lea ecx, [ebp - 0x28]
call fcn.00476c50
push 0x55047c
lea edx, [ebp - 0x28]
push edx
call fcn.00495f14
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.005135c0
add esp, 4
mov ecx, dword [ebp - 0x2c]
call fcn.004cf580
or eax, 0xffffffff
jmp 0x4d03a5
mov eax, dword [ebp - 0x18]
cmp eax, dword [ebp - 0x14]
je 0x4d0382
or eax, 0xffffffff
jmp 0x4d03a5
mov ecx, dword [ebp - 0x2c]
mov edx, dword [ecx + 0x7c]
push edx
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
test eax, eax
jne 0x4d03a2
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.00513500
add esp, 4
mov eax, dword [ebp - 0x18]
pop esi
mov esp, ebp
pop ebp
ret 0x10