Function at 0x58d371
Capabilities:
Read file via mapping

Disassembly:
push ebp
mov ebp, esp
push ecx
push ecx
push ebx
push esi
mov esi, ecx
push edi
xor edi, edi
cmp dword [esi + 0x80], edi
jne 0x58d5f1
cmp dword [esi + 0x54], edi
jne 0x58d5f1
cmp dword [esi + 0x58], edi
jne 0x58d5f1
mov eax, dword [esi + 0x6c]
cmp eax, 4
je 0x58d5f1
cmp eax, 5
je 0x58d5f1
cmp eax, 6
je 0x58d5f1
mov ecx, dword [sym.imp.KERNEL32.dll_CloseHandle]
lea edx, [esi + 4]
movzx ebx, word [edx]
mov dword [ebp - 8], ecx
test bx, bx
jne 0x58d480
mov ecx, dword [esi + 0x64]
cmp ecx, 0x10000
ja 0x58d480
push 0x405920
push ecx
mov dword [ebp - 4], ecx
call fcn.0047d69a
mov dword [esi + 0x60], eax
mov dword [esi + 0x5c], eax
pop ecx
pop ecx
test eax, eax
jne 0x58d404
mov ebx, 0x8007000e
jmp 0x58d5c0
push ecx
push edi
mov ecx, esi
call fcn.0058dcd0
mov ebx, eax
test ebx, ebx
js 0x58d5c0
lea eax, [ebp - 4]
mov ecx, esi
push eax
push dword [ebp - 4]
push dword [esi + 0x60]
call fcn.0058db70
mov ebx, eax
test ebx, ebx
jns 0x58d445
cmp dword [esi + 0x60], edi
je 0x58d43d
push dword [esi + 0x60]
call dword [sym.imp.tbbmalloc.dll_scalable_free]
pop ecx
mov dword [esi + 0x60], edi
jmp 0x58d5c0
cmp dword [esi + 0x50], 0xffffffff
je 0x58d461
test byte [esi + 0x68], 6
je 0x58d455
push 6
jmp 0x58d473
push dword [esi + 0x50]
call dword [ebp - 8]
or dword [esi + 0x50], 0xffffffff
jmp 0x58d471
mov ecx, dword [esi + 0x4c]
test ecx, ecx
je 0x58d471
mov eax, dword [ecx]
push ecx
call dword [eax + 8]
mov dword [esi + 0x4c], edi
push 4
pop eax
mov dword [esi + 0x6c], eax
or byte [esi + 0x48], 8
jmp 0x58d5b1
test byte [esi + 0x68], 2
jne 0x58d52d
cmp eax, 3
je 0x58d52d
mov eax, ebx
neg eax
sbb eax, eax
and eax, edx
push eax
push edi
push edi
push 2
push edi
push dword [esi + 0x50]
call dword [sym.imp.KERNEL32.dll_CreateFileMappingW]
mov dword [esi + 0x54], eax
test eax, eax
jne 0x58d4cc
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jle 0x58d607
movzx eax, ax
or eax, 0x80070000
jmp 0x58d607
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esi + 0x70], 1
call ebx
cmp eax, 0xb7
jne 0x58d4ec
mov ebx, 0x8013110a
jmp 0x58d5c0
push edi
push edi
push edi
push 4
push dword [esi + 0x54]
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov dword [esi + 0x60], eax
mov dword [esi + 0x5c], eax
test eax, eax
jne 0x58d5b1
call ebx
mov ebx, eax
test ebx, ebx
jle 0x58d51b
movzx ebx, bx
or ebx, 0x80070000
test ebx, ebx
js 0x58d522
mov ebx, 0x8013110e
mov dword [esi + 0x60], edi
mov dword [esi + 0x5c], edi
jmp 0x58d5c0
mov edx, dword [0x5a5254]
mov ecx, dword [esi + 0x64]
lea ebx, [edx - 1]
not ebx
lea eax, [ecx - 1]
and ebx, eax
add ebx, edx
cmp ebx, ecx
jae 0x58d54d
mov ebx, 0x80131516
jmp 0x58d5c0
xor edx, edx
mov eax, ebx
div dword [0x5a5254]
push 0x405920
push eax
call fcn.0047d69a
pop ecx
pop ecx
mov ecx, eax
mov dword [esi + 0x80], ecx
test ecx, ecx
jne 0x58d57a
mov eax, 0x8007000e
jmp 0x58d607
xor edx, edx
mov eax, ebx
div dword [0x5a5254]
push eax
push edi
push ecx
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
call fcn.005528ca
push 1
push 0x2000
push ebx
mov ecx, dword [eax]
push edi
push eax
call dword [ecx + 0xc]
mov dword [esi + 0x60], eax
mov dword [esi + 0x5c], eax
test eax, eax
je 0x58d3fa
push ecx
push edi
mov ecx, esi
call fcn.0058dcd0
mov ebx, eax
test ebx, ebx
jns 0x58d5d9
cmp dword [esi + 0x54], edi
je 0x58d5cb
push dword [esi + 0x54]
call dword [ebp - 8]
mov dword [esi + 0x54], edi
mov dword [esi + 0x60], edi
mov dword [esi + 0x5c], edi
mov dword [esi + 0x64], edi
jmp 0x58d5dc
mov edi, dword [esi + 0x60]
mov eax, dword [ebp + 8]
mov ecx, dword [ebp + 0xc]
mov dword [eax], edi
test ecx, ecx
je 0x58d5ed
mov eax, dword [esi + 0x64]
mov dword [ecx], eax
mov eax, ebx
jmp 0x58d607
mov eax, dword [ebp + 8]
mov ecx, dword [esi + 0x60]
mov dword [eax], ecx
mov ecx, dword [ebp + 0xc]
test ecx, ecx
je 0x58d605
mov eax, dword [esi + 0x64]
mov dword [ecx], eax
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret 0xc