Function at 0x4942d0
Capabilities:
Check if file exists
Get file attributes
Query environment variable

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x910
mov eax, dword [0x53ba20]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x14]
push ebx
mov ebx, dword [ebp + 0x10]
push esi
push edi
mov edi, dword [ebp + 8]
mov dword [ebp - 0x8f8], eax
mov dword [ebx], 0
test edi, edi
jne 0x4944cc
test byte [eax + 0xd0], 0x20
je 0x494330
mov edx, dword [0x56786c]
xor eax, eax
test edx, edx
je 0x494330
mov ecx, dword [0x567868]
mov esi, dword [ebp + 0xc]
add ecx, 0x24
cmp dword [ecx], esi
je 0x494343
inc eax
add ecx, 0x2c
cmp eax, edx
jb 0x494324
pop edi
pop esi
xor al, al
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004c3287
mov esp, ebp
pop ebp
ret
mov ecx, dword [0x567868]
xor edi, edi
imul eax, eax, 0x2c
push 5
push dword [eax + ecx]
push dword [0x556ab8]
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov dword [ebp - 0x8f0], eax
test eax, eax
je 0x4944b0
mov esi, dword [sym.imp.ADVAPI32.dll_QueryServiceConfigW]
lea ecx, [ebp - 0x8f4]
push ecx
push edi
push edi
push eax
call esi
push dword [ebp - 0x8f4]
call fcn.004c8c9a
add esp, 4
mov edi, eax
lea eax, [ebp - 0x8f4]
push eax
push dword [ebp - 0x8f4]
push edi
push dword [ebp - 0x8f0]
call esi
push dword [ebp - 0x8f0]
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
test edi, edi
je 0x4944b0
mov eax, dword [edi + 0xc]
test eax, eax
je 0x4944b0
mov esi, dword [ebp - 0x8f8]
cmp dword [esi + 0x33c], 0
jne 0x4943e2
push eax
call fcn.004c8c20
add esp, 4
mov dword [esi + 0x33c], eax
push 0x4fc5a0
push dword [edi + 0xc]
call fcn.004c5729
add esp, 8
test eax, eax
je 0x494403
cmp word [eax + 8], 0
je 0x494403
xor ecx, ecx
mov word [eax + 8], cx
mov ecx, dword [edi + 0xc]
cmp word [ecx], 0x22
jne 0x494412
add ecx, 2
mov dword [edi + 0xc], ecx
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x494415
sub ecx, edx
sar ecx, 1
lea esi, [ecx + 5]
lea eax, [esi + esi]
push eax
call fcn.004c8c9a
mov dword [ebx], eax
push dword [edi + 0xc]
push esi
push eax
call fcn.004c905a
push edi
call fcn.004c8c7f
mov edi, dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
add esp, 0x14
push dword [ebx]
call edi
cmp eax, 0xffffffff
jne 0x4946ad
mov eax, dword [ebx]
cmp word [eax], 0x22
je 0x494480
push 0x20
push eax
call fcn.004c55d8
add esp, 8
test eax, eax
je 0x494480
push 0x20
push dword [ebx]
call fcn.004c55d8
add esp, 8
xor ecx, ecx
mov word [eax], cx
push dword [ebx]
call edi
cmp eax, 0xffffffff
jne 0x4946ad
push 0x4fc5a0
push esi
push dword [ebx]
call fcn.004d6277
add esp, 0xc
mov al, 1
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004c3287
mov esp, ebp
pop ebp
ret
push edi
call fcn.004c8c7f
add esp, 4
xor al, al
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004c3287
mov esp, ebp
pop ebp
ret
lea eax, [ebp - 0x8f4]
push eax
push 0x18
lea eax, [ebp - 0x910]
push eax
push 0
push edi
call sub.ntdll.dll_NtQueryInformationProcess
test eax, eax
jne 0x494592
mov eax, dword [ebp - 0x90c]
test eax, eax
je 0x494592
mov esi, dword [sym.imp.KERNEL32.dll_ReadProcessMemory]
lea ecx, [ebp - 0x8f0]
push ecx
push 0x438
lea ecx, [ebp - 0x8ec]
push ecx
push eax
push edi
call esi
test eax, eax
je 0x494592
lea eax, [ebp - 0x8f0]
push eax
push 0x2a8
lea eax, [ebp - 0x4b4]
push eax
push dword [ebp - 0x8dc]
push edi
call esi
test eax, eax
je 0x494592
cmp dword [ebp - 0x478], 0
je 0x494592
movzx eax, word [ebp - 0x47c]
mov dword [ebp - 0x8f8], eax
movzx eax, ax
add eax, 2
push eax
call fcn.004c8c9a
add esp, 4
mov esi, eax
lea eax, [ebp - 0x8f0]
push eax
movzx eax, word [ebp - 0x47c]
push eax
push esi
push dword [ebp - 0x478]
push edi
call dword [sym.imp.KERNEL32.dll_ReadProcessMemory]
test eax, eax
jne 0x494645
push 2
push esi
call fcn.004c3279
add esp, 8
push 2
lea eax, [ebp - 0x8f8]
push eax
push 0
push edi
call sub.KERNEL32.dll_K32GetModuleFileNameExW
mov esi, eax
test esi, esi
je 0x494330
lea ecx, [esi*2 + 2]
push ecx
call fcn.004c8c9a
add esp, 4
mov dword [ebx], eax
push esi
push eax
push 0
push edi
call sub.KERNEL32.dll_K32GetModuleFileNameExW
test eax, eax
je 0x494330
push 0xc
push 0x50f604
push dword [ebx]
call fcn.004c94d0
mov ecx, dword [ebx]
add esp, 0xc
test eax, eax
jne 0x49466e
lea eax, [ecx + 0x18]
push eax
lea eax, [ebp - 0x20c]
push 0x5131c8
push eax
call fcn.0042fa90
mov edi, dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
lea eax, [ebp - 0x20c]
add esp, 0xc
push 0
push 0
push eax
call edi
mov esi, eax
lea ecx, [esi + esi]
push ecx
call fcn.004c8c9a
add esp, 4
mov dword [ebx], eax
push esi
push eax
lea eax, [ebp - 0x20c]
push eax
call edi
pop edi
pop esi
mov al, 1
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004c3287
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0x8f8]
xor ecx, ecx
movzx eax, ax
shr eax, 1
push esi
mov word [esi + eax*2], cx
call fcn.004c8c20
push 2
push esi
mov dword [ebx], eax
call fcn.004c3279
add esp, 0xc
jmp 0x4945d1
push 4
push 0x4fc4f4
push ecx
call fcn.004c928a
add esp, 0xc
test eax, eax
jne 0x4946ad
mov edx, dword [ebx]
mov ecx, edx
lea esi, [ecx + 2]
nop dword [eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x494690
sub ecx, esi
lea eax, [edx + 8]
push eax
sar ecx, 1
push ecx
push edx
call fcn.004c905a
add esp, 0xc
mov ecx, dword [ebp - 4]
mov al, 1
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004c3287
mov esp, ebp
pop ebp
ret