Function at 0x404860
Capabilities:
Get common file path
Get program files directory
Query or enumerate registry value

Disassembly:
push ebp
lea ebp, [esp - 0x1228]
mov eax, 0x1228
call fcn.0041d6e0
push 0xffffffffffffffff
push 0x421d79
mov eax, dword fs:[0]
push eax
sub esp, 0x18
mov eax, dword [0x435700]
xor eax, ebp
mov dword [ebp + 0x1224], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], esp
mov edi, ecx
xor ebx, ebx
push 0x428ef0
lea ecx, [ebp]
mov dword [ebp - 0x1c], edi
mov dword [ebp - 4], ebx
mov dword [ebp - 0x18], ebx
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::constructor_wchar_t_const__]
lea eax, [ebp - 0x14]
push eax
push str.SOFTWARESweetIMMessenger
mov byte [ebp - 4], 1
push reloc.OLEAUT32.dll_SysReAllocString
mov dword [ebp - 0x14], ebx
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyW]
cmp eax, ebx
jne 0x4049f0
mov esi, dword [ebp - 0x14]
cmp esi, ebx
je 0x4049f0
push 0x1000
lea ecx, [ebp + 0x1c]
push ebx
push ecx
call sub.MSVCR90.dll_memset
add esp, 0xc
lea edx, [ebp - 0x20]
push edx
lea eax, [ebp + 0x1c]
push eax
lea ecx, [ebp - 0x24]
push ecx
push ebx
push str.InstallDir
push esi
mov dword [ebp - 0x20], 0x1000
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
cmp eax, ebx
jne 0x4049de
lea eax, [ebp + 0x1c]
lea edx, [eax + 2]
lea esp, [esp]
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x404930
sub eax, edx
sar eax, 1
cmp word [ebp + eax*2 + 0x1a], 0x5c
jne 0x404993
lea eax, [ebp + 0x1c]
add eax, 0xfffffffe
lea ecx, [ecx]
mov cx, word [eax + 2]
add eax, 2
cmp cx, bx
jne 0x404950
mov edx, dword [str.sweetim.exe]
mov ecx, dword [0x429874]
mov dword [eax], edx
mov edx, dword [0x429878]
mov dword [eax + 4], ecx
mov ecx, dword [0x42987c]
mov dword [eax + 8], edx
mov edx, dword [0x429880]
mov dword [eax + 0xc], ecx
mov ecx, dword [0x429884]
mov dword [eax + 0x10], edx
mov dword [eax + 0x14], ecx
jmp 0x4049bd
lea edi, [ebp + 0x1c]
add edi, 0xfffffffe
lea esp, [esp]
mov ax, word [edi + 2]
add edi, 2
cmp ax, bx
jne 0x4049a0
mov ecx, 6
mov esi, str._sweetim.exe
rep movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
mov edi, dword [ebp - 0x1c]
lea edx, [ebp + 0x1c]
push edx
call sub.mgcommon.dll__IsFileExist_4
cmp eax, ebx
je 0x4049de
lea eax, [ebp + 0x1c]
push eax
lea ecx, [ebp]
call dword [0x4230d4]
mov dword [ebp - 0x18], 1
mov ecx, dword [ebp - 0x14]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov dword [ebp - 0x14], ebx
cmp dword [ebp - 0x18], ebx
jne 0x404a5d
lea edx, [ebp + 0x101c]
push edx
push ebx
push ebx
push 0x26
push ebx
call dword [sym.imp.SHELL32.dll_SHGetFolderPathW]
test eax, eax
jl 0x404a1a
push str.SweetIMMessenger_sweetim.exe
lea eax, [ebp + 0x101c]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAppendW]
jmp 0x404a36
mov ecx, str.C:Program_FilesSweetIMMessenger_sweetim.com
lea edx, [ebp + 0x101c]
movzx eax, word [ecx]
mov word [edx], ax
add ecx, 2
add edx, 2
cmp ax, bx
jne 0x404a25
lea ecx, [ebp + 0x101c]
push ecx
call sub.mgcommon.dll__IsFileExist_4
cmp eax, ebx
je 0x404a58
lea edx, [ebp + 0x101c]
push edx
lea ecx, [ebp]
call dword [0x4230d4]
jmp 0x404a5d
cmp dword [ebp - 0x18], ebx
je 0x404a7f
cmp dword [ebp + 0x18], 8
mov eax, dword [ebp + 4]
mov dword [edi + 0x368], 1
jae 0x404a73
lea eax, [ebp + 4]
lea ecx, [edi + 0x34c]
push eax
call fcn.004051d0
lea ecx, [ebp]
mov byte [ebp - 4], bl
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::destructor_void_]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp + 0x1224]
xor ecx, ebp
call fcn.0041d649
add ebp, 0x1228
mov esp, ebp
pop ebp
ret