Function at 0x4056f7
Capabilities:
Create thread
Get common file path
Read file via mapping

Disassembly:
mov eax, 0x405e04
call fcn.00405ab0
sub esp, 0x48c
push ebx
push esi
push edi
xor ebx, ebx
mov dword [ebp - 0x10], esp
push 0x40c29c
push dword [ebp + 0x10]
mov dword [ebp - 0x1c], ebx
mov dword [ebp - 0x20], ebx
call sub.MSVCRT.dll__mbsstr
mov edi, eax
lea eax, [ebp - 0x18c]
neg edi
sbb edi, edi
push eax
neg edi
mov dword [ebp - 0x34], edi
call section..text
add esp, 0xc
lea eax, [ebp - 0x290]
push 0x104
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
lea eax, [ebp - 0x290]
push eax
lea eax, [ebp - 0x18c]
push eax
call sub.MSVCRT.dll__mbsicmp
mov esi, eax
push ebx
neg esi
sbb esi, esi
neg esi
call fcn.00404109
add esp, 0xc
cmp eax, 0xffffffff
je 0x40578f
cmp eax, ebx
je 0x40578f
cmp edi, ebx
jne 0x40578f
cmp esi, ebx
jne 0x40578f
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x405a1d
lea ecx, [ebp - 0x14]
call fcn.00404743
push 0x44
lea eax, [ebp - 0x88]
push ebx
push eax
mov dword [ebp - 4], ebx
call sub.MSVCRT.dll_memset
add esp, 0xc
lea eax, [ebp + 0x10]
lea ecx, [ebp - 0x14]
mov dword [ebp + 0x10], ebx
push eax
lea eax, [ebp - 0x88]
push eax
call fcn.0040476f
cmp eax, ebx
mov dword [ebp - 0x24], eax
je 0x405a11
cmp esi, ebx
mov dword [ebp - 0x28], 1
mov dword [ebp - 0x18], ebx
mov byte [ebp - 4], 1
je 0x405892
push dword [ebp + 0x10]
lea eax, [ebp - 0x88]
lea ecx, [ebp - 0x14]
push eax
call fcn.00404818
cmp dword [ebp - 0x60], ebx
mov edi, eax
je 0x40585f
mov eax, dword [ebp - 0x58]
push dword [ebp + 0x10]
mov dword [ebp - 0x38], eax
call sub.MSVCRT.dll_strlen
mov ecx, dword [ebp + 0x10]
lea esi, [eax + ecx + 1]
push esi
mov dword [ebp - 0x3c], esi
call sub.MSVCRT.dll_strlen
lea eax, [esi + eax + 1]
pop ecx
mov dword [ebp - 0x40], eax
pop ecx
lea eax, [ebp - 0x24]
push eax
lea eax, [ebp - 0x40]
push ebx
push eax
push 0x405648
push ebx
push ebx
call dword [sym.imp.KERNEL32.dll_CreateThread]
push 0x1f4
mov esi, eax
call dword [sym.imp.KERNEL32.dll_Sleep]
cmp dword [ebp - 0x60], ebx
je 0x40585f
cmp esi, ebx
je 0x40585f
push 0xffffffffffffffff
push esi
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp edi, ebx
je 0x405a11
push edi
lea eax, [ebp - 0x498]
push str.Operation_failed___d_
push eax
call sub.MSVCRT.dll_sprintf
add esp, 0xc
lea eax, [ebp - 0x498]
push 0x30
push ebx
push eax
push ebx
call dword [sym.imp.USER32.dll_MessageBoxA]
jmp 0x405a11
add eax, 0x444
push str.KLShared
push eax
push ebx
push 4
push ebx
push 0xffffffffffffffff
call dword [sym.imp.KERNEL32.dll_CreateFileMappingA]
mov dword [ebp - 0x1c], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp dword [ebp - 0x1c], ebx
je 0x4058f3
push ebx
push ebx
push ebx
push 6
push dword [ebp - 0x1c]
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov esi, eax
cmp esi, ebx
je 0x4058ec
lea eax, [ebp - 0x88]
push 0x44
push eax
push esi
call sub.MSVCRT.dll_memcpy
push dword [ebp - 0x24]
lea eax, [esi + 0x44]
push dword [ebp + 0x10]
push eax
call sub.MSVCRT.dll_memcpy
add esp, 0x18
push esi
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
push dword [ebp + 0x10]
lea eax, [ebp - 0x18c]
push eax
lea eax, [ebp - 0x394]
push str._s_s.dll
push eax
call sub.MSVCRT.dll_sprintf
add esp, 0x10
lea eax, [ebp - 0x394]
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
cmp eax, ebx
mov dword [ebp - 0x20], eax
jne 0x405937
or dword [ebp - 0x30], 0xffffffff
lea eax, [ebp - 0x30]
push 0x4084d8
push eax
call sub.MSVCRT.dll__CxxThrowException
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push str.Init
push eax
call esi
cmp eax, ebx
mov dword [0x40c2c0], eax
jne 0x405969
push dword [ebp - 0x20]
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
or dword [ebp - 0x2c], 0xffffffff
lea eax, [ebp - 0x2c]
push 0x4084d8
push eax
call sub.MSVCRT.dll__CxxThrowException
push str.kernel32.dll
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
cmp eax, ebx
mov dword [ebp - 0x24], eax
je 0x4059ac
push str.RegisterServiceProcess
push eax
call esi
cmp eax, ebx
je 0x40598c
push 1
push ebx
call eax
push dword [ebp - 0x24]
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
jmp 0x4059ac
cmp dword [ebp - 0x28], ebx
mov dword [ebp - 4], ebx
je 0x4059c3
push edi
push dword [ebp + 0x10]
call dword [0x40c2c0]
pop ecx
mov dword [ebp - 0x18], eax
pop ecx
cmp dword [ebp - 0x20], ebx
je 0x4059d1
push dword [ebp - 0x20]
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
cmp dword [ebp - 0x1c], ebx
je 0x4059df
push dword [ebp - 0x1c]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp + 0x10], ebx
je 0x4059ed
push dword [ebp + 0x10]
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
pop ecx
cmp dword [ebp - 0x18], ebx
je 0x405a11
lea ecx, [ebp - 0x18]
call fcn.00404743
lea ecx, [ebp - 0x18]
mov byte [ebp - 4], 3
call fcn.00405546
lea ecx, [ebp - 0x18]
mov byte [ebp - 4], bl
call fcn.00404768
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x14]
call fcn.00404768
mov ecx, dword [ebp - 0xc]
pop edi
pop esi
xor eax, eax
mov dword fs:[0], ecx
pop ebx
leave
ret 0x10