Function at 0x40163a
Capabilities:
Check if file exists
Check mutex and terminate process on windows
Check mutex on windows
Get common file path
Terminate process

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x374
mov eax, dword [section..data]
xor eax, esp
mov dword [esp + 0x370], eax
push ebx
push esi
push edi
mov esi, 0xff
xor ebx, ebx
push esi
lea eax, [esp + 0x7d]
push ebx
push eax
mov dword [esp + 0x24], edx
mov edi, ecx
mov byte [esp + 0x84], bl
call sub.MSVCR110.dll_memset
add esp, 0xc
lea eax, [esp + 0x179]
push esi
push ebx
push eax
mov byte [esp + 0x184], bl
call sub.MSVCR110.dll_memset
add esp, 0xc
lea eax, [esp + 0x279]
push esi
push ebx
push eax
mov byte [esp + 0x284], bl
call sub.MSVCR110.dll_memset
mov esi, dword [sym.imp.libav.dll_Ordinal_20]
add esp, 0xc
push 0x34
pop eax
mov dword [esp + 0x1c], eax
call esi
cmp eax, 0x4f
jae 0x4016e5
call esi
push eax
push 0x4f
push str.ERROR:_This_tool_requires_libav_with_functionality_level__u_or_higher__current_f_level:__u__n
call dword [sym.imp.MSVCR110.dll___iob_func]
add eax, 0x40
push eax
call dword [sym.imp.MSVCR110.dll_fprintf]
add esp, 0x10
push 0x28
call dword [sym.imp.MSVCR110.dll_exit]
push ebx
call dword [sym.imp.libav.dll_Ordinal_17]
pop ecx
test eax, eax
je 0x40170d
push eax
call dword [sym.imp.libav.dll_Ordinal_27]
pop ecx
push eax
push str._Cant_initialize_libclamav:__s_n
call fcn.004077c7
pop ecx
pop ecx
push 0x28
jmp 0x401e1a
push ebx
push ebx
push 2
xor eax, eax
inc eax
push eax
push dword [esp + 0x28]
push edi
push ebx
call dword [sym.imp.libav.dll_Ordinal_44284]
mov esi, eax
add esp, 0x1c
mov dword [esp + 0x18], esi
test esi, esi
jne 0x40173a
push str._Cant_parse_command_line_options_n
call fcn.004077c7
jmp 0x401705
push str.help
push esi
call dword [sym.imp.libav.dll_Ordinal_44283]
pop ecx
pop ecx
cmp dword [eax + 0x18], ebx
je 0x401761
call fcn.004011b2
push esi
call dword [sym.imp.libav.dll_Ordinal_44285]
pop ecx
xor eax, eax
jmp 0x401e1b
lea eax, [esp + 0x78]
push eax
push ebx
push ebx
push 0x23
push ebx
call dword [sym.imp.SHELL32.dll_SHGetFolderPathA]
mov edi, dword [sym.imp.MSVCR110.dll_strcat_s]
push 0x40c91c
mov esi, 0x100
lea eax, [esp + 0x7c]
push esi
push eax
call edi
add esp, 0xc
call fcn.004010ec
push eax
lea eax, [esp + 0x7c]
push esi
push eax
call edi
add esp, 0xc
lea eax, [esp + 0x78]
push eax
push esi
mov esi, dword [sym.imp.MSVCR110.dll_strcpy_s]
lea eax, [esp + 0x180]
push eax
call esi
add esp, 0xc
lea eax, [esp + 0x178]
push str.PCAProUpdater.conf
push 0x100
push eax
call edi
add esp, 0xc
lea eax, [esp + 0x78]
push eax
lea eax, [esp + 0x27c]
push 0x100
push eax
call esi
add esp, 0xc
lea eax, [esp + 0x278]
push str.RPCAProUpdater.log
push 0x100
push eax
call edi
add esp, 0xc
lea eax, [esp + 0x78]
push eax
push 0x100
push 0x410780
call esi
add esp, 0xc
push str.database
push 0x100
push 0x410780
call edi
add esp, 0xc
lea eax, [esp + 0x178]
push eax
call dword [sym.imp.MSVCR110.dll__strdup]
pop ecx
push dword [esp + 0x18]
mov edi, eax
push ebx
xor eax, eax
push 2
inc eax
push eax
push ebx
lea eax, [esp + 0x18c]
push ebx
push eax
call dword [sym.imp.libav.dll_Ordinal_44284]
add esp, 0x1c
mov esi, eax
mov dword [esp + 0x20], esi
push edi
test esi, esi
jne 0x401881
push str.ERROR:_Cant_open_parse_the_config_file__s_n
call dword [sym.imp.MSVCR110.dll___iob_func]
add eax, 0x40
push eax
call dword [sym.imp.MSVCR110.dll_fprintf]
add esp, 0xc
push edi
call dword [sym.imp.MSVCR110.dll_free]
jmp 0x401705
call dword [sym.imp.MSVCR110.dll_free]
mov edi, dword [sym.imp.libav.dll_Ordinal_44283]
mov dword [esp], str.version
push esi
call edi
pop ecx
pop ecx
cmp dword [eax + 0x18], ebx
je 0x4018b5
push str.DatabaseDirectory
push esi
call edi
pop ecx
pop ecx
mov ecx, dword [eax + 8]
call fcn.004075f9
jmp 0x401cb9
push str.stats_host_id
push esi
call edi
pop ecx
pop ecx
cmp dword [eax + 0x18], ebx
je 0x401969
push str.stats_host_id
push esi
call edi
mov eax, dword [eax + 8]
push 8
push str.default
push eax
mov dword [esp + 0x24], eax
call sub.MSVCR110.dll_memcmp
add esp, 0x14
test eax, eax
je 0x401955
push 0xa
push str.anonymous
push dword [esp + 0x18]
call sub.MSVCR110.dll_memcmp
add esp, 0xc
test eax, eax
jne 0x40191e
push 9
pop ecx
mov esi, str.5b585e8f_3be5_11e3_bf0b_18037319526c
mov edi, 0x410540
rep movsd dword es:[edi], dword [esi]
movsb byte es:[edi], byte [esi]
mov esi, dword [esp + 0x20]
mov edi, dword [sym.imp.libav.dll_Ordinal_44283]
jmp 0x401969
mov ecx, dword [esp + 0x10]
mov edx, ecx
lea eax, [edx + 1]
mov dword [esp + 0x18], eax
mov al, byte [edx]
inc edx
test al, al
jne 0x40192b
sub edx, dword [esp + 0x18]
cmp edx, 0x24
jbe 0x401942
push 0x28
jmp 0x401cb8
mov edx, 0x410540
sub edx, ecx
mov al, byte [ecx]
mov byte [edx + ecx], al
inc ecx
test al, al
jne 0x401949
jmp 0x401969
mov eax, dword [str.default]
mov dword [0x410540], eax
mov eax, dword [0x40c9b0]
mov dword [0x410544], eax
mov ecx, esi
call fcn.00401e30
push str.HTTPProxyPassword
push esi
call edi
pop ecx
pop ecx
cmp dword [eax + 0x18], ebx
je 0x4019a0
lea eax, [esp + 0x48]
push eax
lea eax, [esp + 0x17c]
push eax
call dword [sym.imp.libav.dll_Ordinal_44339]
pop ecx
pop ecx
cmp eax, 0xffffffff
jne 0x4019a0
push 0x38
jmp 0x401cb8
push str.Debug
push esi
call edi
pop ecx
pop ecx
cmp dword [eax + 0x18], ebx
jne 0x4019be
push str.debug
push esi
call edi
pop ecx
pop ecx
cmp dword [eax + 0x18], ebx
je 0x4019c4
call dword [sym.imp.libav.dll_Ordinal_6]
push str.verbose
push esi
call edi
pop ecx
pop ecx
cmp dword [eax + 0x18], ebx
je 0x4019dc
xor eax, eax
inc eax
mov word [0x41051c], ax
push str.quiet
push esi
call edi
pop ecx
pop ecx
cmp dword [eax + 0x18], ebx
je 0x4019f4
xor eax, eax
inc eax
mov word [0x410508], ax
push str.no_warnings
push esi
call edi
pop ecx
pop ecx
cmp dword [eax + 0x18], ebx
je 0x401a12
xor eax, eax
inc eax
mov word [0x410518], ax
mov word [0x41050c], ax
push str.stdout
push esi
call edi
pop ecx
pop ecx
cmp dword [eax + 0x18], ebx
je 0x401a2c
xor eax, eax
inc eax
mov word [0x410500], ax
jmp 0x401a2f
xor eax, eax
inc eax
cmp word [0x41051c], bx
jne 0x401a46
push str.LogVerbose
push esi
call edi
mov ax, word [eax + 0x18]
pop ecx
pop ecx
push str.LogTime
push esi
mov word [0x410510], ax
call edi
mov ax, word [eax + 0x18]
push str.LogFileMaxSize
push esi
mov word [0x410514], ax
call edi
mov eax, dword [eax + 0x10]
add esp, 0x10
mov dword [0x410520], eax
test eax, eax
je 0x401a89
push str.LogRotate
push esi
call edi
mov ax, word [eax + 0x18]
pop ecx
pop ecx
mov word [0x410524], ax
push str.UpdateLogFile
push esi
call edi
pop ecx
pop ecx
cmp dword [eax + 0x18], ebx
je 0x401ace
lea eax, [esp + 0x278]
push str._______________________________________n
mov dword [0x410504], eax
call fcn.004077c4
pop ecx
test eax, eax
je 0x401ad4
lea eax, [esp + 0x278]
push eax
push str._Problem_with_internal_logger__UpdateLogFile___s_._n
call fcn.004077c7
pop ecx
pop ecx
push 0x3e
jmp 0x401cb8
mov dword [0x410504], ebx
push 0x40136c
call dword [sym.imp.libav.dll_Ordinal_33]
mov dword [esp], 0x410780
call dword [sym.imp.MSVCR110.dll__chdir]
pop ecx
test eax, eax
je 0x401af8
push 0x32
jmp 0x401cb8
push str.list_mirrors
push esi
call edi
pop ecx
pop ecx
cmp dword [eax + 0x18], ebx
je 0x401b4f
push 9
xor eax, eax
pop ecx
lea edi, [esp + 0x24]
rep stosd dword es:[edi], eax
inc eax
lea ecx, [esp + 0x24]
mov byte [esp + 0x24], al
call fcn.00405522
cmp eax, 0xffffffff
jne 0x401b38
push str.Cant_read_mirrors.dat_n
call dword [sym.imp.MSVCR110.dll_printf]
pop ecx
push 0x37
jmp 0x401cb8
lea ecx, [esp + 0x24]
call fcn.0040592c
lea ecx, [esp + 0x24]
call fcn.00405505
jmp 0x401cb9
push str.PrivateMirror
push esi
call edi
pop ecx
pop ecx
mov dword [esp + 0x10], eax
cmp dword [eax + 0x18], ebx
je 0x401c79
push str.DatabaseMirror
push esi
call edi
pop ecx
pop ecx
xor ecx, ecx
inc ecx
mov dword [esp + 0x14], eax
mov dword [eax + 0x18], ecx
mov dword [eax + 0x1c], ecx
mov eax, dword [esp + 0x10]
push str..clamav.net
push dword [eax + 8]
call dword [sym.imp.libav.dll_Ordinal_44258]
pop ecx
pop ecx
test eax, eax
jne 0x401cc8
mov eax, dword [esp + 0x14]
cmp dword [eax + 8], ebx
je 0x401bac
push dword [eax + 8]
call dword [sym.imp.MSVCR110.dll_free]
pop ecx
mov eax, dword [esp + 0x10]
push dword [eax + 8]
call dword [sym.imp.MSVCR110.dll__strdup]
pop ecx
mov ecx, dword [esp + 0x14]
mov dword [ecx + 8], eax
test eax, eax
je 0x401c10
lea eax, [ecx + 0x28]
mov dword [esp + 0x18], eax
cmp dword [eax], ebx
jne 0x401bf0
xor eax, eax
inc eax
push 0x38
push eax
call dword [sym.imp.MSVCR110.dll_calloc]
pop ecx
pop ecx
mov ecx, dword [esp + 0x18]
mov dword [ecx], eax
test eax, eax
je 0x401c10
mov ecx, dword [esp + 0x14]
mov eax, dword [esp + 0x18]
lea edx, [ecx]
mov ecx, dword [eax]
mov eax, dword [esp + 0x10]
mov dword [esp + 0x14], ecx
mov eax, dword [eax + 0x28]
mov dword [esp + 0x10], eax
test eax, eax
jne 0x401b81
mov dword [edx + 0x28], ebx
jmp 0x401c53
push 0x4b
jmp 0x401cb8
push dword [ecx]
call dword [sym.imp.MSVCR110.dll_free]
mov eax, dword [esp + 0x18]
pop ecx
push dword [eax + 4]
call dword [sym.imp.MSVCR110.dll_free]
mov eax, dword [esp + 0x18]
pop ecx
push dword [eax + 8]
call dword [sym.imp.MSVCR110.dll_free]
pop ecx
mov ecx, dword [esp + 0x14]
push ecx
mov ecx, dword [ecx + 0x28]
mov dword [esp + 0x18], ecx
call dword [sym.imp.MSVCR110.dll_free]
pop ecx
mov ecx, dword [esp + 0x14]
test ecx, ecx
jne 0x401c17
push str.no_dns
push esi
call edi
xor ecx, ecx
inc ecx
push str.ScriptedUpdates
push esi
mov dword [eax + 0x18], ecx
mov dword [eax + 0x1c], ecx
call edi
add esp, 0x10
mov dword [eax + 0x18], ebx
mov dword [eax + 0x1c], ebx
push 0x401131
push 2
mov byte [0x410580], bl
call dword [sym.imp.MSVCR110.dll_signal]
push str.daemon
push esi
call edi
add esp, 0x10
cmp dword [eax + 0x18], ebx
je 0x401d5c
push str.Checks
push esi
call edi
pop ecx
pop ecx
mov ecx, dword [eax + 0x10]
test ecx, ecx
jle 0x401cb6
cmp ecx, 0x32
jle 0x401ccc
push 0x29
pop ebx
push esi
call dword [sym.imp.libav.dll_Ordinal_44285]
pop ecx
mov eax, ebx
jmp 0x401e1b
push 0x2d
jmp 0x401cb8
mov eax, 0x15180
cdq
idiv ecx
push str.PidFile
push esi
mov dword [esp + 0x18], eax
call edi
pop ecx
pop ecx
cmp dword [eax + 0x18], ebx
je 0x401cf4
mov eax, dword [eax + 8]
mov dword [0x4103f0], eax
call fcn.00401160
mov dword [0x410980], ebx
cmp word [0x4103f4], bx
jne 0x401dc7
mov eax, dword [esp + 0x10]
imul eax, eax, 0x3e8
mov dword [esp + 0x10], eax
mov ecx, esi
call fcn.004012e6
mov dword [esp + 0x1c], eax
cmp eax, 1
jle 0x401d47
push str.OnErrorExecute
push esi
call edi
pop ecx
pop ecx
cmp dword [eax + 0x18], ebx
je 0x401d47
mov edx, dword [eax + 8]
test edx, edx
je 0x401d47
push esi
mov ecx, str.OnErrorExecute
call fcn.0040105d
pop ecx
push dword [esp + 0x10]
call dword [sym.imp.KERNEL32.dll_Sleep]
cmp word [0x4103f4], bx
je 0x401d15
jmp 0x401dc0
mov esi, str.GlobalPCAProMutex
push esi
push ebx
push 0x100000
call dword [sym.imp.KERNEL32.dll_OpenMutexW]
test eax, eax
je 0x401d80
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0x30
jmp 0x401e1a
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
jne 0x401d79
call fcn.0040148a
test eax, eax
je 0x401e18
push esi
push ebx
push ebx
call dword [sym.imp.KERNEL32.dll_CreateMutexW]
mov ecx, dword [esp + 0x20]
mov esi, eax
call fcn.004012e6
mov dword [esp + 0x1c], eax
call fcn.0040136d
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esi, dword [esp + 0x20]
cmp dword [esp + 0x1c], 1
jle 0x401de5
push str.OnErrorExecute
push esi
call edi
pop ecx
pop ecx
cmp dword [eax + 0x18], ebx
je 0x401de5
mov edx, dword [eax + 8]
push esi
mov ecx, str.OnErrorExecute
call fcn.0040105d
pop ecx
mov eax, dword [0x4103f0]
test eax, eax
je 0x401df6
push eax
call dword [sym.imp.MSVCR110.dll__unlink]
pop ecx
push esi
call dword [sym.imp.libav.dll_Ordinal_44285]
pop ecx
call dword [sym.imp.libav.dll_Ordinal_49]
mov eax, dword [esp + 0x1c]
test eax, eax
jne 0x401e1b
cmp dword [0x4104fc], ebx
je 0x401e1b
push 2
jmp 0x401e1a
push 0x31
pop eax
mov ecx, dword [esp + 0x37c]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.00407bf7
mov esp, ebp
pop ebp
ret