Function at 0x40fe40
Capabilities:
Get common file path

Disassembly:
push ebp
mov ebp, esp
and esp, 0xffffffc0
push 0xffffffffffffffff
push 0x4b10f0
mov eax, dword fs:[0]
push eax
sub esp, 0xa4
push ebx
push ebp
push esi
push edi
mov eax, dword [0x4ca1d0]
xor eax, esp
push eax
lea eax, [esp + 0xb8]
mov dword fs:[0], eax
mov edi, ecx
mov dword [esp + 0x68], edi
lea eax, [esp + 0x50]
push eax
xor ebp, ebp
push ebp
push ebp
call sub.pdh.dll_PdhOpenQueryW
cmp eax, ebp
jne 0x41028a
mov edx, dword [0x4d3dfc]
mov eax, dword [edx + 0xc]
mov ecx, 0x4d3dfc
mov dword [esp + 0x5c], ebp
mov dword [esp + 0x58], ebp
call eax
add eax, 0x10
mov dword [esp + 0x54], eax
push ebp
push 0x190
lea ecx, [esp + 0x60]
push ecx
push ebp
lea edx, [esp + 0x6c]
push edx
push ebp
push str.PhysicalDisk
push ebp
push ebp
mov dword [esp + 0xe4], ebp
call sub.pdh.dll_PdhEnumObjectItemsW
cmp eax, 0x800007d2
jne 0x4100f4
mov eax, dword [0x4d3dfc]
mov edx, dword [eax + 0xc]
mov ecx, 0x4d3dfc
call edx
lea esi, [eax + 0x10]
mov dword [esp + 0x4c], esi
mov eax, dword [0x4d3dfc]
mov edx, dword [eax + 0xc]
mov ecx, 0x4d3dfc
mov byte [esp + 0xc0], 1
call edx
lea edi, [eax + 0x10]
mov dword [esp + 0x60], edi
mov eax, dword [esi - 8]
mov ecx, 1
sub ecx, dword [esi - 4]
sub eax, 0x104
or eax, ecx
mov ebx, 2
mov byte [esp + 0xc0], bl
jge 0x40ff44
push 0x104
lea ecx, [esp + 0x50]
call fcn.00407c90
mov esi, dword [esp + 0x4c]
push 0x104
push esi
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
mov eax, dword [esi - 8]
push eax
push esi
call fcn.00495a6d
add esp, 8
cmp eax, ebp
jl 0x41015e
cmp eax, dword [esi - 8]
jg 0x41015e
push ebx
xor ecx, ecx
mov dword [esi - 0xc], eax
push ebp
lea edx, [esp + 0x6c]
mov word [esi + eax*2], cx
push edx
lea ecx, [esp + 0x58]
call fcn.00407d30
push eax
lea ecx, [esp + 0x50]
mov byte [esp + 0xc4], 3
call fcn.0040a5d0
mov eax, dword [esp + 0x64]
add eax, 0xfffffff0
mov byte [esp + 0xc0], bl
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40ffc0
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea ecx, [esp + 0x4c]
call fcn.00408370
mov ecx, dword [esp + 0x5c]
lea edx, [ecx + ecx]
push edx
call fcn.00494335
mov esi, eax
mov eax, dword [esp + 0x5c]
lea ecx, [eax + eax]
push ecx
mov dword [esp + 0x6c], esi
call fcn.00494335
add esp, 8
cmp esi, ebp
mov ebp, dword [esp + 0x4c]
mov ebx, eax
je 0x41009b
test ebx, ebx
je 0x410092
push 0
push 0x190
lea edx, [esp + 0x60]
push edx
push ebx
lea eax, [esp + 0x6c]
push eax
push esi
push str.PhysicalDisk
push 0
push 0
call sub.pdh.dll_PdhEnumObjectItemsW
test eax, eax
jne 0x410092
mov esi, ebx
cmp word [ebx], ax
je 0x41008e
mov edi, edi
push esi
lea ecx, [esp + 0x64]
call fcn.0040c540
lea ecx, [esp + 0x60]
call fcn.00408370
mov edi, dword [esp + 0x60]
test ebp, ebp
je 0x41007b
cmp dword [edi - 0xc], 0
jl 0x41007b
push ebp
push edi
call fcn.00494228
add esp, 8
test eax, eax
je 0x41007b
sub eax, edi
sar eax, 1
cmp eax, 0xffffffff
je 0x41007b
push esi
lea ecx, [esp + 0x58]
push str.PhysicalDisk__s____Idle_Time
push ecx
call fcn.004088c0
add esp, 0xc
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
cmp word [esi + eax*2 + 2], 0
lea esi, [esi + eax*2 + 2]
jne 0x410030
mov esi, dword [esp + 0x64]
push esi
call fcn.004943ff
add esp, 4
test ebx, ebx
je 0x4100a8
push ebx
call fcn.004943ff
add esp, 4
lea eax, [edi - 0x10]
mov byte [esp + 0xc0], 1
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x4100cc
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea eax, [ebp - 0x10]
mov byte [esp + 0xc0], 0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4100f0
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov edi, dword [esp + 0x68]
mov ecx, dword [esp + 0x54]
cmp dword [ecx - 0xc], 0
jne 0x41010e
push 0x21
push str.PhysicalDisk__Total___Idle_Time
lea ecx, [esp + 0x5c]
call fcn.00408760
mov eax, dword [esp + 0x50]
lea edx, [esp + 0x6c]
push edx
push 0
push str.Processor__Total___Processor_Time
push eax
call sub.pdh.dll_PdhAddCounterW
mov esi, dword [esp + 0x54]
mov edx, dword [esp + 0x50]
lea ecx, [esp + 0x70]
push ecx
push 0
push esi
push edx
call sub.pdh.dll_PdhAddCounterW
test eax, eax
je 0x410168
lea eax, [esi - 0x10]
mov dword [esp + 0xc0], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jmp 0x41027e
push 0x80070057
call fcn.004010b0
mov ecx, dword [esp + 0x50]
push ecx
call sub.pdh.dll_PdhCollectQueryData
mov edx, dword [edi + 4]
xor esi, esi
test edx, edx
jne 0x410241
mov ebx, dword [sym.imp.KERNEL32.dll_Sleep]
push 0x3e8
call ebx
mov eax, dword [esp + 0x50]
push eax
call sub.pdh.dll_PdhCollectQueryData
test eax, eax
jne 0x410241
mov eax, dword [esp + 0x6c]
lea ecx, [esp + 0x74]
push ecx
lea edx, [esp + 0x6c]
push edx
push 0x200
push eax
call sub.pdh.dll_PdhGetFormattedCounterValue
test eax, eax
jne 0x4101c2
fld qword [esp + 0x7c]
fstp qword [edi + 8]
mov eax, dword [esp + 0x70]
lea ecx, [esp + 0x74]
push ecx
lea edx, [esp + 0x6c]
push edx
push 0x200
push eax
call sub.pdh.dll_PdhGetFormattedCounterValue
test eax, eax
jne 0x4101e6
fld qword [esp + 0x7c]
fstp qword [edi + 0x10]
fld qword [0x4b4020]
fcomp qword [edi + 8]
fnstsw ax
test ah, 0x41
jne 0x410209
fld qword [0x4b4018]
fcomp qword [edi + 0x10]
fnstsw ax
test ah, 5
jp 0x410209
inc esi
jmp 0x41020b
xor esi, esi
mov ecx, dword [edi]
test ecx, ecx
je 0x410236
cmp esi, 3
jle 0x41021d
mov edx, dword [ecx]
mov eax, dword [edx]
push esi
call eax
mov ecx, dword [edi]
fld qword [edi + 0x10]
mov edx, dword [ecx]
mov eax, dword [edx + 4]
sub esp, 0x10
fstp qword [esp + 8]
fld qword [edi + 8]
fstp qword [esp]
call eax
mov ecx, dword [edi + 4]
test ecx, ecx
je 0x410185
mov edx, dword [esp + 0x6c]
push edx
call sub.pdh.dll_PdhRemoveCounter
mov eax, dword [esp + 0x70]
push eax
call sub.pdh.dll_PdhRemoveCounter
mov ecx, dword [esp + 0x50]
push ecx
call sub.pdh.dll_PdhCloseQuery
mov eax, dword [esp + 0x54]
add eax, 0xfffffff0
mov dword [esp + 0xc0], 0xffffffff
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x41028a
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ecx, dword [esp + 0xb8]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret