Function at 0x494c70
Capabilities:
Link many functions at runtime

Disassembly:
mov eax, dword fs:[0]
push 0xffffffffffffffff
push 0x49e9c1
push eax
mov al, byte [0x4d2c9d]
mov dword fs:[0], esp
sub esp, 0x1c
test al, 1
push ebx
push ebp
push esi
jne 0x494cc1
mov bl, al
push 0x4d2ca4
or bl, 1
mov dword [0x4d2ca0], 0x4a48a4
mov byte [0x4d2c9d], bl
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
push 0x4953e0
call fcn.0049acee
add esp, 4
mov eax, dword [esp + 0x38]
xor ebx, ebx
cmp eax, ebx
jne 0x494f2f
cmp dword [0x4d2994], ebx
jne 0x494ffe
xor eax, eax
mov dword [esp + 0x10], 0x4a48a8
cmp eax, 0x4d2ca0
mov dword [esp + 0x14], 0x4d2ca0
je 0x494cff
push 0x4d2ca4
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [0x4c6a94]
mov dword [esp + 0x30], ebx
inc eax
cmp eax, ebx
mov dword [0x4c6a94], eax
jle 0x494d1f
xor ecx, ecx
cmp ecx, 0x4d2ca0
jmp 0x494ff1
cmp dword [0x4d2994], ebx
je 0x494d34
xor edx, edx
cmp edx, 0x4d2ca0
jmp 0x494ff1
mov ebp, dword [esp + 0x40]
lea eax, [esp + 0x18]
push ebp
push eax
call fcn.00495130
add esp, 8
mov eax, dword [eax + 4]
mov byte [esp + 0x30], 1
cmp eax, ebx
jne 0x494d57
mov eax, dword [sym.imp.MSVCP60.dll_char_const__private:_static_char_const____cdecl_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Nullstr_void_::_2::_C]
push eax
lea ecx, [esp + 0x10]
call sub.MFC42.DLL_CString::CString_1
mov eax, dword [esp + 0x1c]
mov byte [esp + 0x30], 3
cmp eax, ebx
je 0x494d8b
lea ecx, [eax - 1]
mov al, byte [eax - 1]
cmp al, bl
je 0x494d82
cmp al, 0xff
je 0x494d82
dec al
mov byte [ecx], al
jmp 0x494d8b
push ecx
call sub.MFC42.DLL_operatordelete
add esp, 4
lea ecx, [esp + 0x38]
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x20], ebx
mov dword [esp + 0x24], ebx
call fcn.0049aadc
mov eax, dword [esp + 0x48]
mov byte [esp + 0x30], 4
cmp eax, ebx
push str.LogDll.dll
je 0x494dbf
push eax
lea ecx, [esp + 0x40]
push 0x4ae86c
push ecx
jmp 0x494dce
mov edx, dword [esp + 0x10]
lea eax, [esp + 0x3c]
push edx
push 0x4ae86c
push eax
call sub.MFC42.DLL_CString::Format
mov ecx, dword [esp + 0x48]
add esp, 0x10
push ecx
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov dword [0x4d2994], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea ecx, [esp + 0x44]
mov esi, eax
call fcn.0049aadc
mov edx, dword [esp + 0x38]
push esi
push edx
lea eax, [esp + 0x4c]
push 0x4c6a6c
push eax
mov byte [esp + 0x40], 5
call sub.MFC42.DLL_CString::Format
mov eax, dword [0x4d2994]
add esp, 0x10
cmp eax, ebx
jne 0x494e53
lea ecx, [esp + 0x44]
mov byte [esp + 0x30], 4
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0x38]
mov byte [esp + 0x30], 3
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0xc]
mov byte [esp + 0x30], bl
call sub.MFC42.DLL_CString::CString
xor ecx, ecx
cmp ecx, 0x4d2ca0
jmp 0x494f94
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push edi
push str.InitLog
push eax
xor edi, edi
call esi
mov edx, dword [0x4d2994]
push str.FiniLog
push edx
mov dword [0x4d29a8], eax
call esi
mov dword [0x4d29a4], eax
mov eax, dword [0x4d2994]
push str.WriteLog
push eax
call esi
mov ecx, dword [0x4d2994]
push str.GetLogLevel
push ecx
mov dword [0x4d29a0], eax
call esi
mov edx, dword [0x4d2994]
push str.RegModuleName
push edx
mov dword [0x4d2990], eax
call esi
mov dword [0x4d299c], eax
mov eax, dword [0x4d2994]
push str.GetLogMsgCount
push eax
call esi
mov dword [0x4d2998], eax
mov eax, dword [0x4d29a8]
cmp eax, ebx
je 0x494edc
mov ecx, dword [esp + 0x40]
push ebp
push ecx
call eax
add esp, 8
mov edi, eax
lea ecx, [esp + 0x48]
mov byte [esp + 0x34], 4
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0x3c]
mov byte [esp + 0x34], 3
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0x10]
mov byte [esp + 0x34], bl
call sub.MFC42.DLL_CString::CString
xor edx, edx
cmp edx, 0x4d2ca0
je 0x494f1a
push 0x4d2ca4
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x1c]
mov dword fs:[0], ecx
add esp, 0x28
ret
cmp eax, 1
jne 0x495012
xor eax, eax
mov dword [esp + 0x10], 0x4a48a8
cmp eax, 0x4d2ca0
mov dword [esp + 0x14], 0x4d2ca0
je 0x494f5c
push 0x4d2ca4
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [0x4c6a20]
mov dword [esp + 0x30], 6
inc eax
cmp eax, ebx
mov dword [0x4c6a20], eax
jle 0x494f7d
xor ecx, ecx
cmp ecx, 0x4d2ca0
jmp 0x494ff1
mov eax, dword [0x4d29a4]
cmp eax, ebx
je 0x494f8c
call eax
cmp eax, ebx
je 0x494fb6
xor edx, edx
cmp edx, 0x4d2ca0
je 0x494fa1
push 0x4d2ca4
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
or eax, 0xffffffff
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x1c]
mov dword fs:[0], ecx
add esp, 0x28
ret
mov eax, dword [0x4d2994]
mov dword [0x4d29a8], ebx
cmp eax, ebx
mov dword [0x4d29a4], ebx
mov dword [0x4d29a0], ebx
mov dword [0x4d2990], ebx
mov dword [0x4d299c], ebx
je 0x494fea
push eax
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov dword [0x4d2994], ebx
xor eax, eax
cmp eax, 0x4d2ca0
je 0x494ffe
push 0x4d2ca4
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
pop esi
pop ebp
xor eax, eax
pop ebx
mov ecx, dword [esp + 0x1c]
mov dword fs:[0], ecx
add esp, 0x28
ret
cmp eax, 2
jne 0x495055
cmp dword [0x4d2994], ebx
je 0x494fa1
mov ecx, dword [0x4d29a0]
xor eax, eax
cmp ecx, ebx
je 0x494fa4
mov edx, dword [esp + 0x40]
mov eax, dword [esp + 0x3c]
push edx
mov edx, dword [esp + 0x48]
push eax
push edx
call ecx
add esp, 0xc
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x1c]
mov dword fs:[0], ecx
add esp, 0x28
ret
cmp eax, 5
jne 0x49508b
cmp dword [0x4d2994], ebx
je 0x494fa1
mov ecx, dword [0x4d2998]
or eax, 0xffffffff
cmp ecx, ebx
je 0x494fa4
call ecx
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x1c]
mov dword fs:[0], ecx
add esp, 0x28
ret
cmp eax, 3
jne 0x4950d3
cmp dword [0x4d2994], ebx
jne 0x4950af
pop esi
pop ebp
mov eax, 0xffffd8f0
pop ebx
mov ecx, dword [esp + 0x1c]
mov dword fs:[0], ecx
add esp, 0x28
ret
mov ecx, dword [0x4d2990]
xor eax, eax
cmp ecx, ebx
je 0x494fa4
call ecx
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x1c]
mov dword fs:[0], ecx
add esp, 0x28
ret
cmp eax, 4
jne 0x494fa1
cmp dword [0x4d2994], ebx
jne 0x4950fb
pop esi
pop ebp
mov eax, 0xffffd8f0
pop ebx
mov ecx, dword [esp + 0x1c]
mov dword fs:[0], ecx
add esp, 0x28
ret
mov ecx, dword [0x4d299c]
xor eax, eax
cmp ecx, ebx
je 0x494fa4
mov eax, dword [esp + 0x40]
mov edx, dword [esp + 0x3c]
push eax
push edx
call ecx
mov ecx, dword [esp + 0x30]
add esp, 8
mov dword fs:[0], ecx
pop esi
pop ebp
pop ebx
add esp, 0x28
ret