Function at 0x513570
Capabilities:
Get common file path

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x587962
mov eax, dword fs:[0]
push eax
sub esp, 0x22c
push ebx
push esi
push edi
mov eax, dword [0x732480]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x1c], 0
mov dword [ebp - 0x14], 0x71f0d0
mov bl, byte [ebp + 0xc]
or edi, 0xffffffff
mov dword [ebp - 4], 0
test bl, bl
jne 0x513656
lea eax, [ebp - 0x10]
push eax
call fcn.0047b360
add esp, 4
push eax
lea ecx, [ebp - 0x1c]
mov byte [ebp - 4], 1
call fcn.00452c70
lea ecx, [ebp + 0xc]
mov byte [ebp - 4], 2
push ecx
mov ecx, eax
call fcn.00453f70
push eax
lea ecx, [ebp - 0x14]
mov byte [ebp - 4], 3
call fcn.00402cb0
mov eax, dword [ebp + 0xc]
mov eax, dword [eax]
test eax, eax
je 0x513611
cmp eax, edi
je 0x513620
mov eax, dword [ebp + 0xc]
mov ecx, edi
lock xadd dword [eax], ecx
dec ecx
setne al
test al, al
jne 0x513620
push 4
push 2
push dword [ebp + 0xc]
call fcn.00425140
add esp, 0xc
lea ecx, [ebp - 0x1c]
call fcn.00452fa0
mov eax, dword [ebp - 0x10]
mov eax, dword [eax]
test eax, eax
je 0x513647
cmp eax, 0xffffffff
je 0x513656
mov eax, dword [ebp - 0x10]
mov ecx, edi
lock xadd dword [eax], ecx
dec ecx
setne al
test al, al
jne 0x513656
push 4
push 2
push dword [ebp - 0x10]
call fcn.00425140
add esp, 0xc
lea eax, [ebp - 0x228]
mov dword [ebp - 0x234], 0
mov dword [ebp - 0x230], eax
mov dword [ebp - 0x238], 0x104
push 0x104
push eax
mov byte [ebp - 4], 4
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
mov esi, eax
cmp esi, 0x104
jbe 0x5136bb
cmp esi, dword [ebp - 0x238]
lea ecx, [ebp - 0x238]
mov edx, esi
cmovl edx, dword [ebp - 0x238]
push edx
push esi
call fcn.00490620
push esi
push dword [ebp - 0x230]
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
mov esi, eax
push esi
push dword [ebp - 0x230]
lea eax, [ebp + 0xc]
push eax
call fcn.0042aa50
add esp, 0xc
mov ecx, dword [eax]
mov dword [eax], 0x71f078
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x10], ecx
mov dword [ebp - 4], 4
mov eax, dword [eax]
test eax, eax
je 0x5136ff
cmp eax, 0xffffffff
je 0x51370e
mov eax, dword [ebp + 0xc]
mov ecx, edi
lock xadd dword [eax], ecx
dec ecx
setne al
test al, al
jne 0x51370e
push 4
push 2
push dword [ebp + 0xc]
call fcn.00425140
add esp, 0xc
mov eax, dword [ebp - 0x230]
lea ecx, [ebp - 0x228]
cmp eax, ecx
je 0x513727
push eax
call fcn.00558b70
add esp, 4
lea eax, [ebp - 0x10]
mov byte [ebp - 4], 6
push eax
lea ecx, [ebp - 0x14]
call fcn.00402cb0
mov eax, dword [ebp - 0x10]
mov byte [ebp - 4], 0
mov ecx, dword [eax]
mov eax, dword [ebp - 0x10]
test ecx, ecx
je 0x51375a
cmp ecx, 0xffffffff
je 0x513767
mov ecx, edi
lock xadd dword [eax], ecx
dec ecx
setne cl
test cl, cl
jne 0x513767
push 4
push 2
push eax
call fcn.00425140
add esp, 0xc
test bl, bl
jne 0x51388a
lea eax, [ebp - 0x1c]
push str.PATH
push eax
call fcn.0046a470
add esp, 8
mov eax, dword [eax]
mov byte [ebp - 4], 7
mov edx, dword [eax + 0xc]
add edx, eax
je 0x51379d
mov ecx, edx
lea esi, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x513792
sub ecx, esi
jmp 0x51379f
xor ecx, ecx
push ecx
push edx
call fcn.0042a840
add esp, 8
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x1c]
mov byte [ebp - 4], 9
mov eax, dword [eax]
test eax, eax
je 0x5137cf
cmp eax, 0xffffffff
je 0x5137de
mov eax, dword [ebp - 0x1c]
mov ecx, edi
lock xadd dword [eax], ecx
dec ecx
setne al
test al, al
jne 0x5137de
push 4
push 1
push dword [ebp - 0x1c]
call fcn.00425140
add esp, 0xc
push 1
push ecx
mov eax, esp
push ecx
mov ecx, 0x3b
mov dword [eax], 1
mov eax, esp
mov word [eax], cx
lea eax, [ebp + 0xc]
push eax
lea ecx, [ebp - 0x10]
call fcn.0042e2e0
push eax
lea ecx, [ebp - 0x14]
mov byte [ebp - 4], 0xa
call fcn.00513420
mov eax, dword [ebp + 0xc]
mov byte [ebp - 4], 0xb
mov eax, dword [eax]
test eax, eax
je 0x513830
cmp eax, 0xffffffff
je 0x513858
mov eax, dword [ebp + 0xc]
mov ecx, edi
lock xadd dword [eax], ecx
dec ecx
setne al
test al, al
jne 0x513858
mov esi, dword [ebp + 0xc]
lea ecx, [ebp + 0xc]
mov eax, dword [esi + 0xc]
add eax, 4
lea eax, [esi + eax*4]
push eax
mov eax, dword [esi + 8]
add eax, 4
lea eax, [esi + eax*4]
push eax
call fcn.004037e0
push esi
call fcn.00430ae0
add esp, 4
mov eax, dword [ebp - 0x10]
mov byte [ebp - 4], 0
mov eax, dword [eax]
test eax, eax
je 0x51387b
cmp eax, 0xffffffff
je 0x51388a
mov eax, dword [ebp - 0x10]
mov ecx, edi
lock xadd dword [eax], ecx
dec ecx
setne al
test al, al
jne 0x51388a
push 4
push 2
push dword [ebp - 0x10]
call fcn.00425140
add esp, 0xc
push 0xffffffffffffffff
push dword [ebp + 8]
lea eax, [ebp + 0xc]
push eax
call fcn.0042aa50
add esp, 0xc
mov ecx, dword [eax]
mov dword [ebp - 0x20], ecx
mov dword [eax], 0x71f078
mov eax, dword [ebp + 0xc]
mov dword [ebp - 4], 0
mov eax, dword [eax]
test eax, eax
je 0x5138cc
cmp eax, 0xffffffff
je 0x5138db
mov eax, dword [ebp + 0xc]
mov ecx, edi
lock xadd dword [eax], ecx
dec ecx
setne al
test al, al
jne 0x5138db
push 4
push 2
push dword [ebp + 0xc]
call fcn.00425140
add esp, 0xc
push str..dll
push 4
lea ecx, [ebp - 0x20]
mov byte [ebp - 4], 0xd
call fcn.00427fa0
mov eax, dword [ebp - 0x14]
xor esi, esi
mov ecx, dword [eax + 0xc]
sub ecx, dword [eax + 8]
test ecx, ecx
jle 0x5139b1
lea ebx, [esi + 0x5c]
mov ecx, dword [eax + 8]
add ecx, esi
mov eax, dword [eax + ecx*4 + 0x10]
mov dword [ebp + 0xc], eax
mov eax, dword [eax]
test eax, eax
je 0x513921
cmp eax, 0xffffffff
je 0x513921
mov eax, dword [ebp + 0xc]
lock inc dword [eax]
push 1
push ecx
mov eax, esp
mov byte [ebp - 4], 0xe
lea ecx, [ebp + 0xc]
mov word [eax], bx
call fcn.00429ee0
test al, al
jne 0x513947
push ecx
mov eax, esp
lea ecx, [ebp + 0xc]
mov word [eax], bx
call fcn.004119f0
lea eax, [ebp - 0x20]
push eax
lea ecx, [ebp + 0xc]
call fcn.00427d70
lea ecx, [ebp + 0xc]
call fcn.0042f930
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov ebx, eax
mov eax, dword [ebp + 0xc]
mov eax, dword [eax]
test ebx, ebx
jne 0x513a41
test eax, eax
je 0x51398b
cmp eax, 0xffffffff
je 0x51399a
mov eax, dword [ebp + 0xc]
mov ecx, edi
lock xadd dword [eax], ecx
dec ecx
setne al
test al, al
jne 0x51399a
push 4
push 2
push dword [ebp + 0xc]
call fcn.00425140
add esp, 0xc
mov eax, dword [ebp - 0x14]
inc esi
mov ebx, 0x5c
mov ecx, dword [eax + 0xc]
sub ecx, dword [eax + 8]
cmp esi, ecx
jl 0x513904
xor ebx, ebx
mov eax, dword [ebp - 0x20]
mov eax, dword [eax]
test eax, eax
je 0x5139d2
cmp eax, 0xffffffff
je 0x5139e1
mov eax, dword [ebp - 0x20]
mov ecx, edi
lock xadd dword [eax], ecx
dec ecx
setne al
test al, al
jne 0x5139e1
push 4
push 2
push dword [ebp - 0x20]
call fcn.00425140
add esp, 0xc
mov eax, dword [ebp - 0x14]
mov dword [ebp - 4], 0xf
mov eax, dword [eax]
test eax, eax
je 0x513a05
cmp eax, 0xffffffff
je 0x513a2d
mov ecx, dword [ebp - 0x14]
lock xadd dword [ecx], edi
dec edi
setne cl
test cl, cl
jne 0x513a2d
mov esi, dword [ebp - 0x14]
lea ecx, [ebp - 0x14]
mov eax, dword [esi + 0xc]
add eax, 4
lea eax, [esi + eax*4]
push eax
mov eax, dword [esi + 8]
add eax, 4
lea eax, [esi + eax*4]
push eax
call fcn.004037e0
push esi
call fcn.00430ae0
add esp, 4
mov eax, ebx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
test eax, eax
je 0x513a63
cmp eax, 0xffffffff
je 0x5139b3
mov eax, dword [ebp + 0xc]
mov ecx, edi
lock xadd dword [eax], ecx
dec ecx
setne al
test al, al
jne 0x5139b3
push 4
push 2
push dword [ebp + 0xc]
call fcn.00425140
add esp, 0xc
jmp 0x5139b3