Function at 0x40cd35
Capabilities:
Accept command line arguments
Check if file exists
Create thread
Get common file path
Query or enumerate registry value
Resume thread

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x1d88
call fcn.0041b1d0
and dword [ebp - 0x18], 0
push ebx
push esi
push edi
mov esi, ecx
call section..text
mov dword [esi + 0x10], eax
call dword [sym.imp.KERNEL32.dll_GetCommandLineW]
test eax, eax
mov dword [ebp - 0x14], eax
mov ebx, 0x81
je 0x40cec5
and word [ebp - 0x320], 0
mov ecx, ebx
xor eax, eax
lea edi, [ebp - 0x31e]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea eax, [ebp - 0x320]
push 0x103
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea eax, [ebp - 0x320]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFindFileNameW]
and word [ebp - 0x98], 0
push 0x1f
mov dword [ebp - 8], eax
pop ecx
xor eax, eax
lea edi, [ebp - 0x96]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
mov edi, dword [ebp - 0x14]
lea eax, [ebp - 0x98]
push 0x3f
push eax
push 0x423dd0
push edi
call fcn.004029e2
add esp, 0x10
test eax, eax
je 0x40cde2
cmp word [ebp - 0x98], 0
jne 0x40ce03
lea eax, [ebp - 0x98]
push 0x3f
push eax
mov ecx, esi
push dword [ebp - 8]
call fcn.0040e749
test eax, eax
je 0x40ce22
cmp word [ebp - 0x98], 0
je 0x40ce22
lea eax, [ebp - 0x98]
push eax
call dword [sym.imp.MSVCRT.dll_wcslen]
pop ecx
push eax
lea eax, [ebp - 0x98]
push eax
lea ecx, [esi + 0x30]
call dword [sym.imp.MSVCP60.dll_public:_class_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int______thiscall_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int__::assign_unsigned_short_int_const___unsigned_int_]
and dword [ebp - 4], 0
lea eax, [ebp - 4]
push eax
push 0x423dc4
push edi
call fcn.00402a90
add esp, 0xc
test eax, eax
jne 0x40ce50
lea eax, [ebp - 4]
mov ecx, esi
push eax
push 1
push dword [ebp - 8]
call fcn.0040e8a0
test eax, eax
je 0x40ce5b
xor eax, eax
cmp dword [ebp - 4], eax
setne al
mov dword [esi + 0x20], eax
lea eax, [ebp - 4]
push eax
push 0x423db8
push edi
call fcn.00402a90
add esp, 0xc
test eax, eax
jne 0x40ce85
lea eax, [ebp - 4]
mov ecx, esi
push eax
push 2
push dword [ebp - 8]
call fcn.0040e8a0
test eax, eax
je 0x40ce90
xor eax, eax
cmp dword [ebp - 4], eax
setne al
mov dword [esi + 0x24], eax
lea eax, [ebp - 4]
push eax
push 0x423dac
push edi
call fcn.00402a90
add esp, 0xc
test eax, eax
jne 0x40ceba
lea eax, [ebp - 4]
mov ecx, esi
push eax
push 3
push dword [ebp - 8]
call fcn.0040e8a0
test eax, eax
je 0x40cec5
xor eax, eax
cmp dword [ebp - 4], eax
setne al
mov dword [esi + 0x28], eax
and word [ebp - 0x118], 0
push 0x1f
pop ecx
xor eax, eax
lea edi, [ebp - 0x116]
and word [ebp - 0x1568], 0
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
mov ecx, ebx
xor eax, eax
lea edi, [ebp - 0x1566]
push 0x103
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea eax, [ebp - 0x1568]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea eax, [ebp - 0x118]
push 0x40
push eax
lea eax, [ebp - 0x1568]
push eax
call fcn.00401120
add esp, 0xc
test eax, eax
je 0x40d4c8
lea eax, [ebp - 0x118]
lea edi, [esi + 0x40]
push eax
call dword [sym.imp.MSVCRT.dll_wcslen]
pop ecx
push eax
lea eax, [ebp - 0x118]
push eax
mov ecx, edi
call dword [sym.imp.MSVCP60.dll_public:_class_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int______thiscall_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int__::assign_unsigned_short_int_const___unsigned_int_]
xor edx, edx
mov ecx, ebx
xor eax, eax
lea edi, [ebp - 0x1b7e]
mov word [ebp - 0x1b80], dx
push edx
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea eax, [ebp - 0x1b80]
push 2
push eax
push edx
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
test eax, eax
je 0x40d4c8
and word [ebp - 0x938], 0
mov ecx, ebx
xor eax, eax
lea edi, [ebp - 0x936]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea eax, [ebp - 0x1b80]
push 0x423d94
push eax
lea eax, [ebp - 0x938]
push eax
call dword [sym.imp.SHLWAPI.dll_PathCombineW]
lea eax, [ebp - 0x938]
push eax
call dword [sym.imp.MSVCRT.dll_wcslen]
pop ecx
push eax
lea eax, [ebp - 0x938]
push eax
lea ecx, [esi + 0xe0]
call dword [sym.imp.MSVCP60.dll_public:_class_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int______thiscall_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int__::assign_unsigned_short_int_const___unsigned_int_]
xor edx, edx
mov ecx, ebx
xor eax, eax
lea edi, [ebp - 0x176e]
mov word [ebp - 0x1770], dx
push edx
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea eax, [ebp - 0x1770]
push 0x17
push eax
push edx
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
test eax, eax
je 0x40d4c8
and word [ebp - 0x730], 0
mov ecx, ebx
xor eax, eax
lea edi, [ebp - 0x72e]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea eax, [ebp - 0x1770]
push 0x423d94
push eax
lea eax, [ebp - 0x730]
push eax
call dword [sym.imp.SHLWAPI.dll_PathCombineW]
lea eax, [ebp - 0x730]
push eax
call dword [sym.imp.MSVCRT.dll_wcslen]
pop ecx
push eax
lea eax, [ebp - 0x730]
push eax
lea ecx, [esi + 0x110]
call dword [sym.imp.MSVCP60.dll_public:_class_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int______thiscall_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int__::assign_unsigned_short_int_const___unsigned_int_]
xor edx, edx
mov ecx, ebx
xor eax, eax
lea edi, [ebp - 0xb3e]
mov word [ebp - 0xb40], dx
push edx
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea eax, [ebp - 0xb40]
push 0xb
push eax
push edx
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
test eax, eax
je 0x40d4c8
lea eax, [ebp - 0xb40]
push eax
call dword [sym.imp.MSVCRT.dll_wcslen]
pop ecx
push eax
lea eax, [ebp - 0xb40]
push eax
lea ecx, [esi + 0xf0]
call dword [sym.imp.MSVCP60.dll_public:_class_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int______thiscall_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int__::assign_unsigned_short_int_const___unsigned_int_]
xor edx, edx
mov ecx, ebx
xor eax, eax
lea edi, [ebp - 0x135e]
mov word [ebp - 0x1360], dx
push edx
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea eax, [ebp - 0x1360]
push 0x16
push eax
push edx
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
test eax, eax
je 0x40d4c8
lea eax, [ebp - 0x1360]
push eax
call dword [sym.imp.MSVCRT.dll_wcslen]
pop ecx
push eax
lea eax, [ebp - 0x1360]
push eax
lea ecx, [esi + 0x120]
call dword [sym.imp.MSVCP60.dll_public:_class_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int______thiscall_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int__::assign_unsigned_short_int_const___unsigned_int_]
xor edx, edx
mov ecx, ebx
xor eax, eax
lea edi, [ebp - 0x1156]
mov word [ebp - 0x1158], dx
push edx
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea eax, [ebp - 0x1158]
push 0x10
push eax
push edx
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
test eax, eax
je 0x40d4c8
lea eax, [ebp - 0x1158]
push eax
call dword [sym.imp.MSVCRT.dll_wcslen]
pop ecx
push eax
lea eax, [ebp - 0x1158]
push eax
lea ecx, [esi + 0x100]
call dword [sym.imp.MSVCP60.dll_public:_class_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int______thiscall_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int__::assign_unsigned_short_int_const___unsigned_int_]
xor edx, edx
mov ecx, ebx
xor eax, eax
lea edi, [ebp - 0xd46]
mov word [ebp - 0xd48], dx
push edx
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea eax, [ebp - 0xd48]
push 0x19
push eax
push edx
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
test eax, eax
je 0x40d4c8
lea eax, [ebp - 0xd48]
push eax
call dword [sym.imp.MSVCRT.dll_wcslen]
pop ecx
push eax
lea eax, [ebp - 0xd48]
push eax
lea ecx, [esi + 0x130]
call dword [sym.imp.MSVCP60.dll_public:_class_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int______thiscall_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int__::assign_unsigned_short_int_const___unsigned_int_]
xor edx, edx
mov ecx, ebx
xor eax, eax
lea edi, [ebp - 0x1976]
mov word [ebp - 0x1978], dx
push edx
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea eax, [ebp - 0x1978]
push 0x1a
push eax
push edx
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
test eax, eax
je 0x40d4c8
and word [ebp - 0xf50], 0
mov ecx, ebx
xor eax, eax
lea edi, [ebp - 0xf4e]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea eax, [ebp - 0x1978]
push 0x423d40
push eax
lea eax, [ebp - 0xf50]
push eax
call dword [sym.imp.SHLWAPI.dll_PathCombineW]
lea eax, [ebp - 0xf50]
push eax
call dword [sym.imp.MSVCRT.dll_wcslen]
pop ecx
push eax
lea eax, [ebp - 0xf50]
push eax
lea ecx, [esi + 0xd0]
call dword [sym.imp.MSVCP60.dll_public:_class_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int______thiscall_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int__::assign_unsigned_short_int_const___unsigned_int_]
and word [ebp - 0x528], 0
mov ecx, ebx
xor eax, eax
lea edi, [ebp - 0x526]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea eax, [ebp - 0xc]
mov edi, 0x423cac
push eax
lea eax, [ebp - 0x528]
push eax
lea eax, [ebp - 0x10]
push eax
push 0x423aa4
push edi
push SysReAllocString
mov dword [ebp - 0x10], 1
mov dword [ebp - 0xc], 0x206
call dword [sym.imp.SHLWAPI.dll_SHGetValueW]
test eax, eax
jne 0x40d270
lea eax, [ebp - 0x528]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x40d2ba
cmp dword [esi + 0x10], 8
jge 0x40d2ba
push 0x208
lea eax, [ebp - 0x528]
push 0
push eax
call sub.MSVCRT.dll_memset
add esp, 0xc
lea eax, [ebp - 0xc]
mov dword [ebp - 0x10], 1
mov dword [ebp - 0xc], 0x206
push eax
lea eax, [ebp - 0x528]
push eax
lea eax, [ebp - 0x10]
push eax
push 0x423aa4
push edi
push reloc.OLEAUT32.dll_SysReAllocString
call dword [sym.imp.SHLWAPI.dll_SHGetValueW]
lea eax, [ebp - 0x528]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x40d382
and word [ebp - 0x320], 0
mov ecx, ebx
xor eax, eax
lea edi, [ebp - 0x31e]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea eax, [ebp - 0x528]
push 0x4229d8
push eax
lea eax, [ebp - 0x320]
push eax
call dword [sym.imp.SHLWAPI.dll_PathCombineW]
and word [ebp - 0x98], 0
push 0x1f
pop ecx
xor eax, eax
lea edi, [ebp - 0x96]
push 0x40
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea eax, [ebp - 0x98]
push eax
lea eax, [ebp - 0x320]
push eax
call fcn.00401120
xor edi, edi
add esp, 0xc
cmp word [ebp - 0x98], di
je 0x40d362
mov eax, dword [esi + 0x44]
cmp eax, edi
jne 0x40d344
mov eax, dword [sym.imp.MSVCP60.dll_unsigned_short_int_const__private:_static_unsigned_short_int_const____cdecl_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int__::_Nullstr_void_::_2::_C]
push eax
lea eax, [ebp - 0x98]
push eax
call fcn.00401202
pop ecx
cmp eax, edi
pop ecx
jge 0x40d360
mov dword [esi + 0x14], 1
jmp 0x40d372
jne 0x40d36b
mov dword [esi + 0x14], 2
jmp 0x40d372
mov dword [esi + 0x14], 3
lea eax, [ebp - 0x528]
mov ecx, esi
push eax
call fcn.0040e497
jmp 0x40d3f6
and word [ebp - 0x320], 0
mov ecx, ebx
xor eax, eax
lea edi, [ebp - 0x31e]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea eax, [ebp - 0x14]
mov dword [ebp - 8], 1
push eax
lea eax, [ebp - 0x320]
push eax
lea eax, [ebp - 8]
push eax
push 0x423c90
push 0x422bc0
push SysReAllocString
mov dword [ebp - 0x14], 0x206
call dword [sym.imp.SHLWAPI.dll_SHGetValueW]
test eax, eax
jne 0x40d3f4
lea eax, [ebp - 0x320]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x40d3f4
lea eax, [ebp - 0x320]
mov ecx, esi
push eax
mov dword [esi + 0x14], 4
call fcn.0040e497
xor edi, edi
cmp dword [esi + 0x78], edi
jne 0x40d46f
mov dword [esi + 0x14], edi
mov word [ebp - 0x320], di
mov ecx, ebx
xor eax, eax
lea edi, [ebp - 0x31e]
cmp dword [esi + 0x10], 8
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
push 0
jge 0x40d41f
push 0x26
jmp 0x40d421
push 0x1a
lea eax, [ebp - 0x320]
push eax
push 0
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
and word [ebp - 0x1d88], 0
mov ecx, ebx
xor eax, eax
lea edi, [ebp - 0x1d86]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea eax, [ebp - 0x320]
push 0x423c6c
push eax
lea eax, [ebp - 0x1d88]
push eax
call dword [sym.imp.SHLWAPI.dll_PathCombineW]
lea eax, [ebp - 0x1d88]
mov ecx, esi
push eax
call fcn.0040e497
xor edi, edi
lea eax, [esi + 4]
push eax
push 4
push esi
push 0x40d4d0
push edi
push edi
call dword [sym.imp.KERNEL32.dll_CreateThread]
cmp eax, edi
mov dword [ebp - 8], eax
je 0x40d4c8
push edi
push edi
push edi
push edi
call dword [sym.imp.KERNEL32.dll_CreateEventW]
push dword [ebp - 8]
mov dword [esi + 0xc], eax
call dword [sym.imp.KERNEL32.dll_ResumeThread]
push 0x3e8
push dword [esi + 0xc]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push dword [esi + 0xc]
mov ebx, dword [sym.imp.KERNEL32.dll_CloseHandle]
call ebx
push dword [ebp - 8]
mov dword [esi + 0xc], edi
call ebx
mov dword [ebp - 0x18], 1
mov eax, dword [ebp - 0x18]
pop edi
pop esi
pop ebx
leave
ret