Function at 0x51c496
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 ebp, dword [esp + 0x70]
mov edi, dword [esp + 0x74]
mov esi, dword [esp + 0x78]
je 0x51c4d6
call fcn.0051be60
mov eax, dword [0x86bc14]
lea ecx, [eax - 1]
mov eax, ecx
and ecx, ebp
cdq
mov eax, edx
and eax, edi
or eax, ecx
je 0x51c4d6
cmp dword [0x86bc24], 0
jne 0x51c53d
jmp 0x51c4f9
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
jne 0x51c5cf
jmp 0x51c627
xor edx, edx
cmp byte [0x86bc20], 0
jne 0x51c710
mov dword [esp], str.ntdll
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
test eax, eax
push ecx
je 0x51c536
mov dword [esp + 4], str.NtSetInformationFile
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
push edx
mov dword [0x86bc24], eax
push edx
jne 0x51c53d
mov byte [0x86bc20], 1
mov dl, byte [0x86bc20]
test dl, dl
jne 0x51c70e
mov eax, dword [0x86bc24]
test eax, eax
je 0x51c710
lea ecx, [esp + 0x40]
mov dword [esp + 0x10], 0x14
mov dword [esp + 0xc], 8
mov byte [esp + 0x2c], dl
mov dword [esp + 0x40], ebp
mov dword [esp + 8], ecx
lea ecx, [esp + 0x48]
mov dword [esp + 0x44], edi
mov dword [esp + 4], ecx
mov ecx, dword [ebx + 4]
mov dword [esp], ecx
call eax
sub esp, 0x14
test eax, eax
jns 0x51c5a3
call fcn.004e34b3
mov dword [esi], 0xffffffff
mov dword [esi + 4], eax
jmp 0x51c5c6
test byte [ebx + 0x20], 8
mov dl, 1
jne 0x51c710
mov dword [esp + 4], ebp
mov dword [esp + 8], edi
mov eax, dword [ebx + 4]
mov byte [esp + 0x2c], dl
mov dword [esp], eax
call fcn.0051c421
mov dl, byte [esp + 0x2c]
jmp 0x51c710
cmp dword [esp + 0x4c], edi
mov dword [esp + 0x40], ebp
mov dword [esp + 0x44], edi
jne 0x51c5e3
cmp dword [esp + 0x48], ebp
je 0x51c63e
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 0x51c627
mov eax, dword [ebx + 4]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
test eax, eax
push ecx
jne 0x51c63e
call fcn.004e34b3
mov ebx, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esi + 4], ebx
mov dword [esi], eax
jmp 0x51c70e
test byte [ebx + 0x20], 8
jne 0x51c70a
cmp dword [0x86bc1c], 0
jne 0x51c68d
cmp byte [0x86bc19], 0
jne 0x51c68d
mov dword [esp], 0x74db68
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
test eax, eax
push edx
je 0x51c686
mov dword [esp + 4], str.GetCompressedFileSizeW
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [0x86bc1c], eax
push ecx
push ecx
jmp 0x51c68d
mov byte [0x86bc19], 1
mov eax, dword [0x86bc1c]
mov dword [esp + 0x40], 0
mov dword [esp + 0x44], 0
test eax, eax
je 0x51c6eb
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 edx
push edx
mov edx, dword [esp + 0x3c]
mov dword [esp + 0x40], eax
inc eax
mov dword [esp + 0x44], edx
jne 0x51c6eb
call fcn.004e34b3
mov dword [esp + 0x2c], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, dword [esp + 0x2c]
test eax, eax
mov dword [esi], eax
mov dword [esi + 4], edx
jne 0x51c70e
cmp dword [esp + 0x44], edi
jne 0x51c6f7
cmp dword [esp + 0x40], ebp
je 0x51c70a
mov dword [esp + 4], ebp
mov dword [esp + 8], edi
mov eax, dword [ebx + 4]
mov dword [esp], eax
call fcn.0051c421
mov dl, 1
jmp 0x51c710
xor edx, edx
add esp, 0x5c
mov al, dl
pop ebx
pop esi
pop edi
pop ebp
ret 0xc