Function at 0x50f42e
Capabilities:
Clear file content
Get file size

Disassembly:
push ebp
push edi
push esi
push ebx
mov ebx, ecx
sub esp, 0x5c
test byte [ecx + 0x20], 4
mov edi, dword [esp + 0x70]
mov ebp, dword [esp + 0x74]
mov esi, dword [esp + 0x78]
je 0x50f467
call fcn.0050edfe
mov eax, dword [0x857c4c]
lea ecx, [eax - 1]
mov eax, ecx
and ecx, edi
cdq
mov eax, edx
and eax, ebp
or eax, ecx
jne 0x50f5c9
lea eax, [esp + 0x48]
mov dword [esp + 4], eax
mov eax, dword [ebx + 4]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
push edx
push edx
je 0x50f4d9
cmp ebp, dword [esp + 0x4c]
mov dword [esp + 0x40], edi
mov dword [esp + 0x44], ebp
jne 0x50f495
cmp edi, dword [esp + 0x48]
je 0x50f4f0
lea eax, [esp + 0x40]
mov edx, dword [esp + 0x44]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x40]
mov dword [esp + 8], edx
mov dword [esp + 4], eax
mov eax, dword [ebx + 4]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
sub esp, 0x14
test eax, eax
je 0x50f4d9
mov eax, dword [ebx + 4]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
test eax, eax
push edx
jne 0x50f4f0
call fcn.004dccc9
mov ebx, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esi + 4], ebx
mov dword [esi], eax
jmp 0x50f619
test byte [ebx + 0x20], 8
jne 0x50f5c2
cmp dword [0x857c54], 0
jne 0x50f53f
cmp byte [0x857c51], 0
jne 0x50f53f
mov dword [esp], 0x739da8
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
test eax, eax
push ecx
je 0x50f538
mov dword [esp + 4], 0x739db5
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [0x857c54], eax
push edx
push edx
jmp 0x50f53f
mov byte [0x857c51], 1
mov eax, dword [0x857c54]
mov dword [esp + 0x40], 0
mov dword [esp + 0x44], 0
test eax, eax
je 0x50f5a3
lea edx, [esp + 0x3c]
mov dword [esp + 0x3c], 0
mov dword [esp + 4], edx
mov edx, dword [ebx + 8]
mov dword [esp], edx
call eax
push ecx
push ecx
mov edx, dword [esp + 0x3c]
mov dword [esp + 0x40], eax
inc eax
mov dword [esp + 0x44], edx
jne 0x50f5a3
call fcn.004dccc9
mov dword [esp + 0x2c], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, dword [esp + 0x2c]
mov dword [esi], eax
mov dword [esi + 4], edx
xor edx, edx
test eax, eax
jne 0x50f6a0
cmp ebp, dword [esp + 0x44]
jne 0x50f5af
cmp edi, dword [esp + 0x40]
je 0x50f5c2
mov dword [esp + 4], edi
mov dword [esp + 8], ebp
mov eax, dword [ebx + 4]
mov dword [esp], eax
call fcn.0050f3b9
mov dl, 1
jmp 0x50f6a0
cmp dword [0x857c5c], 0
jne 0x50f60f
xor edx, edx
cmp byte [0x857c58], 0
jne 0x50f6a0
mov dword [esp], 0x739d8d
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
test eax, eax
push edx
je 0x50f620
mov dword [esp + 4], 0x739d93
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
push ecx
mov dword [0x857c5c], eax
push ecx
je 0x50f620
mov dl, byte [0x857c58]
test dl, dl
je 0x50f629
xor edx, edx
jmp 0x50f6a0
mov byte [0x857c58], 1
jmp 0x50f60f
mov eax, dword [0x857c5c]
test eax, eax
je 0x50f6a0
lea ecx, [esp + 0x40]
mov dword [esp + 0x10], 0x14
mov dword [esp + 0xc], 8
mov byte [esp + 0x2c], dl
mov dword [esp + 0x40], edi
mov dword [esp + 8], ecx
lea ecx, [esp + 0x48]
mov dword [esp + 0x44], ebp
mov dword [esp + 4], ecx
mov ecx, dword [ebx + 4]
mov dword [esp], ecx
call eax
sub esp, 0x14
test eax, eax
jns 0x50f67d
call fcn.004dccc9
mov dword [esi], 0xffffffff
mov dword [esi + 4], eax
jmp 0x50f69c
test byte [ebx + 0x20], 8
mov dl, 1
jne 0x50f6a0
mov dword [esp + 4], edi
mov dword [esp + 8], ebp
mov eax, dword [ebx + 4]
mov byte [esp + 0x2c], dl
mov dword [esp], eax
call fcn.0050f3b9
mov dl, byte [esp + 0x2c]
add esp, 0x5c
mov al, dl
pop ebx
pop esi
pop edi
pop ebp
ret 0xc