Function at 0x4099f8
Capabilities:
Check os version
Print debug messages
Set current directory

Disassembly:
mov eax, 0x41bbd4
call fcn.00418cb0
sub esp, 0x228
mov eax, dword [0x42847c]
push ebx
mov ebx, dword [ebp + 0x10]
push esi
mov esi, dword [sym.imp.MSVCR71.dll__wcsicmp]
xor eax, ebp
push str._StartTP
push ebx
mov dword [ebp - 0x10], eax
mov byte [ebp - 0x229], 0
call esi
test eax, eax
pop ecx
pop ecx
je 0x409a52
push str._debug
push ebx
call dword [sym.imp.MSVCR71.dll_wcscmp]
test eax, eax
pop ecx
pop ecx
je 0x409a52
push 0x41f074
push ebx
call esi
test eax, eax
pop ecx
pop ecx
jne 0x409a59
mov byte [ebp - 0x229], 1
lea ecx, [ebp - 0x80]
call fcn.0040931c
and dword [ebp - 4], 0
lea eax, [ebp - 0x80]
push eax
call fcn.004097c7
cmp byte [ebp - 0x229], 0
pop ecx
je 0x409a82
lea eax, [ebp - 0x80]
push eax
call fcn.004093a7
pop ecx
lea eax, [ebp - 0x80]
push eax
call fcn.0040957f
lea eax, [ebp - 0x2c]
push eax
call fcn.0040caab
pop ecx
pop ecx
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x2c]
call dword [sym.imp.MSVCP71.dll_public:_wchar_t_const____thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::c_str_void_const]
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
push str._RegServer
push ebx
call esi
test eax, eax
pop ecx
pop ecx
jne 0x409ad4
call fcn.00409917
mov ecx, dword [0x4285e0]
call fcn.00408e72
mov esi, eax
call fcn.00409996
jmp 0x409c4b
push str._RegServerEx
push ebx
call esi
test eax, eax
pop ecx
pop ecx
jne 0x409af5
call fcn.00409917
mov eax, dword [0x4285e0]
mov byte [eax + 0xf0], 0
jmp 0x409abd
push str._UnRegServer
push ebx
call esi
test eax, eax
pop ecx
pop ecx
jne 0x409b15
call fcn.00409917
mov ecx, dword [0x4285e0]
call fcn.00408adb
jmp 0x409ac8
push edi
lea ecx, [ebp - 0x234]
call fcn.0040344c
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x114]
call fcn.00401550
mov byte [ebp - 4], 3
and dword [ebp - 0x230], 0
push str.IsWow64Process
push str.kernel32.dll
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov edi, eax
test edi, edi
je 0x409b68
lea eax, [ebp - 0x230]
push eax
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call edi
push 0x44
pop ecx
xor eax, eax
lea edi, [ebp - 0x224]
rep stosd dword es:[edi], eax
lea eax, [ebp - 0x228]
push eax
mov dword [ebp - 0x228], 0x114
call dword [sym.imp.KERNEL32.dll_GetVersionExW]
cmp dword [ebp - 0x224], 5
pop edi
jne 0x409ba1
cmp dword [ebp - 0x220], 1
jne 0x409bd0
jmp 0x409bb3
cmp dword [ebp - 0x224], 6
jne 0x409bd0
cmp dword [ebp - 0x220], 0
jne 0x409bbc
cmp dword [ebp - 0x230], 0
jmp 0x409bc3
cmp dword [ebp - 0x220], 1
jne 0x409bd0
lea ecx, [ebp - 0x114]
call fcn.00401758
push str._StartTP
push ebx
call esi
test eax, eax
pop ecx
pop ecx
je 0x409c0f
push str._debug
push ebx
call dword [sym.imp.MSVCR71.dll_wcscmp]
test eax, eax
pop ecx
pop ecx
je 0x409c03
push 0x41f074
push ebx
call esi
test eax, eax
pop ecx
pop ecx
je 0x409c03
or esi, 0xffffffff
jmp 0x409c2d
call fcn.00409705
mov ecx, eax
call fcn.00409cf2
xor esi, esi
call fcn.00409705
mov ecx, eax
call fcn.0040bf8e
push str.Calling_into_UnInitReplaceProgram_...
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
call fcn.00418580
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x114]
call fcn.004016bd
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x234]
call fcn.004034c9
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x2c]
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::destructor_void_]
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x80]
call fcn.00409360
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
mov ecx, dword [ebp - 0x10]
mov eax, esi
pop esi
xor ecx, ebp
pop ebx
call fcn.00418c29
leave
ret 0x10