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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x910
mov eax, dword [0x535a40]
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 0x4946fc
test byte [eax + 0xd0], 0x20
je 0x494560
mov edx, dword [0x561854]
xor eax, eax
test edx, edx
je 0x494560
mov ecx, dword [0x561850]
mov esi, dword [ebp + 0xc]
add ecx, 0x24
cmp dword [ecx], esi
je 0x494573
inc eax
add ecx, 0x2c
cmp eax, edx
jb 0x494554
pop edi
pop esi
xor al, al
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004c34b7
mov esp, ebp
pop ebp
ret
mov ecx, dword [0x561850]
xor edi, edi
imul eax, eax, 0x2c
push 5
push dword [eax + ecx]
push dword [0x550aa0]
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov dword [ebp - 0x8f0], eax
test eax, eax
je 0x4946e0
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.004c8d7a
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 0x4946e0
mov eax, dword [edi + 0xc]
test eax, eax
je 0x4946e0
mov esi, dword [ebp - 0x8f8]
cmp dword [esi + 0x33c], 0
jne 0x494612
push eax
call fcn.004c8d00
add esp, 4
mov dword [esi + 0x33c], eax
push 0x4fa5a0
push dword [edi + 0xc]
call fcn.004c580a
add esp, 8
test eax, eax
je 0x494633
cmp word [eax + 8], 0
je 0x494633
xor ecx, ecx
mov word [eax + 8], cx
mov ecx, dword [edi + 0xc]
cmp word [ecx], 0x22
jne 0x494642
add ecx, 2
mov dword [edi + 0xc], ecx
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x494645
sub ecx, edx
sar ecx, 1
lea esi, [ecx + 5]
lea eax, [esi + esi]
push eax
call fcn.004c8d7a
mov dword [ebx], eax
push dword [edi + 0xc]
push esi
push eax
call fcn.004c913a
push edi
call fcn.004c8d5f
mov edi, dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
add esp, 0x14
push dword [ebx]
call edi
cmp eax, 0xffffffff
jne 0x4948dd
mov eax, dword [ebx]
cmp word [eax], 0x22
je 0x4946b0
push 0x20
push eax
call fcn.004c56b8
add esp, 8
test eax, eax
je 0x4946b0
push 0x20
push dword [ebx]
call fcn.004c56b8
add esp, 8
xor ecx, ecx
mov word [eax], cx
push dword [ebx]
call edi
cmp eax, 0xffffffff
jne 0x4948dd
push 0x4fa5a0
push esi
push dword [ebx]
call fcn.004d6355
add esp, 0xc
mov al, 1
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004c34b7
mov esp, ebp
pop ebp
ret
push edi
call fcn.004c8d5f
add esp, 4
xor al, al
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004c34b7
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 0x4947c2
mov eax, dword [ebp - 0x90c]
test eax, eax
je 0x4947c2
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 0x4947c2
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 0x4947c2
cmp dword [ebp - 0x478], 0
je 0x4947c2
movzx eax, word [ebp - 0x47c]
mov dword [ebp - 0x8f8], eax
movzx eax, ax
add eax, 2
push eax
call fcn.004c8d7a
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 0x494875
push 2
push esi
call fcn.004c34a9
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 0x494560
lea ecx, [esi*2 + 2]
push ecx
call fcn.004c8d7a
add esp, 4
mov dword [ebx], eax
push esi
push eax
push 0
push edi
call sub.KERNEL32.dll_K32GetModuleFileNameExW
test eax, eax
je 0x494560
push 0xc
push str.SystemRoot_
push dword [ebx]
call fcn.004c95b0
mov ecx, dword [ebx]
add esp, 0xc
test eax, eax
jne 0x49489e
lea eax, [ecx + 0x18]
push eax
lea eax, [ebp - 0x20c]
push str.__SystemRoot___s
push eax
call fcn.0042fa30
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.004c8d7a
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.004c34b7
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.004c8d00
push 2
push esi
mov dword [ebx], eax
call fcn.004c34a9
add esp, 0xc
jmp 0x494801
push 4
push 0x4fa4f4
push ecx
call fcn.004c936a
add esp, 0xc
test eax, eax
jne 0x4948dd
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 0x4948c0
sub ecx, esi
lea eax, [edx + 8]
push eax
sar ecx, 1
push ecx
push edx
call fcn.004c913a
add esp, 0xc
mov ecx, dword [ebp - 4]
mov al, 1
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004c34b7
mov esp, ebp
pop ebp
ret