Function at 0x42f060
Capabilities:
Get common file path
Read file on windows

Disassembly:
mov eax, dword [0x50b6b0]
sub esp, 0x140
push ebx
mov ebx, ecx
push ebp
push esi
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push edi
mov edi, dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
test al, 1
jne 0x42f0a2
push str.Wow64DisableWow64FsRedirection
or eax, 1
push str.kernel32.dll
mov dword [0x50b6b0], eax
call edi
push eax
call esi
mov dword [0x50b6b4], eax
mov eax, dword [0x50b6b0]
test al, 2
jne 0x42f0c2
push str.Wow64RevertWow64FsRedirection
or eax, 2
push str.kernel32.dll
mov dword [0x50b6b0], eax
call edi
push eax
call esi
mov dword [0x50b6b8], eax
cmp byte [0x50b508], 0
mov dword [esp + 0x10], 0
jne 0x42f254
cmp byte [0x4eb508], 0
jne 0x42f254
call dword [sym.imp.KERNEL32.dll_GetACP]
push 0x104
mov edi, eax
mov dword [esp + 0x4c], 0
lea eax, [esp + 0x50]
xorps xmm0, xmm0
push 0
push eax
movups xmmword [esp + 0x44], xmm0
call fcn.004afdf0
add esp, 0xc
lea eax, [esp + 0x4c]
push 0x104
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
lea esi, [esp + 0x4c]
lea ecx, [esi + 1]
mov dword [esp + eax + 0x4c], 0x5f435c
nop
mov al, byte [esi]
inc esi
test al, al
jne 0x42f130
sub esi, ecx
lea edx, [esp + 0x38]
mov ecx, edi
call fcn.004128f0
mov ecx, eax
lea edx, [esp + 0x4c]
sub esi, ecx
add edx, esi
nop
mov al, byte [ecx]
lea ecx, [ecx + 1]
mov byte [edx + ecx - 1], al
test al, al
jne 0x42f150
lea ecx, [esp + 0x4c]
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x42f164
mov eax, dword [str..NLS]
sub ecx, edx
mov dword [esp + ecx + 0x4c], eax
mov al, byte [0x4d7ac0]
mov byte [esp + ecx + 0x50], al
mov eax, dword [0x50b6b4]
test eax, eax
je 0x42f18f
lea ecx, [esp + 0x14]
push ecx
call eax
push 0
push 0
push 3
push 0
push 7
push connect
lea eax, [esp + 0x64]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp dword [0x50b6b4], 0
mov ebp, eax
je 0x42f1be
push dword [esp + 0x14]
call dword [0x50b6b8]
cmp ebp, 0xffffffff
je 0x42f24d
mov edi, dword [sym.imp.KERNEL32.dll_SetFilePointer]
xorps xmm0, xmm0
push 0
push 0
push 0
push ebp
movups xmmword [esp + 0x2c], xmm0
mov dword [esp + 0x44], 0
movq qword [esp + 0x3c], xmm0
call edi
mov esi, dword [sym.imp.KERNEL32.dll_ReadFile]
lea eax, [esp + 0x18]
push 0
push eax
push 0x1c
lea eax, [esp + 0x28]
push eax
push ebp
call esi
mov ax, word [esp + 0x20]
movzx ecx, word [esp + 0x1c]
mov word [0x4e6730], ax
movzx eax, word [esp + 0x36]
add ecx, eax
push 0
push 0
lea eax, [ecx*2 + 2]
push eax
push ebp
call edi
push 0
lea eax, [esp + 0x1c]
push eax
push 0x20000
push 0x4eb508
push ebp
call esi
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov byte [0x50b508], 1
jmp 0x42f254
mov byte [0x4eb508], 1
mov esi, dword [esp + 0x154]
test esi, esi
jne 0x42f26c
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x140
ret
mov ebp, dword [esp + 0x158]
lea edx, [ebx + 0x4000]
add ebp, esi
mov dword [esp + 0x14], edx
cmp esi, ebp
jae 0x42f360
movzx eax, byte [esi]
inc esi
cmp eax, 0x80
jae 0x42f296
xor edi, edi
jmp 0x42f2d6
cmp eax, 0xc0
jb 0x42f36f
cmp eax, 0xe0
jae 0x42f2b2
and eax, 0x1f
mov edi, 1
jmp 0x42f2d6
cmp eax, 0xf0
jae 0x42f2c3
and eax, 0xf
mov edi, 2
jmp 0x42f2d6
cmp eax, 0xf8
jae 0x42f36f
and eax, 7
mov edi, 3
mov ecx, ebp
sub ecx, esi
cmp ecx, edi
jl 0x42f360
test edi, edi
je 0x42f309
cmp esi, ebp
jae 0x42f305
movzx edx, byte [esi]
inc esi
mov ecx, edx
and cl, 0xc0
cmp cl, 0x80
jne 0x42f305
and edx, 0x3f
shl eax, 6
or eax, edx
sub edi, 1
jne 0x42f2e6
mov edx, dword [esp + 0x14]
cmp ebx, edx
jae 0x42f360
cmp eax, 0x80
jb 0x42f351
cmp byte [0x50b508], 0
jne 0x42f322
mov byte [ebx], 0x3f
jmp 0x42f353
mov dx, word [0x4e6730]
cmp dx, 2
jne 0x42f341
mov cl, byte [eax*2 + 0x4eb509]
test cl, cl
je 0x42f341
mov byte [ebx], cl
inc ebx
inc dword [esp + 0x10]
movzx ecx, dx
mov edx, dword [esp + 0x14]
imul ecx, eax
mov al, byte [ecx + 0x4eb508]
mov byte [ebx], al
inc dword [esp + 0x10]
inc ebx
cmp esi, ebp
jb 0x42f287
mov eax, dword [esp + 0x10]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x140
ret
pop edi
pop esi
pop ebp
mov eax, 0xfffffffe
pop ebx
add esp, 0x140
ret