Function at 0x4017c0
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
sub esp, 0x35c
mov eax, dword [0x413080]
xor eax, ebp
mov dword [ebp - 4], eax
push esi
mov esi, dword [ebp + 8]
push edi
mov edi, dword [ebp + 0xc]
push 0xff
lea eax, [ebp - 0x203]
push 0
push eax
mov byte [ebp - 0x204], 0
call sub.MSVCR110.dll_memset
push 0xff
lea eax, [ebp - 0x103]
push 0
push eax
mov byte [ebp - 0x104], 0
call sub.MSVCR110.dll_memset
push 0xff
lea eax, [ebp - 0x303]
push 0
push eax
mov byte [ebp - 0x304], 0
call sub.MSVCR110.dll_memset
add esp, 0x24
call fcn.00409890
test eax, eax
je 0x40183d
push 0x28
call dword [sym.imp.MSVCR110.dll_exit]
push 0
call sub.libav.dll_Ordinal_17
add esp, 4
test eax, eax
je 0x401874
push eax
call sub.libav.dll_Ordinal_27
push eax
push str._Cant_initialize_libclamav:__s_n
call fcn.00409d70
add esp, 0xc
mov eax, 0x28
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040a436
mov esp, ebp
pop ebp
ret
push ebx
push 0
push 0
push 2
push 1
push edi
push esi
push 0
call sub.libav.dll_Ordinal_44284
mov ebx, eax
add esp, 0x1c
test ebx, ebx
jne 0x4018b0
push str._Cant_parse_command_line_options_n
call fcn.00409d70
add esp, 4
lea eax, [ebx + 0x28]
pop ebx
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040a436
mov esp, ebp
pop ebp
ret
push str.help
push ebx
call sub.libav.dll_Ordinal_44283
add esp, 8
cmp dword [eax + 0x18], 0
je 0x4018e5
call fcn.004015a0
push ebx
call sub.libav.dll_Ordinal_44285
add esp, 4
xor eax, eax
pop ebx
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040a436
mov esp, ebp
pop ebp
ret
lea eax, [ebp - 0x204]
push eax
push 0
push 0
push 0x23
push 0
call dword [sym.imp.SHELL32.dll_SHGetFolderPathA]
mov edi, dword [sym.imp.MSVCR110.dll_strcat_s]
push 0x40d1c4
lea eax, [ebp - 0x204]
push 0x100
push eax
call edi
call fcn.00401120
push eax
lea eax, [ebp - 0x204]
push 0x100
push eax
call edi
mov esi, dword [sym.imp.MSVCR110.dll_strcpy_s]
lea eax, [ebp - 0x204]
push eax
lea eax, [ebp - 0x104]
push 0x100
push eax
call esi
push str.PCAProUpdater.conf
lea eax, [ebp - 0x104]
push 0x100
push eax
call edi
lea eax, [ebp - 0x204]
push eax
lea eax, [ebp - 0x304]
push 0x100
push eax
call esi
push str.RPCAProUpdater.log
lea eax, [ebp - 0x304]
push 0x100
push eax
call edi
add esp, 0x48
lea eax, [ebp - 0x204]
push eax
push 0x100
push 0x4139a0
call esi
push str.database
push 0x100
push 0x4139a0
call edi
lea eax, [ebp - 0x104]
push eax
call dword [sym.imp.MSVCR110.dll__strdup]
push ebx
push 0
push 2
push 1
push 0
mov esi, eax
lea eax, [ebp - 0x104]
push 0
push eax
call sub.libav.dll_Ordinal_44284
add esp, 0x38
mov edi, eax
push esi
test edi, edi
jne 0x401a07
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]
push esi
call dword [sym.imp.MSVCR110.dll_free]
add esp, 0x10
lea eax, [edi + 0x28]
pop ebx
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040a436
mov esp, ebp
pop ebp
ret
call dword [sym.imp.MSVCR110.dll_free]
push str.version
push edi
call sub.libav.dll_Ordinal_44283
add esp, 0xc
cmp dword [eax + 0x18], 0
je 0x401a51
push str.DatabaseDirectory
push edi
call sub.libav.dll_Ordinal_44283
mov eax, dword [eax + 8]
push eax
call fcn.00409b70
push edi
call sub.libav.dll_Ordinal_44285
add esp, 0x10
xor eax, eax
pop ebx
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040a436
mov esp, ebp
pop ebp
ret
push str.stats_host_id
push edi
call sub.libav.dll_Ordinal_44283
add esp, 8
cmp dword [eax + 0x18], 0
je 0x401b96
push str.stats_host_id
push edi
call sub.libav.dll_Ordinal_44283
mov ecx, dword [eax + 8]
add esp, 8
mov edx, str.default
mov eax, ecx
mov bl, byte [eax]
cmp bl, byte [edx]
jne 0x401aa1
test bl, bl
je 0x401a9d
mov bl, byte [eax + 1]
cmp bl, byte [edx + 1]
jne 0x401aa1
add eax, 2
add edx, 2
test bl, bl
jne 0x401a81
xor eax, eax
jmp 0x401aa6
sbb eax, eax
or eax, 1
test eax, eax
je 0x401b82
mov edx, str.anonymous
mov eax, ecx
mov bl, byte [eax]
cmp bl, byte [edx]
jne 0x401ad5
test bl, bl
je 0x401ad1
mov bl, byte [eax + 1]
cmp bl, byte [edx + 1]
jne 0x401ad5
add eax, 2
add edx, 2
test bl, bl
jne 0x401ab5
xor eax, eax
jmp 0x401ada
sbb eax, eax
or eax, 1
test eax, eax
jne 0x401b34
movq xmm0, qword [str.5b585e8f_3be5_11e3_bf0b_18037319526c]
mov eax, dword [0x40d288]
movq qword [0x413960], xmm0
movq xmm0, qword [0x40d270]
movq qword [0x413968], xmm0
movq xmm0, qword [0x40d278]
movq qword [0x413970], xmm0
movq xmm0, qword [0x40d280]
mov dword [0x413980], eax
mov al, byte [0x40d28c]
movq qword [0x413978], xmm0
mov byte [0x413984], al
jmp 0x401b96
mov edx, ecx
lea esi, [edx + 1]
lea esp, [esp]
mov al, byte [edx]
inc edx
test al, al
jne 0x401b40
sub edx, esi
cmp edx, 0x24
jbe 0x401b6d
push edi
call sub.libav.dll_Ordinal_44285
add esp, 4
mov eax, 0x28
pop ebx
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040a436
mov esp, ebp
pop ebp
ret
mov edx, 0x413960
sub edx, ecx
mov al, byte [ecx]
mov byte [edx + ecx], al
lea ecx, [ecx + 1]
test al, al
jne 0x401b74
jmp 0x401b96
mov eax, dword [str.default]
mov dword [0x413960], eax
mov eax, dword [0x40d258]
mov dword [0x413964], eax
push edi
call fcn.004021e0
push str.HTTPProxyPassword
push edi
call sub.libav.dll_Ordinal_44283
add esp, 0xc
cmp dword [eax + 0x18], 0
je 0x401bea
lea eax, [ebp - 0x358]
push eax
lea eax, [ebp - 0x104]
push eax
call sub.libav.dll_Ordinal_44339
add esp, 8
cmp eax, 0xffffffff
jne 0x401bea
push edi
call sub.libav.dll_Ordinal_44285
add esp, 4
mov eax, 0x38
pop ebx
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040a436
mov esp, ebp
pop ebp
ret
push str.Debug
push edi
call sub.libav.dll_Ordinal_44283
add esp, 8
cmp dword [eax + 0x18], 0
jne 0x401c12
push str.debug
push edi
call sub.libav.dll_Ordinal_44283
add esp, 8
cmp dword [eax + 0x18], 0
je 0x401c17
call sub.libav.dll_Ordinal_6
push str.verbose
push edi
call sub.libav.dll_Ordinal_44283
add esp, 8
cmp dword [eax + 0x18], 0
mov esi, 1
je 0x401c37
mov word [0x413600], si
push str.quiet
push edi
call sub.libav.dll_Ordinal_44283
add esp, 8
cmp dword [eax + 0x18], 0
je 0x401c52
mov word [0x413604], si
push str.no_warnings
push edi
call sub.libav.dll_Ordinal_44283
add esp, 8
cmp dword [eax + 0x18], 0
je 0x401c74
mov word [0x413608], si
mov word [0x4135e4], si
push str.stdout
push edi
call sub.libav.dll_Ordinal_44283
add esp, 8
cmp dword [eax + 0x18], 0
je 0x401c8f
mov word [0x41360c], si
cmp word [0x413600], 0
je 0x401ca2
mov word [0x4135e0], si
jmp 0x401cba
push str.LogVerbose
push edi
call sub.libav.dll_Ordinal_44283
mov ax, word [eax + 0x18]
add esp, 8
mov word [0x4135e0], ax
push str.LogTime
push edi
call sub.libav.dll_Ordinal_44283
mov ax, word [eax + 0x18]
push str.LogFileMaxSize
push edi
mov word [0x4135e8], ax
call sub.libav.dll_Ordinal_44283
mov eax, dword [eax + 0x10]
add esp, 0x10
mov dword [0x4135f4], eax
test eax, eax
je 0x401d01
push str.LogRotate
push edi
call sub.libav.dll_Ordinal_44283
mov ax, word [eax + 0x18]
add esp, 8
mov word [0x4135f0], ax
push str.UpdateLogFile
push edi
call sub.libav.dll_Ordinal_44283
add esp, 8
cmp dword [eax + 0x18], 0
je 0x401d60
lea eax, [ebp - 0x304]
push str._______________________________________n
mov dword [0x4135f8], eax
call fcn.00409d50
add esp, 4
test eax, eax
je 0x401d6a
push dword [0x4135f8]
push str._Problem_with_internal_logger__UpdateLogFile___s_._n
call fcn.00409d70
push edi
call sub.libav.dll_Ordinal_44285
add esp, 0xc
mov eax, 0x3e
pop ebx
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040a436
mov esp, ebp
pop ebp
ret
mov dword [0x4135f8], 0
push 0x4017b0
call sub.libav.dll_Ordinal_33
push 0x4139a0
call dword [sym.imp.MSVCR110.dll__chdir]
add esp, 8
test eax, eax
je 0x401da5
push edi
call sub.libav.dll_Ordinal_44285
add esp, 4
mov eax, 0x32
pop ebx
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040a436
mov esp, ebp
pop ebp
ret
push str.list_mirrors
push edi
call sub.libav.dll_Ordinal_44283
add esp, 8
cmp dword [eax + 0x18], 0
je 0x401e32
push 1
lea eax, [ebp - 0x328]
push eax
push str.mirrors.dat
call fcn.00406d90
add esp, 0xc
cmp eax, 0xffffffff
jne 0x401dfe
push str.Cant_read_mirrors.dat_n
call dword [sym.imp.MSVCR110.dll_printf]
push edi
call sub.libav.dll_Ordinal_44285
add esp, 8
mov eax, 0x37
pop ebx
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040a436
mov esp, ebp
pop ebp
ret
lea eax, [ebp - 0x328]
push eax
call fcn.00406c90
lea eax, [ebp - 0x328]
push eax
call fcn.00406c60
push edi
call sub.libav.dll_Ordinal_44285
add esp, 0xc
xor eax, eax
pop ebx
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040a436
mov esp, ebp
pop ebp
ret
push str.PrivateMirror
push edi
call sub.libav.dll_Ordinal_44283
mov ebx, eax
add esp, 8
cmp dword [ebx + 0x18], 0
je 0x401f46
push str.DatabaseMirror
push edi
call sub.libav.dll_Ordinal_44283
mov esi, eax
add esp, 8
mov dword [esi + 0x18], 1
mov dword [esi + 0x1c], 1
lea ebx, [ebx]
push str..clamav.net
push dword [ebx + 8]
call sub.libav.dll_Ordinal_44258
add esp, 8
test eax, eax
jne 0x401fca
mov eax, dword [esi + 8]
test eax, eax
je 0x401e99
push eax
call dword [sym.imp.MSVCR110.dll_free]
add esp, 4
push dword [ebx + 8]
call dword [sym.imp.MSVCR110.dll__strdup]
add esp, 4
mov dword [esi + 8], eax
test eax, eax
je 0x401fab
cmp dword [esi + 0x28], 0
lea eax, [esi + 0x28]
mov dword [ebp - 0x35c], eax
jne 0x401ede
push 0x38
push 1
call dword [sym.imp.MSVCR110.dll_calloc]
mov ecx, dword [ebp - 0x35c]
add esp, 8
mov dword [ecx], eax
test eax, eax
je 0x401fab
mov eax, ecx
mov ebx, dword [ebx + 0x28]
mov ecx, esi
mov esi, dword [eax]
test ebx, ebx
jne 0x401e70
mov dword [ecx + 0x28], ebx
test esi, esi
je 0x401f11
mov ebx, dword [sym.imp.MSVCR110.dll_free]
push dword [esi]
call ebx
push dword [esi + 4]
call ebx
push dword [esi + 8]
call ebx
push esi
mov esi, dword [esi + 0x28]
call ebx
add esp, 0x10
test esi, esi
jne 0x401ef6
push str.no_dns
push edi
call sub.libav.dll_Ordinal_44283
push str.ScriptedUpdates
push edi
mov dword [eax + 0x18], 1
mov dword [eax + 0x1c], 1
call sub.libav.dll_Ordinal_44283
add esp, 0x10
mov dword [eax + 0x18], 0
mov dword [eax + 0x1c], 0
push 0x4021a0
push 2
mov byte [0x413ba0], 0
call dword [sym.imp.MSVCR110.dll_signal]
push str.daemon
push edi
call sub.libav.dll_Ordinal_44283
add esp, 0x10
cmp dword [eax + 0x18], 0
je 0x40208a
push str.Checks
push edi
call sub.libav.dll_Ordinal_44283
mov ecx, dword [eax + 0x10]
add esp, 8
test ecx, ecx
jle 0x401f8c
cmp ecx, 0x32
jle 0x401fe9
push edi
call sub.libav.dll_Ordinal_44285
add esp, 4
mov eax, 0x29
pop ebx
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040a436
mov esp, ebp
pop ebp
ret
push edi
call sub.libav.dll_Ordinal_44285
add esp, 4
mov eax, 0x4b
pop ebx
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040a436
mov esp, ebp
pop ebp
ret
push edi
call sub.libav.dll_Ordinal_44285
add esp, 4
mov eax, 0x2d
pop ebx
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040a436
mov esp, ebp
pop ebp
ret
mov eax, 0x15180
cdq
idiv ecx
push str.PidFile
push edi
mov esi, eax
call sub.libav.dll_Ordinal_44283
add esp, 8
cmp dword [eax + 0x18], 0
je 0x402018
mov eax, dword [eax + 8]
push eax
mov dword [0x4131c8], eax
call fcn.00402370
add esp, 4
cmp word [0x4131c4], 0
mov dword [0x413da0], 0
jne 0x40210b
imul esi, esi, 0x3e8
lea eax, [ebp - 0x104]
push eax
push edi
call fcn.00401490
mov ebx, eax
add esp, 8
cmp ebx, 1
jle 0x402077
push str.OnErrorExecute
push edi
call sub.libav.dll_Ordinal_44283
add esp, 8
cmp dword [eax + 0x18], 0
je 0x402077
mov eax, dword [eax + 8]
test eax, eax
je 0x402077
push edi
push eax
push str.OnErrorExecute
call fcn.00401070
add esp, 0xc
push esi
call dword [sym.imp.KERNEL32.dll_Sleep]
cmp word [0x4131c4], 0
je 0x402036
jmp 0x402104
push str.GlobalPCAProMutex
push 0
push 0x100000
call dword [sym.imp.KERNEL32.dll_OpenMutexW]
test eax, eax
je 0x4020bd
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop ebx
pop edi
mov eax, 0x30
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040a436
mov esp, ebp
pop ebp
ret
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
jne 0x4020a7
call fcn.00401170
test eax, eax
je 0x402189
push str.GlobalPCAProMutex
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateMutexW]
mov esi, eax
lea eax, [ebp - 0x104]
push eax
push edi
call fcn.00401490
add esp, 8
mov ebx, eax
call fcn.00401350
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp ebx, 1
jle 0x402135
jmp 0x402110
mov ebx, 0x34
push str.OnErrorExecute
push edi
call sub.libav.dll_Ordinal_44283
add esp, 8
cmp dword [eax + 0x18], 0
je 0x402135
push edi
push dword [eax + 8]
push str.OnErrorExecute
call fcn.00401070
add esp, 0xc
mov eax, dword [0x4131c8]
test eax, eax
je 0x402148
push eax
call dword [sym.imp.MSVCR110.dll__unlink]
add esp, 4
push edi
call sub.libav.dll_Ordinal_44285
add esp, 4
call sub.libav.dll_Ordinal_49
test ebx, ebx
jne 0x402176
cmp dword [0x4131cc], ebx
je 0x402176
lea eax, [ebx + 2]
pop ebx
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040a436
mov esp, ebp
pop ebp
ret
mov eax, ebx
pop ebx
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040a436
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 4]
pop ebx
pop edi
xor ecx, ebp
mov eax, 0x31
pop esi
call fcn.0040a436
mov esp, ebp
pop ebp
ret