Function at 0x40b680
Capabilities:
Create directory
Delete file
Get common file path
Print debug messages
Query or enumerate registry value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x214
mov eax, dword [0x41e138]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
push esi
push 0x104
mov edi, ecx
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
mov ebx, dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x40b7ae
lea eax, [ebp - 0x210]
push eax
mov ecx, edi
mov dword [ebp - 0x214], 0x104
call fcn.0040b630
mov eax, dword [ebp - 0x210]
test eax, eax
je 0x40b7ae
lea ecx, [ebp - 0x214]
push ecx
push esi
push 0
push 0
push 0x4173c8
push eax
call ebx
test eax, eax
jne 0x40b728
push 0x5c
push esi
call fcn.0040d643
add esp, 8
test eax, eax
jne 0x40b715
push 0x4173c4
push 0x104
push esi
call fcn.0040dd45
add esp, 0xc
push str.Temp
push 0x104
push esi
call fcn.0040dd45
add esp, 0xc
mov edx, dword [ebp - 0x210]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push 0
push esi
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
test eax, eax
jne 0x40b79b
push 0x104
push eax
lea eax, [ebp - 0x20c]
push eax
call fcn.0040ddd0
push str.Error_Creating_Temp_Folder__
lea ecx, [ebp - 0x20c]
push 0x104
push ecx
call fcn.0040dce2
push esi
lea edx, [ebp - 0x20c]
push 0x104
push edx
call fcn.0040dd45
add esp, 0x24
lea eax, [ebp - 0x20c]
push eax
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
push 0x104
push 0
push esi
call fcn.0040ddd0
jmp 0x40b7ab
push 0x4173c4
push 0x104
push esi
call fcn.0040dd45
add esp, 0xc
push 0x104
lea ecx, [ebp - 0x20c]
push ecx
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
push 0x4173c4
lea edx, [ebp - 0x20c]
push 0x104
push edx
call fcn.0040dd45
lea eax, [ebp - 0x20c]
push esi
push eax
call fcn.0040dc57
add esp, 0x14
test eax, eax
jne 0x40b8e7
lea ecx, [ebp - 0x210]
push ecx
mov ecx, edi
mov dword [ebp - 0x214], 0x104
call fcn.0040b630
mov eax, dword [ebp - 0x210]
test eax, eax
je 0x40b8e7
lea edx, [ebp - 0x214]
push edx
push esi
push 0
push 0
push 0x4173c8
push eax
call ebx
test eax, eax
jne 0x40b861
push 0x5c
push esi
call fcn.0040d643
add esp, 8
test eax, eax
jne 0x40b84e
push 0x4173c4
push 0x104
push esi
call fcn.0040dd45
add esp, 0xc
push str.Temp
push 0x104
push esi
call fcn.0040dd45
add esp, 0xc
mov eax, dword [ebp - 0x210]
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push 0
push esi
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
test eax, eax
jne 0x40b8d4
push 0x104
push eax
lea ecx, [ebp - 0x20c]
push ecx
call fcn.0040ddd0
push str.Error_Creating_Temp_Folder__
lea edx, [ebp - 0x20c]
push 0x104
push edx
call fcn.0040dce2
push esi
lea eax, [ebp - 0x20c]
push 0x104
push eax
call fcn.0040dd45
add esp, 0x24
lea ecx, [ebp - 0x20c]
push ecx
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
push 0x104
push 0
push esi
call fcn.0040ddd0
jmp 0x40b8e4
push 0x4173c4
push 0x104
push esi
call fcn.0040dd45
add esp, 0xc
push 0x104
lea edx, [ebp - 0x20c]
push 0
push edx
call fcn.0040ddd0
push str.Using_Temp_Folder__
lea eax, [ebp - 0x20c]
push 0x104
push eax
call fcn.0040dce2
push esi
lea ecx, [ebp - 0x20c]
push 0x104
push ecx
call fcn.0040dd45
mov edi, dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
add esp, 0x24
lea edx, [ebp - 0x20c]
push edx
call edi
lea eax, [ebp - 0x20c]
push eax
push 0
push 0x417348
push esi
call dword [sym.imp.KERNEL32.dll_GetTempFileNameW]
test eax, eax
jne 0x40b95b
push str.Error_creating_temp_file
call edi
push 0xffffffffffffffff
call fcn.0040da65
lea ecx, [ebp - 0x20c]
push ecx
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
push 0
lea edx, [ebp - 0x20c]
push edx
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
test eax, eax
jne 0x40b989
push str.Error_creating_temp_folder
call edi
push 0xffffffffffffffff
call fcn.0040da65
push 0x4173c4
lea eax, [ebp - 0x20c]
push 0x104
push eax
call fcn.0040dd45
lea ecx, [ebp - 0x20c]
push ecx
push 0x104
push esi
call fcn.0040dce2
mov ecx, dword [ebp - 4]
add esp, 0x18
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0040ddba
mov esp, ebp
pop ebp
ret 4