Function at 0x58dc10
Capabilities:
Get file size
Read file on windows
Read file via mapping

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x20
mov eax, dword [edx + 0x210]
mov dword [ebp - 0x1c], edx
mov dword [ebp - 4], 0
mov dword [ebp - 0x14], 0
push ebx
push esi
lea esi, [edx + 0x20c]
push edi
mov edi, ecx
test eax, eax
je 0x58dc4b
cmp eax, 0xffffffff
je 0x58dc4b
cmp dword [esi + 0xc], 0
jne 0x58df34
mov ecx, edx
call fcn.0058db80
mov ecx, edi
call fcn.0058e110
mov ebx, eax
test ebx, ebx
je 0x58df69
push 0
push 0
push 3
push 0
push 1
push SysReAllocStringLen
push ebx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
push ebx
mov edi, eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
cmp edi, 0xffffffff
je 0x58df69
push 0
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
cmp eax, 0x100000
ja 0x58df69
push 0
lea eax, [ebp - 0xc]
push eax
push 4
lea eax, [ebp - 4]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x58df62
cmp dword [ebp - 0xc], 4
jne 0x58df62
mov eax, dword [ebp - 4]
cmp eax, 0x950412de
je 0x58dcd9
cmp eax, 0xde120495
jne 0x58df62
push 0
lea eax, [ebp - 0xc]
push eax
push 4
lea eax, [ebp - 0x14]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x58df62
cmp dword [ebp - 0xc], 4
jne 0x58df62
mov edx, dword [ebp - 4]
mov ecx, dword [ebp - 0x14]
call fcn.0058dfa0
test eax, eax
jne 0x58df62
push eax
push eax
push eax
push 2
push eax
push edi
call dword [sym.imp.KERNEL32.dll_CreateFileMappingW]
mov dword [esi], eax
test eax, eax
je 0x58dd36
push 0
push 0
push 0
push 4
push eax
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov dword [esi + 4], eax
mov eax, dword [esi + 4]
test eax, eax
je 0x58df4f
cmp eax, 0xffffffff
je 0x58df4f
push 0
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
push edi
mov dword [esi + 8], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ebx, dword [esi + 4]
mov edx, dword [ebp - 4]
mov dword [ebp - 0x10], ebx
mov eax, dword [ebx]
mov dword [esi + 0xc], eax
mov ecx, dword [ebx + 4]
call fcn.0058dfa0
mov edx, dword [ebp - 4]
mov dword [esi + 0x10], eax
mov ecx, dword [ebx + 8]
call fcn.0058dfa0
mov edx, dword [ebp - 4]
mov dword [esi + 0x14], eax
mov ecx, dword [ebx + 0xc]
call fcn.0058dfa0
mov edx, dword [ebp - 4]
mov ecx, dword [ebx + 0x10]
lea edi, [ebx + eax]
mov dword [ebp - 0x20], edi
call fcn.0058dfa0
mov ebx, eax
mov edx, esi
add ebx, dword [ebp - 0x10]
mov ecx, edi
mov dword [ebp - 8], ebx
call fcn.0058df80
test eax, eax
je 0x58df3d
mov eax, dword [esi + 0x14]
shl eax, 3
mov dword [ebp - 0x18], eax
lea ecx, [eax + edi]
call fcn.0058df80
test eax, eax
je 0x58df3d
mov ecx, ebx
call fcn.0058df80
test eax, eax
je 0x58df3d
mov edi, dword [ebp - 0x18]
lea ecx, [edi + ebx]
call fcn.0058df80
test eax, eax
je 0x58df3d
push edi
call fcn.004d8b71
add esp, 4
mov dword [esi + 0x18], eax
test eax, eax
je 0x58df3d
push edi
call fcn.004d8b71
mov edi, eax
add esp, 4
mov dword [esi + 0x1c], edi
test edi, edi
je 0x58df3d
mov ecx, dword [esi + 0x14]
mov ebx, dword [esi + 0x18]
mov dword [ebp - 0x18], 0
test ecx, ecx
je 0x58de8a
mov edi, dword [ebp - 0x20]
sub edi, ebx
mov edx, dword [ebp - 4]
mov ecx, dword [edi + ebx]
call fcn.0058dfa0
mov dword [ebx], eax
mov edx, dword [ebp - 4]
mov ecx, dword [edi + ebx + 4]
call fcn.0058dfa0
mov ecx, dword [ebp - 0x10]
mov edx, esi
add ecx, eax
mov dword [ebx + 4], ecx
call fcn.0058df80
test eax, eax
je 0x58df3d
mov eax, dword [ebx]
inc eax
add ecx, eax
call fcn.0058df80
test eax, eax
je 0x58df3d
mov eax, dword [ebp - 0x18]
add ebx, 8
mov ecx, dword [esi + 0x14]
inc eax
mov dword [ebp - 0x18], eax
cmp eax, ecx
jb 0x58de34
mov edi, dword [esi + 0x1c]
xor ebx, ebx
test ecx, ecx
je 0x58dee9
mov eax, dword [ebp - 8]
sub eax, edi
mov dword [ebp - 8], eax
nop dword [eax + eax]
mov edx, dword [ebp - 4]
mov ecx, dword [eax + edi]
call fcn.0058dfa0
mov ecx, dword [ebp - 8]
mov dword [edi], eax
mov edx, dword [ebp - 4]
mov ecx, dword [ecx + edi + 4]
call fcn.0058dfa0
mov ecx, dword [ebp - 0x10]
mov edx, esi
add ecx, eax
mov dword [edi + 4], ecx
call fcn.0058df80
test eax, eax
je 0x58df3d
mov eax, dword [edi]
inc eax
add ecx, eax
call fcn.0058df80
test eax, eax
je 0x58df3d
mov eax, dword [ebp - 8]
inc ebx
add edi, 8
cmp ebx, dword [esi + 0x14]
jb 0x58dea0
mov edx, dword [ebp - 0x1c]
mov ecx, 0x5d9130
call fcn.0058dad0
mov dword [esi + 0x20], eax
test eax, eax
je 0x58df34
push str.charset
push eax
call fcn.004c8d90
add esp, 8
test eax, eax
je 0x58df34
add eax, 8
push eax
call fcn.004ddd1a
add esp, 4
mov dword [esi + 0x24], eax
test eax, eax
je 0x58df69
push 0xa
push eax
call fcn.004c8a60
add esp, 8
test eax, eax
je 0x58df34
mov byte [eax], 0
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 0x1c]
call fcn.0058db80
pop edi
pop esi
or eax, 0xffffffff
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [esi]
test eax, eax
je 0x58df62
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [esi], 0
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
or eax, 0xffffffff
pop ebx
mov esp, ebp
pop ebp
ret