Function at 0x51bcb0
Capabilities:
Get common file path

Disassembly:
mov eax, dword fs:[0]
push 0xffffffffffffffff
push 0x561f9b
push eax
mov dword fs:[0], esp
sub esp, 0x810
push ebx
mov ebx, ecx
push ebp
push esi
mov al, byte [ebx + 0xc]
push edi
test al, al
je 0x51bce5
call fcn.0051c040
test al, al
je 0x51bf1a
mov edi, dword [esp + 0x838]
test edi, edi
je 0x51bf1a
mov al, byte [0x6217cc]
test al, al
je 0x51bf1a
mov ebp, dword [esp + 0x830]
lea eax, [esp + 0x10]
push ebp
push eax
mov ecx, ebx
call fcn.0051bb80
mov eax, dword [esp + 0x14]
mov dword [esp + 0x828], 0
test eax, eax
jne 0x51bd2d
mov eax, 0x597ac0
push 0x5fa2a8
push eax
call fcn.0053f230
mov esi, eax
add esp, 8
test esi, esi
je 0x51bd60
mov ecx, dword [esp + 0x834]
push esi
push edi
push 1
push ecx
call fcn.0053f752
push esi
call fcn.0053f0fd
add esp, 0x14
jmp 0x51be61
mov eax, dword [esp + 0x14]
test eax, eax
jne 0x51bd6d
mov eax, 0x597ac0
push 0
push eax
call fcn.005401d4
add esp, 8
test eax, eax
je 0x51be61
mov dx, word [0x6217d0]
mov ecx, 0xff
xor eax, eax
lea edi, [esp + 0x22]
mov word [esp + 0x20], dx
mov word [esp + 0x420], dx
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
mov ecx, 0xff
xor eax, eax
lea edi, [esp + 0x422]
lea edx, [esp + 0x420]
rep stosd dword es:[edi], eax
push edx
push 0x400
stosw word es:[edi], ax
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
lea eax, [esp + 0x420]
push ebp
push eax
lea ecx, [esp + 0x28]
push 0x5fa2a0
push ecx
call fcn.0053fac7
lea edx, [esp + 0x30]
push 0x5fa2a8
push edx
call fcn.0053f230
mov esi, eax
add esp, 0x18
test esi, esi
je 0x51beb9
mov eax, dword [esp + 0x838]
mov ecx, dword [esp + 0x834]
push esi
push eax
push 1
push ecx
call fcn.0053f752
push esi
call fcn.0053f0fd
add esp, 0x14
lea edi, [esp + 0x20]
or ecx, 0xffffffff
xor eax, eax
push 1
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov ebp, ecx
lea ecx, [esp + 0x14]
push ebp
call fcn.0051c6a0
test al, al
je 0x51be61
mov edi, dword [esp + 0x14]
mov ecx, ebp
mov eax, ecx
lea esi, [esp + 0x20]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [esp + 0x14]
mov dword [esp + 0x18], ebp
mov byte [ecx + ebp], 0
mov eax, dword [esp + 0x14]
test eax, eax
jne 0x51be6e
mov eax, 0x597ac0
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
test eax, eax
mov dword [ebx + 8], eax
je 0x51bef6
mov dword [ebx + 4], 1
mov edx, dword [0x597ac4]
push edx
lea eax, [esp + 0x14]
push 0
push eax
lea ecx, [ebx + 0x10]
call fcn.0051c380
mov ecx, dword [esp + 0x14]
mov byte [ebx + 0xc], 1
test ecx, ecx
je 0x51bef2
mov al, byte [ecx - 1]
test al, al
je 0x51bee8
cmp al, 0xff
je 0x51bee8
dec al
mov byte [ecx - 1], al
mov al, 1
jmp 0x51bf1c
lea edx, [esp + 0x20]
push 0
push edx
call fcn.005401d4
add esp, 8
test eax, eax
je 0x51be1d
push 1
lea ecx, [esp + 0x14]
mov dword [esp + 0x82c], 0xffffffff
call fcn.0051b750
jmp 0x51bf1a
dec ecx
push ecx
call fcn.0055305f
add esp, 4
mov al, 1
jmp 0x51bf1c
mov ecx, dword [esp + 0x14]
test ecx, ecx
je 0x51bf1a
mov al, byte [ecx - 1]
test al, al
je 0x51bf10
cmp al, 0xff
je 0x51bf10
dec al
mov byte [ecx - 1], al
jmp 0x51bf1a
dec ecx
push ecx
call fcn.0055305f
add esp, 4
xor al, al
mov ecx, dword [esp + 0x820]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x81c
ret 0xc