Function at 0x49e6c0
Capabilities:
Link many functions at runtime

Disassembly:
mov eax, dword fs:[0]
push 0xffffffffffffffff
push 0x4a8f61
push eax
mov al, byte [0x5087cd]
mov dword fs:[0], esp
sub esp, 0x1c
test al, 1
push ebx
push ebp
push esi
jne 0x49e711
mov bl, al
push 0x5087e4
or bl, 1
mov dword [0x5087e0], 0x4b3d54
mov byte [0x5087cd], bl
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
push 0x49ee30
call fcn.004a52b2
add esp, 4
mov eax, dword [esp + 0x38]
xor ebx, ebx
cmp eax, ebx
jne 0x49e97f
cmp dword [0x5084c4], ebx
jne 0x49ea4e
xor eax, eax
mov dword [esp + 0x10], 0x4b3d58
cmp eax, 0x5087e0
mov dword [esp + 0x14], 0x5087e0
je 0x49e74f
push 0x5087e4
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [0x4e7f04]
mov dword [esp + 0x30], ebx
inc eax
cmp eax, ebx
mov dword [0x4e7f04], eax
jle 0x49e76f
xor ecx, ecx
cmp ecx, 0x5087e0
jmp 0x49ea41
cmp dword [0x5084c4], ebx
je 0x49e784
xor edx, edx
cmp edx, 0x5087e0
jmp 0x49ea41
mov ebp, dword [esp + 0x40]
lea eax, [esp + 0x18]
push ebp
push eax
call fcn.0049eb80
add esp, 8
mov eax, dword [eax + 4]
mov byte [esp + 0x30], 1
cmp eax, ebx
jne 0x49e7a7
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 0x49e7db
lea ecx, [eax - 1]
mov al, byte [eax - 1]
cmp al, bl
je 0x49e7d2
cmp al, 0xff
je 0x49e7d2
dec al
mov byte [ecx], al
jmp 0x49e7db
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.004a4816
mov eax, dword [esp + 0x48]
mov byte [esp + 0x30], 4
cmp eax, ebx
push str.LogDll.dll
je 0x49e80f
push eax
lea ecx, [esp + 0x40]
push 0x4e7df8
push ecx
jmp 0x49e81e
mov edx, dword [esp + 0x10]
lea eax, [esp + 0x3c]
push edx
push 0x4e7df8
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 [0x5084c4], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea ecx, [esp + 0x44]
mov esi, eax
call fcn.004a4816
mov edx, dword [esp + 0x38]
push esi
push edx
lea eax, [esp + 0x4c]
push 0x4e7edc
push eax
mov byte [esp + 0x40], 5
call sub.MFC42.DLL_CString::Format
mov eax, dword [0x5084c4]
add esp, 0x10
cmp eax, ebx
jne 0x49e8a3
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, 0x5087e0
jmp 0x49e9e4
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push edi
push str.InitLog
push eax
xor edi, edi
call esi
mov edx, dword [0x5084c4]
push str.FiniLog
push edx
mov dword [0x5084d8], eax
call esi
mov dword [0x5084d4], eax
mov eax, dword [0x5084c4]
push str.WriteLog
push eax
call esi
mov ecx, dword [0x5084c4]
push str.GetLogLevel
push ecx
mov dword [0x5084d0], eax
call esi
mov edx, dword [0x5084c4]
push str.RegModuleName
push edx
mov dword [0x5084c0], eax
call esi
mov dword [0x5084cc], eax
mov eax, dword [0x5084c4]
push str.GetLogMsgCount
push eax
call esi
mov dword [0x5084c8], eax
mov eax, dword [0x5084d8]
cmp eax, ebx
je 0x49e92c
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, 0x5087e0
je 0x49e96a
push 0x5087e4
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 0x49ea62
xor eax, eax
mov dword [esp + 0x10], 0x4b3d58
cmp eax, 0x5087e0
mov dword [esp + 0x14], 0x5087e0
je 0x49e9ac
push 0x5087e4
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [0x4e7e90]
mov dword [esp + 0x30], 6
inc eax
cmp eax, ebx
mov dword [0x4e7e90], eax
jle 0x49e9cd
xor ecx, ecx
cmp ecx, 0x5087e0
jmp 0x49ea41
mov eax, dword [0x5084d4]
cmp eax, ebx
je 0x49e9dc
call eax
cmp eax, ebx
je 0x49ea06
xor edx, edx
cmp edx, 0x5087e0
je 0x49e9f1
push 0x5087e4
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 [0x5084c4]
mov dword [0x5084d8], ebx
cmp eax, ebx
mov dword [0x5084d4], ebx
mov dword [0x5084d0], ebx
mov dword [0x5084c0], ebx
mov dword [0x5084cc], ebx
je 0x49ea3a
push eax
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov dword [0x5084c4], ebx
xor eax, eax
cmp eax, 0x5087e0
je 0x49ea4e
push 0x5087e4
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 0x49eaa5
cmp dword [0x5084c4], ebx
je 0x49e9f1
mov ecx, dword [0x5084d0]
xor eax, eax
cmp ecx, ebx
je 0x49e9f4
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 0x49eadb
cmp dword [0x5084c4], ebx
je 0x49e9f1
mov ecx, dword [0x5084c8]
or eax, 0xffffffff
cmp ecx, ebx
je 0x49e9f4
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 0x49eb23
cmp dword [0x5084c4], ebx
jne 0x49eaff
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 [0x5084c0]
xor eax, eax
cmp ecx, ebx
je 0x49e9f4
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 0x49e9f1
cmp dword [0x5084c4], ebx
jne 0x49eb4b
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 [0x5084cc]
xor eax, eax
cmp ecx, ebx
je 0x49e9f4
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