Function at 0x10022a43
Capabilities:
Check if file exists
Create directory
Query environment variable

Disassembly:
push ebp
sub esp, 0x514
lea ebp, [esp - 4]
mov eax, dword [0x10095428]
xor eax, ebp
mov dword [ebp + 0x514], eax
push 0x14
mov eax, 0x10073dc8
call fcn.1005886f
mov eax, dword [0x1009a0f4]
mov esi, ecx
mov edi, 0x1009a0f4
mov ecx, edi
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x14], eax
xor ecx, ecx
mov dword [ebp - 4], ecx
mov eax, dword [esi + 0x40]
cmp eax, ecx
mov dword [ebp - 0x10], ecx
je 0x10022bd1
mov dword [ebp - 0x18], ecx
mov ebx, 0x1007c320
push ebx
lea edx, [ebp - 0x18]
push edx
push str.ServiceExeName
mov byte [ebp - 4], 1
mov ecx, dword [eax]
push eax
call dword [ecx + 0x14]
and dword [ebp - 0x1c], 0
push ebx
lea edx, [ebp - 0x1c]
push edx
mov byte [ebp - 4], 2
mov eax, dword [esi + 0x40]
mov ecx, dword [eax]
push str.ServiceExeDir
push eax
call dword [ecx + 0x14]
lea eax, [ebp - 0x1c]
push eax
call fcn.10023a98
test al, al
je 0x10022bb6
lea eax, [ebp - 0x18]
push eax
call fcn.10023a98
test al, al
je 0x10022bb6
mov eax, dword [0x1009a0f4]
mov ecx, edi
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x20], eax
xor ebx, ebx
push 0x410
lea eax, [ebp + 2]
push ebx
mov byte [ebp - 4], 3
push eax
mov word [ebp], bx
call fcn.10051de0
add esp, 0xc
push 0x208
lea eax, [ebp]
push eax
push dword [ebp - 0x1c]
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
mov edi, dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
lea eax, [ebp]
push eax
call edi
test eax, eax
jne 0x10022b44
push ebx
lea eax, [ebp]
push eax
push ebx
call dword [sym.imp.SHELL32.dll_SHCreateDirectoryExW]
lea eax, [ebp]
push eax
call edi
test eax, eax
je 0x10022ba9
lea eax, [ebp]
push eax
lea eax, [ebp - 0x10]
push eax
call fcn.10002d85
lea eax, [ebp - 0x10]
lea edi, [ebp - 0x14]
mov byte [ebp - 4], 4
call fcn.10002dcc
mov byte [ebp - 4], 3
mov eax, dword [ebp - 0x10]
add eax, 0xfffffff0
call fcn.100033b2
push dword [ebp - 0x18]
mov eax, edi
call fcn.10023503
push dword [ebp - 0x18]
lea eax, [esi + 0x44]
push eax
call fcn.10002fe5
lea edi, [esi + 0x48]
lea eax, [ebp - 0x14]
call fcn.10002dcc
lea eax, [ebp - 0x14]
call fcn.1001604f
mov dword [ebp - 0x10], 1
mov eax, dword [ebp - 0x20]
add eax, 0xfffffff0
call fcn.100033b2
jmp 0x10022bb8
xor ebx, ebx
push dword [ebp - 0x1c]
mov edi, dword [sym.imp.OLEAUT32.dll_SysStringLen]
call edi
mov byte [ebp - 4], 0
push dword [ebp - 0x18]
call edi
cmp dword [ebp - 0x10], ebx
jne 0x10022c3d
lea ecx, [ebp - 0x20]
call fcn.10008fd8
mov byte [ebp - 4], 5
push dword [eax]
lea eax, [ebp - 0x10]
push eax
call fcn.10002d85
lea eax, [ebp - 0x10]
lea edi, [ebp - 0x14]
mov byte [ebp - 4], 6
call fcn.10002dcc
mov eax, dword [ebp - 0x10]
add eax, 0xfffffff0
call fcn.100033b2
mov byte [ebp - 4], 0
mov eax, dword [ebp - 0x20]
add eax, 0xfffffff0
call fcn.100033b2
mov ebx, str.TxdlCom.exe
push ebx
mov eax, edi
call fcn.10023503
lea edi, [esi + 0x48]
lea eax, [ebp - 0x14]
call fcn.10002dcc
push ebx
lea eax, [esi + 0x44]
push eax
call fcn.10002fe5
lea eax, [ebp - 0x14]
call fcn.1001604f
xor ebx, ebx
mov esi, dword [esi + 0x48]
push 0x70
mov ecx, esi
call fcn.10024f00
test eax, eax
pop ecx
jne 0x10022c7e
mov eax, dword [ebp - 0x14]
add eax, 0xfffffff0
call fcn.100033b2
mov eax, ebx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp + 0x514]
xor ecx, ebp
call fcn.10051861
add ebp, 0x518
leave
ret
push 0xfe
lea eax, [ebp + 0x416]
push ebx
push eax
mov word [ebp + 0x414], bx
call fcn.10051de0
add esp, 0xc
push 0x80
lea eax, [ebp + 0x414]
push eax
push 0x100821e8
call dword [sym.imp.ole32.dll_StringFromGUID2]
lea eax, [ebp - 0x10]
push eax
push 0x2001f
push ebx
push 0x1007bd84
push SysReAllocString
xor esi, esi
mov dword [ebp - 0x10], ebx
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
cmp eax, ebx
jne 0x10022d39
mov eax, dword [ebp - 0x10]
lea ecx, [ebp + 0x414]
push ecx
mov dword [ebp - 0x18], eax
push eax
lea eax, [ebp - 0x18]
call fcn.10008c7d
test eax, eax
mov edi, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
jne 0x10022d2f
push str.LocalServer32
push dword [ebp - 0x18]
lea eax, [ebp - 0x1c]
mov dword [ebp - 0x1c], ebx
call fcn.10008c7d
mov esi, eax
cmp esi, ebx
jne 0x10022d1c
push dword [ebp - 0x14]
lea eax, [ebp - 0x1c]
push ebx
push eax
call fcn.100130e8
mov esi, eax
cmp dword [ebp - 0x1c], ebx
je 0x10022d26
push dword [ebp - 0x1c]
call edi
xor eax, eax
cmp esi, ebx
sete al
mov esi, eax
cmp dword [ebp - 0x18], ebx
je 0x10022d39
push dword [ebp - 0x18]
call edi
mov ebx, esi
jmp 0x10022c4e