Function at 0x401b70
Capabilities:
Resolve function by parsing pe exports

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
mov eax, 0x30ec
call fcn.0051a4c0
mov eax, dword [0x5b339c]
xor eax, esp
mov dword [esp + 0x30e8], eax
push ebx
mov ebx, dword [ebp + 0x10]
push esi
push edi
mov edi, dword [ebp + 8]
test edi, edi
je 0x40215a
mov esi, dword [ebp + 0xc]
push esi
push edi
call fcn.00401b30
add esp, 8
cmp eax, 1
jne 0x40215a
mov eax, dword [edi + 8]
mov ecx, dword [eax + 0xc]
push 0xfa
push ecx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov eax, dword [edi + 8]
cmp dword [eax + 0x230], 0
je 0x40215a
cmp dword [eax + 0x18], 0
je 0x40214d
lea edx, [esp + 0x20]
push edx
call dword [sym.imp.MSVCR90.dll__ftime64]
lea eax, [esp + 0x24]
push eax
lea ecx, [esp + 0x3c]
push ecx
call dword [sym.imp.MSVCR90.dll__localtime64_s]
add esp, 0xc
test ebx, ebx
jne 0x401c08
mov ebx, 0x57ea28
mov eax, dword [edi + 8]
lea edx, [eax + 0x24c]
push edx
push ebx
add eax, 0x238
push eax
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
xor edx, edx
mov ecx, 0x2710
div ecx
mov eax, dword [esp + 0x40]
mov ecx, dword [esp + 0x44]
push edx
movzx edx, word [esp + 0x38]
push esi
push edx
mov edx, dword [esp + 0x54]
push eax
mov eax, dword [esp + 0x5c]
push ecx
mov ecx, dword [esp + 0x64]
push edx
push eax
inc ecx
push ecx
lea edx, [esp + 0x291c]
push str._n__.2d__.2d__.2d:_.2d:_.2d._.3hd___1d__.4d___s_s__s
push edx
mov edx, 0x400
call fcn.00401000
push 0x800
lea eax, [esp + 0xd28]
push 0
push eax
call sub.MSVCR90.dll_memset
mov edx, dword [ebp + 0x14]
add esp, 0x40
lea ecx, [ebp + 0x18]
push ecx
push edx
push 0xffffffffffffffff
lea eax, [esp + 0xcfc]
push 0x400
push eax
call dword [sym.imp.MSVCR90.dll__vsnwprintf_s]
add esp, 0x14
mov dword [esp + 0x18], eax
test eax, eax
jge 0x401ca8
mov dword [esp + 0x18], 0x3ff
lea ecx, [esp + 0x28f0]
push ecx
lea edx, [esp + 0x18f4]
push 0x800
push edx
call dword [sym.imp.MSVCR90.dll_wcscpy_s]
mov ebx, dword [sym.imp.MSVCR90.dll_wcscat_s]
lea eax, [esp + 0xcfc]
push eax
lea ecx, [esp + 0x1900]
push 0x800
push ecx
call ebx
push 0x57eb08
lea edx, [esp + 0x190c]
push 0x800
push edx
call ebx
add esp, 0x24
test esi, esi
je 0x401d0f
cmp esi, 9
je 0x401d0f
mov eax, dword [edi + 8]
mov eax, dword [eax + 0x1c]
cmp esi, eax
jg 0x401d2c
cmp eax, 8
je 0x401d2c
mov edx, dword [edi + 8]
mov eax, dword [edx + 0x18]
lea ecx, [esp + 0x18f0]
push ecx
push 0x57eb0c
push eax
call dword [sym.imp.MSVCR90.dll_fwprintf]
add esp, 0xc
mov eax, dword [edi + 8]
cmp dword [eax + 0x268], 0
jle 0x401de7
xor ebx, ebx
mov edi, edi
cmp esi, dword [ebx + eax + 0x470]
jle 0x401d56
test esi, esi
je 0x401d56
cmp esi, 9
jne 0x401dd5
xor ecx, ecx
cmp dword [ebx + eax + 0x474], ecx
mov dword [esp + 0x10], ecx
jle 0x401dd5
mov dword [esp + 0x1c], ecx
mov ecx, dword [esp + 0x1c]
lea edx, [ebx + ecx]
lea eax, [edx + eax + 0x67c]
push eax
lea esi, [esp + 0x18f4]
call fcn.004018e0
test eax, eax
je 0x401db5
mov edx, dword [edi + 8]
mov eax, dword [ebx + edx + 0x478]
mov ecx, esi
push ecx
push 0x57eb0c
push eax
call dword [sym.imp.MSVCR90.dll_fwprintf]
mov ecx, dword [edi + 8]
mov edx, dword [ebx + ecx + 0x478]
push edx
call dword [sym.imp.MSVCR90.dll_fflush]
add esp, 0x10
mov ecx, dword [esp + 0x10]
mov eax, dword [edi + 8]
add dword [esp + 0x1c], 0x1fe
inc ecx
cmp ecx, dword [ebx + eax + 0x474]
mov dword [esp + 0x10], ecx
jl 0x401d69
mov esi, dword [ebp + 0xc]
add ebx, 0xc944
cmp ebx, 0x4e9e90
jl 0x401d40
mov eax, dword [edi + 8]
cmp dword [eax + 0x264], 1
jne 0x401e35
cmp dword [eax + 0x260], 0
je 0x401e35
mov edx, dword [eax + 0x26c]
lea ecx, [esp + 0x18f0]
push ecx
push edx
call dword [sym.imp.MSVCR90.dll_fwprintf]
mov eax, dword [edi + 8]
mov ecx, dword [eax + 0x26c]
mov ebx, dword [sym.imp.MSVCR90.dll_fflush]
push ecx
call ebx
mov edx, dword [edi + 8]
add esp, 0xc
mov dword [edx + 0x264], 0
jmp 0x401e3b
mov ebx, dword [sym.imp.MSVCR90.dll_fflush]
mov eax, dword [edi + 8]
mov ecx, dword [eax + 0x18]
push ecx
call ebx
mov eax, dword [edi + 8]
mov ecx, dword [esp + 0x1c]
add esp, 4
cmp dword [eax + 0x234], ecx
jge 0x401e99
lea edx, [ecx + ecx + 2]
mov dword [eax + 0x234], edx
mov eax, dword [edi + 8]
mov ecx, dword [eax + 0x234]
mov edx, dword [eax + 0x230]
push ecx
push edx
call dword [sym.imp.MSVCR90.dll_realloc]
mov ecx, dword [edi + 8]
mov dword [ecx + 0x230], eax
mov eax, dword [edi + 8]
add esp, 8
cmp dword [eax + 0x230], 0
jne 0x401e99
mov ecx, str.Unable_to_allocate_memory_for_logging_functions___logging_will_be_disabled
call fcn.00402430
cmp dword [eax + 0x24], 0
je 0x401f4c
mov edx, dword [eax + 0x18]
push edx
call ebx
add esp, 4
test eax, eax
je 0x401f8e
push 0x3d8
lea eax, [esp + 0xdc]
push 0
mov ecx, 0xa
mov esi, str.Couldnt_flush_file_for_forced_writes:
lea edi, [esp + 0xb8]
push eax
rep movsd dword es:[edi], dword [esi]
call sub.MSVCR90.dll_memset
call dword [sym.imp.MSVCR90.dll__errno]
mov ecx, dword [eax]
push ecx
lea edx, [esp + 0x1500]
push 0x400
push edx
call dword [sym.imp.MSVCR90.dll_strerror_s]
lea eax, [esp + 0x1508]
push eax
lea ecx, [esp + 0xcc]
push 0x400
push ecx
call dword [sym.imp.MSVCR90.dll_strcat_s]
add esp, 0x24
push 0x400
lea eax, [esp + 0x4b4]
push eax
push 0xffffffffffffffff
lea ecx, [esp + 0xbc]
push ecx
push 1
xor edx, edx
push 1
mov word [esp + 0x4c8], dx
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
lea ecx, [esp + 0x4b0]
call fcn.00402430
xor ecx, ecx
lea edx, [esp + 0x10]
mov dword [esp + 0x10], ecx
mov dword [esp + 0x14], ecx
mov eax, dword [eax + 0x18]
push edx
push eax
call dword [sym.imp.MSVCR90.dll_fgetpos]
mov ecx, dword [edi + 8]
mov eax, dword [ecx + 0x28]
mov ebx, dword [esp + 0x1c]
cdq
add esp, 8
cmp ebx, edx
jl 0x401f8e
jg 0x401f81
mov edx, dword [esp + 0x10]
cmp edx, eax
jbe 0x401f8e
mov eax, dword [ecx + 0x18]
push eax
call dword [sym.imp.MSVCR90.dll_rewind]
add esp, 4
test esi, esi
jne 0x402033
lea ecx, [esp + 0x20]
push ecx
lea edx, [esp + 0x5c]
push 0x1a
push edx
call dword [sym.imp.MSVCR90.dll__ctime64_s]
add esp, 0xc
push 0x1e
lea ecx, [esp + 0x78]
push ecx
push 0xffffffffffffffff
lea edx, [esp + 0x68]
push edx
push 1
xor eax, eax
push 1
mov byte [esp + 0x88], 0
mov word [esp + 0x8c], ax
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov eax, dword [edi + 8]
mov edx, dword [ebp + 0x14]
lea ecx, [ebp + 0x18]
push ecx
mov ecx, dword [eax + 0x234]
push edx
mov edx, dword [eax + 0x230]
push 0xffffffffffffffff
shr ecx, 1
push ecx
push edx
call dword [sym.imp.MSVCR90.dll__vsnwprintf_s]
mov eax, dword [edi + 8]
mov ecx, dword [eax + 0x230]
push ecx
lea edx, [esp + 0x8c]
push edx
push str.__s______s
push 0xffffffffffffffff
lea eax, [esp + 0x4d4]
push 0x41e
push eax
call dword [sym.imp.MSVCR90.dll__snwprintf_s]
add esp, 0x2c
lea ecx, [esp + 0x4b0]
call fcn.00402430
mov ecx, dword [edi + 8]
cmp dword [ecx + 0x20], 0
jne 0x402049
mov edx, dword [edi]
mov eax, dword [edx + 8]
mov ecx, edi
call eax
test eax, eax
je 0x40206f
mov eax, dword [edi + 8]
mov edx, dword [ebp + 0x14]
lea ecx, [ebp + 0x18]
push ecx
mov ecx, dword [eax + 0x234]
push edx
mov edx, dword [eax + 0x230]
push 0xffffffffffffffff
shr ecx, 1
push ecx
push edx
call dword [sym.imp.MSVCR90.dll__vsnwprintf_s]
add esp, 0x14
mov eax, dword [edi]
mov edx, dword [eax + 8]
mov ecx, edi
call edx
test eax, eax
je 0x402090
mov ecx, dword [edi + 8]
mov edx, dword [ecx + 0x230]
mov eax, dword [edi]
mov eax, dword [eax + 0xc]
push esi
push edx
mov ecx, edi
call eax
mov eax, dword [edi + 8]
cmp dword [eax + 0x20], 0
je 0x40214d
cmp dword [eax + 0x10], 0
je 0x402138
mov ebx, dword [sym.imp.KERNEL32.dll_SetConsoleTextAttribute]
lea ecx, [esi - 1]
cmp ecx, 8
ja case.0x4020b5.3
jmp dword [ecx*4 + 0x402170]
push 0x47
jmp 0x4020e6
mov edx, dword [eax + 0x10]
push 0x67
push edx
jmp 0x4020ea
mov eax, dword [eax + 0x10]
push 0x17
push eax
jmp 0x4020ea
push 2
jmp 0x4020e6
mov edx, dword [eax + 0x10]
push 5
push edx
jmp 0x4020ea
mov eax, dword [eax + 0x10]
push 0x27
push eax
jmp 0x4020ea
push 0x57
mov ecx, dword [eax + 0x10]
push ecx
call ebx
mov eax, dword [edi + 8]
mov ecx, dword [esp + 0x18]
mov esi, dword [sym.imp.KERNEL32.dll_WriteConsoleW]
push 0
lea edx, [esp + 0x14]
push edx
mov edx, dword [eax + 0x230]
mov eax, dword [eax + 0x10]
push ecx
push edx
push eax
call esi
cmp dword [ebp + 0xc], 3
je 0x40211f
mov ecx, dword [edi + 8]
mov edx, dword [ecx + 0x10]
push 7
push edx
call ebx
mov ecx, dword [edi + 8]
mov edx, dword [ecx + 0x10]
push 0
lea eax, [esp + 0x14]
push eax
push 1
push 0x57ebf0
push edx
call esi
jmp 0x40214d
mov eax, dword [eax + 0x230]
push eax
push 0x57ebf4
call dword [sym.imp.MSVCR90.dll_wprintf]
add esp, 8
mov ecx, dword [edi + 8]
mov edx, dword [ecx + 0xc]
push edx
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
mov ecx, dword [esp + 0x30f4]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.0051973e
mov esp, ebp
pop ebp
ret