Function at 0x100333a0
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x10085040
mov eax, dword fs:[0]
push eax
sub esp, 0x840
mov eax, dword [0x100a94c0]
xor eax, ebp
mov dword [ebp - 0x10], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, ecx
mov dword [ebp - 0x83c], edi
cmp dword [edi + 8], 0xffffffff
jne 0x100333e5
mov eax, 1
jmp 0x1003380c
cmp byte [edi + 0x13c], 0
je 0x1003380a
cmp dword [edi + 8], 0xffffffff
je 0x1003380a
push 0x32
push dword [edi + 0x14c]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp byte [edi + 0x13c], 0
je 0x1003380a
test eax, eax
je 0x100334cd
cmp eax, 0x102
jne 0x100337fd
mov eax, dword [edi + 8]
cmp eax, 0xffffffff
je 0x10033457
lea ecx, [ebp - 0x830]
push ecx
lea ecx, [ebp - 0x84c]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_ClearCommError]
test eax, eax
je 0x10033457
mov eax, dword [ebp - 0x82c]
test eax, eax
je 0x1003347d
jmp 0x1003345a
or eax, 0xffffffff
test byte [edi + 4], 4
je 0x1003346e
push eax
mov ecx, edi
call fcn.10032ac0
mov eax, dword [edi + 0xe8]
cmp eax, dword [edi + 0x170]
jb 0x1003347d
mov eax, dword [edi]
mov ecx, edi
call dword [eax + 0x1c]
test byte [edi + 4], 8
je 0x100337fd
lea esi, [edi + 0x108]
test esi, esi
je 0x100334a9
lea eax, [esi + 0x14]
push eax
mov dword [ebp - 0x840], eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [ebp - 0x840]
jmp 0x100334ae
mov eax, 0x14
mov esi, dword [esi + 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
test esi, esi
je 0x100337fd
push ecx
mov ecx, edi
call fcn.10032b80
jmp 0x100337fd
test byte [edi + 4], 8
je 0x100337f1
lea esi, [edi + 0x108]
mov dword [ebp - 0x848], esi
test esi, esi
je 0x100334fc
lea eax, [esi + 0x14]
push eax
mov dword [ebp - 0x838], eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
lea eax, [esi + 0x14]
jmp 0x10033507
mov eax, 0x14
mov dword [ebp - 0x838], eax
mov edi, dword [esi + 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
test edi, edi
mov edi, dword [ebp - 0x83c]
je 0x100337f1
mov eax, dword [edi + 4]
shr eax, 1
test al, 1
je 0x100335db
mov dword [ebp - 0x840], esi
test esi, esi
je 0x10033542
push dword [ebp - 0x838]
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov dword [ebp - 4], 0
cmp dword [edi + 0x114], 0
jne 0x10033570
mov dword [ebp - 4], 0xffffffff
test esi, esi
je 0x100337e7
lea eax, [esi + 0x14]
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x100337e7
mov edx, dword [edi + 0x10c]
test edx, edx
je 0x100335a1
mov eax, dword [edx + 4]
sub eax, dword [edx]
cmp eax, 0x400
jae 0x1003358d
mov ecx, dword [edx + 4]
sub ecx, dword [edx]
jmp 0x100335a3
mov eax, dword [edx]
mov ecx, 0x400
add eax, 0x10
mov dword [ebp - 0x834], ecx
add eax, edx
jmp 0x100335be
xor ecx, ecx
mov dword [ebp - 0x834], ecx
test edx, edx
je 0x100335b6
mov eax, dword [edx]
add eax, 0x10
add eax, edx
jmp 0x100335be
xor eax, eax
mov dword [ebp - 0x834], ecx
push ecx
push eax
mov ecx, edi
call fcn.10031fb0
push dword [ebp - 0x834]
mov ecx, esi
push 0
call fcn.10032670
jmp 0x10033552
add edi, 0x11c
mov dword [ebp - 0x838], 0
push edi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
push 0x400
lea eax, [ebp - 0x824]
mov ecx, esi
push eax
call fcn.10032670
push edi
mov dword [ebp - 0x840], eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [ebp - 0x840]
mov edi, dword [ebp - 0x83c]
test eax, eax
je 0x100337e7
mov esi, dword [ebp - 0x838]
nop dword [eax]
mov ecx, dword [edi + 8]
sub eax, esi
mov dword [ebp - 0x838], eax
cmp ecx, 0xffffffff
je 0x100337cf
test eax, eax
je 0x100337cf
push 0
lea eax, [ebp - 0x844]
mov dword [ebp - 0x844], 0
push eax
push ecx
mov dword [ebp - 0x834], 0
call dword [sym.imp.KERNEL32.dll_ClearCommError]
test eax, eax
je 0x10033688
cmp dword [ebp - 0x844], 0
jbe 0x10033688
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 0x100336e9
lea eax, [edi + 0x188]
push eax
lea eax, [ebp - 0x834]
push eax
push dword [ebp - 0x838]
lea eax, [ebp - 0x824]
add eax, esi
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x100336d5
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
je 0x100336d5
mov dword [ebp - 0x834], 0
jmp 0x1003371c
mov eax, dword [ebp - 0x838]
add dword [edi + 0x138], eax
mov eax, dword [ebp - 0x834]
jmp 0x10033714
push 0
lea eax, [ebp - 0x834]
push eax
push dword [ebp - 0x838]
lea eax, [ebp - 0x824]
add eax, esi
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [ebp - 0x834]
add dword [edi + 0x138], eax
test eax, eax
jne 0x100337d1
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
lea eax, [ebp - 0x844]
push 0
push eax
mov eax, dword [ebp - 0x83c]
push dword [eax + 8]
call dword [sym.imp.KERNEL32.dll_ClearCommError]
push 0x400
lea eax, [ebp - 0x424]
push 0
push eax
call fcn.10056430
add esp, 0xc
mov dword [ebp - 0x14], 0
xorps xmm0, xmm0
lea ecx, [ebp - 0x24]
movups xmmword [ebp - 0x24], xmm0
call fcn.10041020
push dword [ebp - 0x844]
push edi
push 0x20c
push str.CnComm::WritePort
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
push eax
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
push eax
lea eax, [ebp - 0x24]
push eax
lea eax, [ebp - 0x424]
push str._s_t__d__d___ERROR____s:_d__GetLastError__d_dwError___d_n
push eax
call fcn.10008e00
lea eax, [ebp - 0x424]
add esp, 0x24
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x100337a8
sub eax, edx
push eax
lea eax, [ebp - 0x424]
push eax
call fcn.10041170
mov eax, dword [ebp - 0x834]
add esp, 8
mov edi, dword [ebp - 0x83c]
jmp 0x100337d1
xor eax, eax
add esi, eax
mov eax, dword [ebp - 0x840]
cmp esi, eax
jb 0x10033630
mov esi, dword [ebp - 0x848]
test byte [edi + 4], 8
jne 0x100334e3
push dword [edi + 0x14c]
call dword [sym.imp.KERNEL32.dll_ResetEvent]
cmp byte [edi + 0x13c], 0
jne 0x100333f2
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.10052d76
mov esp, ebp
pop ebp
ret