Function at 0x40114d
Capabilities:
Create thread
Read file on windows

Disassembly:
push ebp
mov ebp, esp
cmp dword [ebp + 8], 3
je 0x401172
push 2
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
push eax
push str.Usage:_asyncbuf_buf_size_bytes_initial_fill_bytes_n
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fputs]
add esp, 0xc
push 2
pop eax
pop ebp
ret
push ebx
mov ebx, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
push esi
push edi
push 0x8000
push 0
call ebx
mov esi, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__fileno]
push eax
call esi
mov edi, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__setmode]
pop ecx
pop ecx
push eax
call edi
pop ecx
pop ecx
test eax, eax
js 0x401246
push 0x8000
push 1
call ebx
push eax
call esi
pop ecx
pop ecx
push eax
call edi
pop ecx
pop ecx
test eax, eax
js 0x401246
mov esi, dword [ebp + 0xc]
xor ebx, ebx
mov edi, dword [sym.imp.api_ms_win_crt_convert_l1_1_0.dll_wcstoul]
push 0xa
push ebx
push dword [esi + 4]
call edi
mov ecx, 0x20000
add esp, 0xc
cmp eax, ecx
jae 0x4011e4
mov dword [0x404394], ecx
jmp 0x4011f3
mov ecx, 0x40000000
cmp eax, ecx
cmova eax, ecx
mov dword [0x404394], eax
push 0xa
push ebx
push dword [esi + 8]
call edi
mov edx, dword [0x404394]
push edx
lea ecx, [edx - 0x20000]
cmp eax, ecx
cmova eax, ecx
mov dword [0x404380], eax
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
add esp, 0x10
mov dword [0x4043b8], eax
test eax, eax
je 0x401246
mov esi, dword [sym.imp.KERNEL32.dll_CreateEventW]
push ebx
push ebx
push ebx
push ebx
call esi
mov dword [0x404398], eax
test eax, eax
jne 0x40124e
push dword [0x4043b8]
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
pop ecx
xor eax, eax
inc eax
pop edi
pop esi
pop ebx
pop ebp
ret
push ebx
push ebx
push ebx
push ebx
call esi
mov dword [0x404384], eax
test eax, eax
jne 0x40126b
push dword [0x404398]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x401239
mov esi, 0x4043a0
push esi
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
push ebx
push ebx
push ebx
push section..text
push ebx
push ebx
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__beginthreadex]
add esp, 0x18
mov dword [0x404388], eax
test eax, eax
jne 0x4012b2
push esi
call dword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
push dword [0x404384]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call esi
push dword [0x404398]
call esi
jmp 0x401239
mov ebx, dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov edi, dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
push esi
call ebx
mov eax, dword [0x40439c]
xor edx, edx
sub eax, dword [0x40438c]
dec eax
add eax, dword [0x404394]
div dword [0x404394]
push esi
cmp edx, 0x10000
jb 0x40135a
call edi
mov eax, dword [0x404394]
mov ecx, 0x10000
sub eax, dword [0x40438c]
mov esi, ecx
cmp eax, ecx
push 0
cmovb esi, eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
push eax
mov eax, dword [0x40438c]
add eax, dword [0x4043b8]
push esi
push 1
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
mov esi, eax
add esp, 0x14
test esi, esi
je 0x401378
push 0x4043a0
call ebx
mov eax, dword [0x40438c]
xor edx, edx
lea eax, [eax + esi]
mov esi, 0x4043a0
div dword [0x404394]
push esi
mov dword [0x40438c], edx
call edi
push dword [0x404398]
call dword [sym.imp.KERNEL32.dll_SetEvent]
jmp 0x4012be
cmp dword [0x404390], 0
jne 0x40139b
call edi
push 0xffffffffffffffff
push dword [0x404384]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
jmp 0x4012be
mov esi, 0x4043a0
push esi
call ebx
push esi
mov dword [0x404390], 1
call edi
push dword [0x404398]
call dword [sym.imp.KERNEL32.dll_SetEvent]
jmp 0x40139d
call edi
push 0xffffffffffffffff
push dword [0x404388]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push dword [0x404388]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call esi
push 0x4043a0
call dword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
push dword [0x404384]
call esi
push dword [0x404398]
call esi
push dword [0x4043b8]
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
pop ecx
xor eax, eax
jmp 0x401249