Function at 0x1002e600
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x418
mov eax, dword [0x100a2d20]
xor eax, ebp
mov dword [ebp - 4], eax
push edi
mov edi, ecx
cmp byte [edi + 0x13c], 0
je 0x1002e8a4
push ebx
push esi
push 0xc8
push dword [edi + 0x164]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp byte [edi + 0x13c], 0
mov dword [ebp - 0x418], eax
je 0x1002e885
lea esi, [edi + 0x108]
nop
test esi, esi
je 0x1002e669
lea eax, [esi + 0x14]
push eax
mov dword [ebp - 0x408], eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
lea eax, [esi + 0x14]
jmp 0x1002e674
mov eax, 0x14
mov dword [ebp - 0x408], eax
mov ebx, dword [esi + 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
test ebx, ebx
je 0x1002e87f
mov eax, dword [edi + 4]
shr eax, 1
test al, 1
je 0x1002e72a
mov ebx, dword [ebp - 0x408]
test esi, esi
je 0x1002e6a5
mov eax, dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
push ebx
call eax
cmp dword [edi + 0x114], 0
jne 0x1002e6c2
test esi, esi
je 0x1002e872
push ebx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x1002e872
mov ecx, dword [edi + 0x10c]
test ecx, ecx
je 0x1002e6ed
mov eax, dword [ecx + 4]
sub eax, dword [ecx]
cmp eax, 0x400
jae 0x1002e6df
mov ebx, dword [ecx + 4]
sub ebx, dword [ecx]
jmp 0x1002e6ef
mov eax, dword [ecx]
mov ebx, 0x400
add eax, 0x10
add eax, ecx
jmp 0x1002e6fe
xor ebx, ebx
test ecx, ecx
je 0x1002e6fc
mov eax, dword [ecx]
add eax, 0x10
add eax, ecx
jmp 0x1002e6fe
xor eax, eax
push ebx
push eax
mov ecx, edi
call fcn.1002cf80
push ebx
push 0
mov ecx, esi
call fcn.1002d540
test esi, esi
je 0x1002e872
push dword [ebp - 0x408]
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x1002e872
mov eax, dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
lea ebx, [edi + 0x11c]
push ebx
mov dword [ebp - 0x40c], 0
call eax
push 0x400
lea eax, [ebp - 0x404]
mov ecx, esi
push eax
call fcn.1002d540
push ebx
mov dword [ebp - 0x408], eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
cmp dword [ebp - 0x408], 0
jbe 0x1002e872
mov ecx, dword [ebp - 0x40c]
mov esi, dword [ebp - 0x408]
nop dword [eax + eax]
lea eax, [ebp - 0x404]
mov ebx, esi
add eax, ecx
sub ebx, ecx
mov dword [ebp - 0x410], eax
mov eax, dword [edi + 8]
cmp eax, 0xffffffff
je 0x1002e85a
test ebx, ebx
je 0x1002e85a
push 0
lea ecx, [ebp - 0x414]
mov dword [ebp - 0x408], 0
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_ClearCommError]
test eax, eax
je 0x1002e7d8
cmp dword [ebp - 0x414], 0
jbe 0x1002e7d8
push 1
push dword [edi + 8]
call dword [sym.imp.KERNEL32.dll_PurgeComm]
mov eax, dword [edi + 4]
mov ecx, dword [edi + 8]
shr eax, 1
test al, 1
je 0x1002e82f
lea eax, [edi + 0x188]
push eax
lea eax, [ebp - 0x408]
push eax
push ebx
push dword [ebp - 0x410]
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x1002e81b
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
je 0x1002e81b
mov ecx, dword [ebp - 0x40c]
xor eax, eax
jmp 0x1002e85c
add dword [edi + 0x138], ebx
mov eax, dword [ebp - 0x408]
mov ecx, dword [ebp - 0x40c]
jmp 0x1002e85c
push 0
lea eax, [ebp - 0x408]
push eax
push ebx
push dword [ebp - 0x410]
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [ebp - 0x408]
add dword [edi + 0x138], eax
mov ecx, dword [ebp - 0x40c]
jmp 0x1002e85c
xor eax, eax
add ecx, eax
mov dword [ebp - 0x40c], ecx
cmp ecx, esi
jb 0x1002e780
lea esi, [edi + 0x108]
cmp byte [edi + 0x13c], 0
jne 0x1002e650
mov eax, dword [ebp - 0x418]
test eax, eax
jne 0x1002e895
push dword [edi + 0x14c]
call dword [sym.imp.KERNEL32.dll_ResetEvent]
cmp byte [edi + 0x13c], 0
jne 0x1002e625
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor eax, eax
xor ecx, ebp
pop edi
call fcn.100699c7
mov esp, ebp
pop ebp
ret