Function at 0x404ba2
Capabilities:
Create directory
Query environment variable

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x1a74
call fcn.0040f120
push ebx
push esi
push edi
xor esi, esi
inc esi
push esi
push dword [0x41f0b4]
mov edi, 0x80000001
push 0x401800
push 0x4015d0
push edi
mov dword [ebp - 0x20], 0x401754
mov dword [ebp - 0x1c], 0x40176c
mov dword [ebp - 0x18], 0x401774
mov dword [ebp - 0x14], 0x40178c
mov dword [ebp - 0x10], 0x4017b4
mov dword [ebp - 8], esi
call fcn.0040916a
add esp, 0x14
test eax, eax
jne 0x404c01
and dword [ebp - 8], eax
and dword [ebp - 4], 0
lea eax, [ebp - 4]
push eax
push esi
push 0
push 0x401628
push edi
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
mov ebx, 0x400
jne 0x404c81
lea eax, [ebp - 0x1270]
push eax
push 0x4017e4
lea esi, [ebp - 4]
mov eax, ebx
call fcn.0040908e
test eax, eax
pop ecx
pop ecx
je 0x404c81
lea eax, [ebp - 0x1a70]
mov esi, 0x401628
push eax
mov edx, esi
call fcn.00407a99
lea ecx, [ebp - 0x1270]
lea eax, [ebp - 0x1a70]
call fcn.00407a75
lea eax, [ebp - 0xa70]
push eax
mov edx, esi
call fcn.00407a99
pop ecx
pop ecx
mov ecx, 0x401690
lea eax, [ebp - 0xa70]
call fcn.00407a75
lea eax, [ebp - 4]
push eax
push 1
xor esi, esi
push esi
lea eax, [ebp - 0x1a70]
push eax
push edi
mov dword [ebp - 4], esi
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x404cd5
lea eax, [ebp - 0x1270]
push eax
push 0x401754
lea esi, [ebp - 4]
mov eax, ebx
call fcn.0040908e
mov esi, eax
test esi, esi
pop ecx
pop ecx
je 0x404cd5
mov eax, 0x4016e0
lea edx, [ebp - 0x1270]
call fcn.004079ef
test eax, eax
je 0x404d95
and dword [ebp - 4], 0
test esi, esi
je 0x404d99
cmp dword [ebp - 4], 5
jge 0x404d53
and dword [ebp - 0xc], 0
lea eax, [ebp - 0xc]
push eax
push 1
push 0
lea eax, [ebp - 0x1a70]
push eax
push edi
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
je 0x404d09
xor esi, esi
jmp 0x404d4c
mov eax, dword [ebp - 4]
mov eax, dword [ebp + eax*4 - 0x20]
lea ecx, [ebp - 0x1270]
push ecx
push eax
lea esi, [ebp - 0xc]
mov eax, ebx
call fcn.0040908e
mov esi, eax
test esi, esi
pop ecx
pop ecx
je 0x404d4c
push 1
lea eax, [ebp - 0x1270]
push eax
mov eax, dword [ebp - 4]
push dword [ebp + eax*4 - 0x20]
lea eax, [ebp - 0xa70]
push eax
push edi
call fcn.0040916a
add esp, 0x14
mov esi, eax
inc dword [ebp - 4]
test esi, esi
jne 0x404ce1
test esi, esi
je 0x404d99
push 1
push 0x4016e0
push 0x401754
lea eax, [ebp - 0x1a70]
push eax
push edi
call fcn.0040916a
add esp, 0x14
test eax, eax
je 0x404d99
push 1
push 0x4016f8
push 0x40176c
lea eax, [ebp - 0x1a70]
push eax
push edi
call fcn.0040916a
add esp, 0x14
mov esi, eax
test esi, esi
jne 0x404d9d
and dword [ebp - 8], 0
mov edi, dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
push ebx
lea eax, [ebp - 0xa70]
push eax
push 0x401818
call edi
lea eax, [ebp - 0x270]
push eax
lea eax, [ebp - 0xa70]
push eax
call dword [sym.imp.KERNEL32.dll_FindFirstFileW]
cmp eax, 0xffffffff
mov dword [ebp - 4], eax
je 0x404e18
test byte [ebp - 0x270], 0x10
je 0x404e18
lea eax, [ebp - 0x1270]
push eax
mov edx, 0x401890
call fcn.00407a99
mov ecx, dword [0x41f0b4]
lea eax, [ebp - 0x1270]
call fcn.00407a75
mov esi, eax
mov dword [esp], 0x401838
call fcn.004090c7
test eax, eax
pop ecx
jne 0x404e0f
and dword [ebp - 8], eax
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_FindClose]
push ebx
lea eax, [ebp - 0xa70]
push eax
mov esi, 0x4018e0
push esi
call edi
mov ecx, 0x401df0
lea eax, [ebp - 0xa70]
call fcn.00407a75
lea eax, [ebp - 0x270]
push eax
lea eax, [ebp - 0xa70]
push eax
call dword [sym.imp.KERNEL32.dll_FindFirstFileW]
cmp eax, 0xffffffff
mov dword [ebp - 4], eax
je 0x404f61
test byte [ebp - 0x270], 0x10
je 0x404f61
lea eax, [ebp - 0xa70]
push eax
mov edx, esi
call fcn.00407a99
lea ecx, [ebp - 0x244]
lea eax, [ebp - 0xa70]
call fcn.00407a75
mov ecx, 0x401928
call fcn.00407a75
lea eax, [ebp - 0x1270]
push eax
mov edx, 0x401978
call fcn.00407a99
mov esi, dword [0x41f0b4]
lea eax, [ebp - 0x1270]
push esi
push eax
call fcn.00407ab1
lea eax, [ebp - 0x1270]
push esi
push eax
call fcn.00407ab1
lea eax, [ebp - 0xa70]
push eax
lea esi, [ebp - 0x1270]
call fcn.004090c7
add esp, 0x1c
test eax, eax
jne 0x404edb
and dword [ebp - 8], eax
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_FindClose]
push ebx
lea eax, [ebp - 0xa70]
push eax
push 0x4018e0
call edi
lea ecx, [ebp - 0x244]
lea eax, [ebp - 0xa70]
call fcn.00407a75
mov ecx, 0x40193c
call fcn.00407a75
push 0
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
mov ecx, 0x40195c
lea eax, [ebp - 0xa70]
call fcn.00407a75
test esi, esi
jne 0x404f3d
cmp edi, 0xb7
jne 0x404f51
lea eax, [ebp - 0xa70]
push eax
mov esi, 0x401b60
call fcn.004090c7
pop ecx
mov esi, eax
test esi, esi
jne 0x404f58
and dword [ebp - 8], esi
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 8]
pop edi
pop esi
pop ebx
leave
ret