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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5349ad
mov eax, dword fs:[0]
push eax
sub esp, 0xa40
mov eax, dword [0x58c250]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [ebp + 8]
mov edx, dword [0x58c214]
mov dword [ebp - 0xa48], eax
mov eax, dword [edx + 0xc]
xor edi, edi
mov ecx, 0x58c214
mov dword [ebp - 0xa40], edi
call eax
add eax, 0x10
mov dword [ebp - 0xa38], eax
mov dword [ebp - 4], 1
mov edx, dword [0x58c214]
mov eax, dword [edx + 0xc]
mov ecx, 0x58c214
call eax
add eax, 0x10
mov dword [ebp - 0xa3c], eax
mov byte [ebp - 4], 2
mov ecx, 0x541e60
test ecx, 0xffff0000
jne 0x4a78ab
mov edx, ecx
movzx esi, dx
push edi
push esi
call fcn.00401480
add esp, 8
cmp eax, edi
je 0x4a78bb
push esi
push eax
lea ecx, [ebp - 0xa3c]
call fcn.00406170
jmp 0x4a78bb
push 0x541e60
lea ecx, [ebp - 0xa3c]
call fcn.0041afc0
mov byte [ebp - 4], 3
push 1
push 0x1a
lea eax, [ebp - 0x218]
push eax
push edi
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
mov ebx, 8
test eax, eax
je 0x4a7906
mov ecx, dword [ebp - 0xa3c]
push str.ports.dat
push ecx
lea edx, [ebp - 0x218]
push edx
lea eax, [ebp - 0xa38]
push str._s_s_s
push eax
call fcn.00401f60
add esp, 0x14
jmp 0x4a79a3
call fcn.004b3850
push edi
lea ecx, [ebp - 0xa34]
push ecx
mov ecx, eax
call fcn.004b3bd0
mov byte [ebp - 4], 4
cmp dword [ebp - 0xa20], ebx
jb 0x4a7936
mov eax, dword [ebp - 0xa34]
mov edx, eax
cmp eax, edi
jne 0x4a793c
xor eax, eax
jmp 0x4a7950
lea edx, [ebp - 0xa34]
mov eax, edx
lea esi, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, di
jne 0x4a7941
sub eax, esi
sar eax, 1
push eax
push edx
lea ecx, [ebp - 0xa38]
call fcn.00401ed0
push 0xa
push 0x541e6c
lea ecx, [ebp - 0xa38]
call fcn.00401ed0
mov byte [ebp - 4], 3
cmp dword [ebp - 0xa20], ebx
jb 0x4a798a
mov edx, dword [ebp - 0xa34]
push edx
call fcn.004efd7c
add esp, 4
xor eax, eax
mov dword [ebp - 0xa20], 7
mov dword [ebp - 0xa24], edi
mov word [ebp - 0xa34], ax
mov ecx, dword [ebp - 0xa38]
push edi
push 0x80
push 4
push edi
push edi
push SysReAllocStringLen
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
push edi
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov edi, eax
lea edx, [edi + 2]
push edx
push ebx
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
push 0
mov ebx, eax
lea eax, [ebp - 0xa4c]
push eax
push edi
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [ebp - 0xa44]
push ecx
push 0x400
lea edx, [ebp - 0xa18]
push edx
push ebx
mov dword [ebp - 0xa44], ebx
call fcn.004a7760
add esp, 0x10
test eax, eax
je 0x4a7ad3
mov edi, dword [sym.imp.KERNEL32.dll_lstrcmpW]
jmp 0x4a7a30
xor eax, eax
cmp word [ebp - 0xa18], ax
je 0x4a7aa9
lea ecx, [ebp - 0xa18]
cmp word [ecx], 0x3a
je 0x4a7a5c
inc eax
cmp word [ebp + eax*2 - 0xa18], 0
lea ecx, [ebp + eax*2 - 0xa18]
jne 0x4a7a41
jmp 0x4a7aa9
lea edx, [ebp + eax*2 - 0xa16]
xor ecx, ecx
push edx
mov word [ebp + eax*2 - 0xa18], cx
call fcn.004f2bce
movzx esi, ax
xor eax, eax
add esp, 4
test si, si
setne al
mov dword [ebp - 0xa40], esi
test eax, eax
je 0x4a7aa9
mov ecx, dword [ebp - 0xa48]
lea eax, [ebp - 0xa18]
push eax
push ecx
call edi
test eax, eax
je 0x4a7ad9
mov dword [ebp - 0xa40], 0
mov ecx, dword [ebp - 0xa44]
lea edx, [ebp - 0xa44]
push edx
push 0x400
lea eax, [ebp - 0xa18]
push eax
push ecx
call fcn.004a7760
add esp, 0x10
test eax, eax
jne 0x4a7a30
mov esi, dword [ebp - 0xa40]
push ebx
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov byte [ebp - 4], 1
mov eax, dword [ebp - 0xa3c]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x4a7b0f
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp - 0xa38]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4a7b38
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ax, si
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.004f0194
mov esp, ebp
pop ebp
ret