Function at 0x40497f
Capabilities:
Create directory
Query environment variable

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x1a74
call fcn.0040e800
push ebx
push esi
push edi
xor esi, esi
inc esi
push esi
push dword [0x41dd8c]
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.00408d8c
add esp, 0x14
test eax, eax
jne 0x4049de
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 0x404a5e
lea eax, [ebp - 0x1270]
push eax
push 0x4017e4
lea esi, [ebp - 4]
mov eax, ebx
call fcn.00408cb0
test eax, eax
pop ecx
pop ecx
je 0x404a5e
lea eax, [ebp - 0x1a70]
mov esi, 0x401628
push eax
mov edx, esi
call fcn.0040779f
lea ecx, [ebp - 0x1270]
lea eax, [ebp - 0x1a70]
call fcn.0040777b
lea eax, [ebp - 0xa70]
push eax
mov edx, esi
call fcn.0040779f
pop ecx
pop ecx
mov ecx, 0x401690
lea eax, [ebp - 0xa70]
call fcn.0040777b
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 0x404ab2
lea eax, [ebp - 0x1270]
push eax
push 0x401754
lea esi, [ebp - 4]
mov eax, ebx
call fcn.00408cb0
mov esi, eax
test esi, esi
pop ecx
pop ecx
je 0x404ab2
mov eax, 0x4016e0
lea edx, [ebp - 0x1270]
call fcn.00407701
test eax, eax
je 0x404b72
and dword [ebp - 4], 0
test esi, esi
je 0x404b76
cmp dword [ebp - 4], 5
jge 0x404b30
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 0x404ae6
xor esi, esi
jmp 0x404b29
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.00408cb0
mov esi, eax
test esi, esi
pop ecx
pop ecx
je 0x404b29
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.00408d8c
add esp, 0x14
mov esi, eax
inc dword [ebp - 4]
test esi, esi
jne 0x404abe
test esi, esi
je 0x404b76
push 1
push 0x4016e0
push 0x401754
lea eax, [ebp - 0x1a70]
push eax
push edi
call fcn.00408d8c
add esp, 0x14
test eax, eax
je 0x404b76
push 1
push 0x4016f8
push 0x40176c
lea eax, [ebp - 0x1a70]
push eax
push edi
call fcn.00408d8c
add esp, 0x14
mov esi, eax
test esi, esi
jne 0x404b7a
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 0x404bf5
test byte [ebp - 0x270], 0x10
je 0x404bf5
lea eax, [ebp - 0x1270]
push eax
mov edx, 0x401890
call fcn.0040779f
mov ecx, dword [0x41dd8c]
lea eax, [ebp - 0x1270]
call fcn.0040777b
mov esi, eax
mov dword [esp], 0x401838
call fcn.00408ce9
test eax, eax
pop ecx
jne 0x404bec
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.0040777b
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 0x404d3e
test byte [ebp - 0x270], 0x10
je 0x404d3e
lea eax, [ebp - 0xa70]
push eax
mov edx, esi
call fcn.0040779f
lea ecx, [ebp - 0x244]
lea eax, [ebp - 0xa70]
call fcn.0040777b
mov ecx, 0x401928
call fcn.0040777b
lea eax, [ebp - 0x1270]
push eax
mov edx, 0x401978
call fcn.0040779f
mov esi, dword [0x41dd8c]
lea eax, [ebp - 0x1270]
push esi
push eax
call fcn.004077b7
lea eax, [ebp - 0x1270]
push esi
push eax
call fcn.004077b7
lea eax, [ebp - 0xa70]
push eax
lea esi, [ebp - 0x1270]
call fcn.00408ce9
add esp, 0x1c
test eax, eax
jne 0x404cb8
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.0040777b
mov ecx, 0x40193c
call fcn.0040777b
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.0040777b
test esi, esi
jne 0x404d1a
cmp edi, 0xb7
jne 0x404d2e
lea eax, [ebp - 0xa70]
push eax
mov esi, 0x401b60
call fcn.00408ce9
pop ecx
mov esi, eax
test esi, esi
jne 0x404d35
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