Function at 0x10002740
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x22c
mov eax, dword [0x10042040]
xor eax, esp
mov dword [esp + 0x228], eax
push ebx
push esi
mov esi, dword [0x1004a008]
push edi
test esi, esi
je 0x10002a19
call fcn.100022a0
mov ecx, eax
lea eax, [ebp + 0x10]
push eax
push 0
push dword [ebp + 0xc]
mov eax, dword [ecx]
push 0
push 0
push dword [ecx + 4]
or eax, 2
push eax
call fcn.10020ebc
add esp, 0x1c
cmp esi, 1
mov esi, eax
jne 0x100027a1
or eax, 0xffffffff
test esi, esi
cmovs esi, eax
jmp 0x100027aa
or eax, 0xffffffff
test esi, esi
cmovs esi, eax
inc esi
push esi
call fcn.1001533e
add esp, 4
mov edi, eax
push esi
push 0
push edi
call fcn.10016fc0
add esp, 0xc
lea eax, [ebp + 0x10]
mov edx, esi
mov ecx, edi
push eax
push dword [ebp + 0xc]
push 0xffffffffffffffff
call fcn.10002370
mov eax, dword [0x1004a008]
add esp, 0xc
cmp eax, 1
jne 0x1000289d
push 0x100484e8
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
push 0
push 0x40000000
push 4
push 0
push 2
push 0x40000000
push 0x10049300
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x1000288d
push 0
push 0
push 1
push 0
call dword [sym.imp.KERNEL32.dll_CreateEventW]
mov dword [esp + 0x10], eax
test eax, eax
je 0x10002886
mov dword [esp + 0x24], eax
xorps xmm0, xmm0
lea eax, [esp + 0x14]
movlpd qword [esp + 0x14], xmm0
push eax
push 0
push esi
push edi
push ebx
mov dword [esp + 0x30], 0xffffffff
mov dword [esp + 0x34], 0xffffffff
mov byte [edi + esi - 1], 0xa
call dword [sym.imp.KERNEL32.dll_WriteFile]
push 0xffffffffffffffff
push dword [esp + 0x14]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebx
call esi
push dword [esp + 0x10]
call esi
push 0x100484e8
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x10002a10
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0x100484e8
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x10002a10
cmp eax, 2
jne 0x10002a10
mov esi, dword [ebp + 8]
mov ebx, dword [sym.imp.KERNEL32.dll_GetStdHandle]
cmp esi, 1
jne 0x1000293c
push 0xc
push 0xfffffffffffffff5
call ebx
push eax
call dword [sym.imp.KERNEL32.dll_SetConsoleTextAttribute]
test eax, eax
jne 0x10002923
push 0x208
push eax
lea eax, [esp + 0x30]
push eax
call fcn.10016fc0
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
add esp, 0xc
call esi
push eax
push str._r_nSetConsoleTextAttribute_Failed__Error:__lu_n
push 0xffffffffffffffff
lea eax, [esp + 0x34]
push 0x104
push eax
call fcn.10002350
add esp, 0x14
lea eax, [esp + 0x28]
push eax
push 0x100361a4
call fcn.100022b0
add esp, 8
push edi
push 0x100361ac
call fcn.100022e0
add esp, 8
jmp 0x100029be
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
push edi
push 0x100361ac
call fcn.100022e0
add esp, 8
jmp 0x100029be
cmp esi, 2
jne 0x100029a6
push 9
push 0xfffffffffffffff5
call ebx
push eax
call dword [sym.imp.KERNEL32.dll_SetConsoleTextAttribute]
test eax, eax
jne 0x100029a6
push 0x208
push eax
lea eax, [esp + 0x30]
push eax
call fcn.10016fc0
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
add esp, 0xc
call esi
push eax
push str._r_nSetConsoleTextAttribute_Failed__Error:__lu_n
push 0xffffffffffffffff
lea eax, [esp + 0x34]
push 0x104
push eax
call fcn.10002350
add esp, 0x14
lea eax, [esp + 0x28]
push eax
push 0x100361a4
call fcn.100022b0
push edi
push 0x100361ac
call fcn.100022e0
add esp, 0x10
jmp 0x100029be
push edi
push 0x100361ac
call fcn.100022e0
add esp, 8
test esi, esi
je 0x10002a10
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
push 7
push 0xfffffffffffffff5
call ebx
push eax
call dword [sym.imp.KERNEL32.dll_SetConsoleTextAttribute]
test eax, eax
jne 0x10002a10
push 0x208
push eax
lea eax, [esp + 0x30]
push eax
call fcn.10016fc0
add esp, 0xc
call esi
push eax
push str._r_nSetConsoleTextAttribute_Failed__Error:__lu_n
push 0xffffffffffffffff
lea eax, [esp + 0x34]
push 0x104
push eax
call fcn.10002350
add esp, 0x14
lea eax, [esp + 0x28]
push eax
push 0x100361a4
call fcn.100022b0
add esp, 8
push edi
call fcn.100151e1
add esp, 4
mov ecx, dword [esp + 0x234]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.100151d3
mov esp, ebp
pop ebp
ret