Function at 0x401470
Capabilities:
Check if file exists
Check mutex on windows
Copy file
Create directory
Get common file path
Get program files directory
Print debug messages

Disassembly:
sub esp, 0x618
push ebx
push ebp
push esi
push edi
xor ebx, ebx
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x421]
mov byte [esp + 0x420], bl
mov esi, dword [sym.imp.SHLWAPI.dll_wnsprintfA]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
push str.SogouDownLoad
push str.__s_Update_Service_start_register.
lea eax, [esp + 0x428]
push 0x104
push eax
call esi
add esp, 0x10
lea ecx, [esp + 0x420]
push ecx
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x219]
mov byte [esp + 0x218], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x115]
mov byte [esp + 0x114], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x31d]
mov byte [esp + 0x31c], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
push str.Mutex_4A79E46E_5A01_4abb_BCC1_F96D06AEE085
push 1
push ebx
stosb byte es:[edi], al
call dword [sym.imp.KERNEL32.dll_CreateMutexA]
mov ebp, eax
cmp ebp, ebx
jne 0x40156d
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x11]
mov byte [esp + 0x10], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
push str.SogouDownLoad
push str.__s_Update_Service_register_fail_1.
lea edx, [esp + 0x18]
push 0x104
push edx
stosb byte es:[edi], al
call esi
add esp, 0x10
lea eax, [esp + 0x10]
push eax
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x618
ret
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x4015c9
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x11]
mov byte [esp + 0x10], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
push str.SogouDownLoad
push str.__s_Update_Service_register_fail_2.
lea ecx, [esp + 0x18]
push 0x104
push ecx
stosb byte es:[edi], al
call esi
add esp, 0x10
lea edx, [esp + 0x10]
push edx
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x618
ret
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebx
lea eax, [esp + 0x118]
push 0x26
push eax
push ebx
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathA]
mov edi, dword [sym.imp.SHLWAPI.dll_PathAppendA]
lea ecx, [esp + 0x114]
push str.SogouDownLoadupdate
push ecx
call edi
mov ebp, dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
lea edx, [esp + 0x114]
push edx
call ebp
test eax, eax
jne 0x40161b
lea eax, [esp + 0x114]
push ebx
push eax
push ebx
call dword [sym.imp.SHELL32.dll_SHCreateDirectoryExA]
lea ecx, [esp + 0x114]
push ecx
call ebp
test eax, eax
jne 0x401681
lea edx, [esp + 0x114]
push ebx
push edx
call fcn.00402de0
add esp, 8
test eax, eax
jne 0x401681
mov ecx, 0x40
lea edi, [esp + 0x11]
mov byte [esp + 0x10], bl
push str.SogouDownLoad
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
push str.__s_Update_Service_register_fail_3.
lea eax, [esp + 0x18]
push 0x104
push eax
call esi
add esp, 0x10
lea ecx, [esp + 0x10]
push ecx
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x618
ret
lea edx, [esp + 0x114]
push str.UpdateService.exe
push edx
call edi
mov edi, dword [sym.imp.KERNEL32.dll_lstrcpynA]
lea eax, [esp + 0x114]
push 0x100
lea ecx, [esp + 0x320]
push eax
push ecx
call edi
lea edx, [esp + 0x31c]
push str..bak
push edx
call dword [sym.imp.KERNEL32.dll_lstrcatA]
lea eax, [esp + 0x218]
push 0x104
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
test eax, eax
je 0x401560
lea ecx, [esp + 0x114]
lea edx, [esp + 0x218]
push ecx
push edx
call sub.MSVCRT.dll__mbsicmp
add esp, 8
test eax, eax
je 0x401773
mov ebp, dword [sym.imp.KERNEL32.dll_CopyFileA]
lea eax, [esp + 0x114]
push ebx
lea ecx, [esp + 0x21c]
push eax
push ecx
call ebp
test eax, eax
jne 0x401762
lea edx, [esp + 0x31c]
push ebx
lea eax, [esp + 0x21c]
push edx
push eax
call ebp
test eax, eax
jne 0x40174a
lea ecx, [esp + 0x218]
push ebx
push ecx
call fcn.00403050
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x618
ret
lea edx, [esp + 0x114]
lea eax, [esp + 0x31c]
push edx
push eax
call fcn.00403050
add esp, 8
lea ecx, [esp + 0x218]
push ebx
push ecx
call fcn.00403050
add esp, 8
lea edx, [esp + 0x114]
push 0x104
lea eax, [esp + 0x320]
push edx
push eax
call edi
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x11]
mov byte [esp + 0x10], bl
rep stosd dword es:[edi], eax
lea ecx, [esp + 0x114]
lea edx, [esp + 0x10]
stosw word es:[edi], ax
push ecx
push str.__s___Service
push 0x104
push edx
stosb byte es:[edi], al
call esi
push ebx
push ebx
push 2
lea eax, [esp + 0x2c]
push 0x10
push eax
push str.SogouDownLoad_Update_Service
push str.UpdateService
call fcn.00401160
add esp, 0x2c
test eax, eax
je 0x401560
push 0x4201f0
push str.UpdateService
call fcn.004011f0
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x52d]
mov byte [esp + 0x52c], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
push str.SogouDownLoad
push 0x4201c8
lea ecx, [esp + 0x534]
push 0x104
push ecx
stosb byte es:[edi], al
call esi
add esp, 0x18
lea edx, [esp + 0x524]
push edx
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x618
ret