Function at 0x40e510
Capabilities:
Get common file path
Read .ini file
Set current directory

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x420956
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x770
mov eax, dword [0x427550]
push ebx
xor eax, ebp
push esi
push edi
mov dword [esp + 0x774], eax
xor eax, eax
mov byte [esp + 0x140], 0
mov ecx, 0x41
lea edi, [esp + 0x141]
rep stosd dword es:[edi], eax
push 0x105
mov ebx, 0x421764
lea ecx, [esp + 0x144]
xor esi, esi
call fcn.0040dfd0
mov al, byte [esp + 0x144]
xor ebx, ebx
add esp, 4
cmp al, bl
jne 0x40e5ae
push 0x105
mov ebx, 0x421f44
lea ecx, [esp + 0x144]
call fcn.0040dfd0
mov al, byte [esp + 0x144]
add esp, 4
test al, al
je 0x40e8dc
xor ebx, ebx
jmp 0x40e5b3
mov esi, 1
xor eax, eax
mov ecx, 0x41
lea edi, [esp + 0x561]
mov byte [esp + 0x560], bl
rep stosd dword es:[edi], eax
mov ecx, 0x41
lea edi, [esp + 0x459]
mov byte [esp + 0x458], bl
rep stosd dword es:[edi], eax
nop
mov cl, byte [esp + eax + 0x140]
mov byte [esp + eax + 0x560], cl
inc eax
cmp cl, bl
jne 0x40e5e0
lea edi, [esp + 0x560]
dec edi
jmp 0x40e600
mov al, byte [edi + 1]
inc edi
cmp al, bl
jne 0x40e600
mov eax, dword [str.CompsVer.inf]
mov ecx, dword [0x421f38]
mov edx, dword [0x421f3c]
mov dword [edi], eax
mov ax, word [0x421f40]
mov dword [edi + 4], ecx
lea ecx, [esp + 0x560]
push ecx
push 0x105
mov dword [edi + 8], edx
lea edx, [esp + 0x460]
push edx
push 0x42158d
push str.Version
push str.UPDATE
mov word [edi + 0xc], ax
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringA]
cmp byte [esp + 0x458], bl
je 0x40e8dc
xor eax, eax
mov byte [esp + 0x668], bl
mov ecx, 0x41
lea edi, [esp + 0x669]
rep stosd dword es:[edi], eax
lea eax, [esp + 0x668]
push eax
push 0x105
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
lea ecx, [esp + 0x140]
push ecx
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
mov ecx, 0x41
xor eax, eax
lea edi, [esp + 0x351]
mov byte [esp + 0x350], bl
rep stosd dword es:[edi], eax
mov cl, byte [esp + eax + 0x140]
mov byte [esp + eax + 0x350], cl
inc eax
cmp cl, bl
jne 0x40e6b1
lea edi, [esp + 0x350]
dec edi
lea esp, [esp]
mov al, byte [edi + 1]
inc edi
cmp al, bl
jne 0x40e6d0
mov dx, word [0x4215dc]
lea eax, [esp + 0x458]
push eax
mov word [edi], dx
call fcn.00413bfe
add esp, 4
cmp eax, 0x13
jne 0x40e7f3
mov esi, dword [ebp + 8]
xor eax, eax
push 0x105
mov byte [esp + 0x24c], bl
mov ecx, 0x41
lea edi, [esp + 0x24d]
rep stosd dword es:[edi], eax
neg esi
push str.Setup.exe
lea ecx, [esp + 0x250]
sbb esi, esi
push ecx
add esi, 0x1f5
call dword [sym.imp.KERNEL32.dll_lstrcpynA]
lea edx, [esp + 0x248]
push 0x2e
push edx
call fcn.00414a10
add esp, 8
test eax, eax
je 0x40e761
lea eax, [esp + 0x248]
push 0x2e
push eax
call fcn.00414a10
add esp, 8
mov byte [eax], bl
lea ecx, [esp + 0x10]
call fcn.0040e2f0
lea ecx, [esp + 0x350]
push ecx
lea ecx, [esp + 0x14]
mov dword [esp + 0x788], ebx
call fcn.0040de80
test eax, eax
jne 0x40e7bb
lea edx, [esp + 0x248]
push edx
call dword [sym.imp.KERNEL32.dll_lstrlenA]
inc eax
push eax
lea eax, [esp + 0x24c]
push eax
push esi
push 0x42158d
push str.RavMonD.exe0
call dword [esp + 0x34]
add esp, 0x14
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
test byte [esp + 0x1c], 2
mov dword [esp + 0x784], 0xffffffff
je 0x40e8ce
mov eax, dword [esp + 0x18]
cmp eax, ebx
je 0x40e7e0
push eax
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov edx, dword [esp + 0x10]
lea ecx, [esp + 0x10]
mov dword [esp + 0x18], ebx
call dword [edx]
jmp 0x40e8ce
cmp eax, 0x14
jne 0x40e8ae
push 0x104
lea eax, [esp + 0x40]
push eax
or edi, 0xffffffff
push ebx
mov dword [esp + 0x44], edi
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
mov esi, dword [ebp + 8]
neg esi
sbb esi, esi
lea ecx, [esp + 0x24]
add esi, 0x1fa
call fcn.0040e260
lea ecx, [esp + 0x350]
push ecx
lea ecx, [esp + 0x28]
mov dword [esp + 0x788], 1
mov dword [esp + 0x10], ebx
call fcn.0040de80
test eax, eax
jne 0x40e89c
push 1
push str.Setup.exe
lea edx, [esp + 0x14]
push ebx
push edx
call dword [esp + 0x44]
mov ecx, dword [esp + 0x1c]
add esp, 0x10
cmp ecx, ebx
je 0x40e893
mov eax, dword [ecx]
push 0x108
lea edx, [esp + 0x3c]
push edx
push esi
push str.RavMonD.exe0
call dword [eax + 0x14]
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
mov ecx, dword [esp + 0xc]
mov eax, dword [ecx]
call dword [eax + 0x1c]
lea ecx, [esp + 0x24]
call fcn.0040dfa0
lea ecx, [esp + 0x24]
mov dword [esp + 0x784], edi
call fcn.0040e130
jmp 0x40e8ce
cmp eax, 0x15
jl 0x40e8ce
cmp esi, ebx
mov eax, 0x421764
jne 0x40e8c1
mov eax, 0x421f44
mov ecx, dword [ebp + 8]
push eax
push ecx
call fcn.0040e3a0
add esp, 8
lea edx, [esp + 0x668]
push edx
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
mov ecx, dword [esp + 0x77c]
mov dword fs:[0], ecx
mov ecx, dword [esp + 0x774]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00413041
mov esp, ebp
pop ebp
ret