Function at 0x100321f0
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x10082750
mov eax, dword fs:[0]
push eax
sub esp, 0x82c
mov eax, dword [0x100abec0]
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 - 0x830], edi
mov eax, dword [edi + 4]
lea esi, [edi + 0x108]
shr eax, 1
test al, 1
je 0x100322f1
mov dword [ebp - 0x838], esi
test esi, esi
je 0x10032254
lea eax, [esi + 0x14]
push eax
mov dword [ebp - 0x82c], eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
jmp 0x1003225e
mov dword [ebp - 0x82c], 0x14
mov dword [ebp - 4], 0
cmp dword [edi + 0x114], 0
jne 0x10032272
xor edi, edi
jmp 0x100322da
mov edx, dword [edi + 0x10c]
test edx, edx
je 0x100322a3
mov eax, dword [edx + 4]
sub eax, dword [edx]
cmp eax, 0x400
jae 0x1003228f
mov ecx, dword [edx + 4]
sub ecx, dword [edx]
jmp 0x100322a5
mov eax, dword [edx]
mov ecx, 0x400
add eax, 0x10
mov dword [ebp - 0x828], ecx
add eax, edx
jmp 0x100322c0
xor ecx, ecx
mov dword [ebp - 0x828], ecx
test edx, edx
je 0x100322b8
mov eax, dword [edx]
add eax, 0x10
add eax, edx
jmp 0x100322c0
xor eax, eax
mov dword [ebp - 0x828], ecx
push ecx
push eax
mov ecx, edi
call fcn.10031640
push dword [ebp - 0x828]
mov ecx, esi
push 0
call fcn.10031d00
mov edi, eax
test esi, esi
je 0x100322ea
push dword [ebp - 0x82c]
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, edi
jmp 0x100324e5
add edi, 0x11c
mov dword [ebp - 0x834], 0
push edi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
push 0x400
lea eax, [ebp - 0x824]
mov ecx, esi
push eax
call fcn.10031d00
mov esi, eax
push edi
mov dword [ebp - 0x838], esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
test esi, esi
je 0x100324e3
mov edi, dword [ebp - 0x830]
xor ecx, ecx
nop word [eax + eax]
lea eax, [ebp - 0x824]
sub esi, ecx
add eax, ecx
mov dword [ebp - 0x830], eax
mov eax, dword [edi + 8]
cmp eax, 0xffffffff
je 0x100324cb
test esi, esi
je 0x100324cb
push 0
lea ecx, [ebp - 0x82c]
mov dword [ebp - 0x82c], 0
push ecx
push eax
mov dword [ebp - 0x828], 0
call dword [sym.imp.KERNEL32.dll_ClearCommError]
test eax, eax
je 0x100323a0
cmp dword [ebp - 0x82c], 0
jbe 0x100323a0
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 0x100323f3
lea eax, [edi + 0x188]
push eax
lea eax, [ebp - 0x828]
push eax
push esi
push dword [ebp - 0x830]
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x100323e5
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
je 0x100323e5
mov dword [ebp - 0x828], 0
jmp 0x1003241e
add dword [edi + 0x138], esi
mov eax, dword [ebp - 0x828]
jmp 0x10032416
push 0
lea eax, [ebp - 0x828]
push eax
push esi
push dword [ebp - 0x830]
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [ebp - 0x828]
add dword [edi + 0x138], eax
test eax, eax
jne 0x100324c3
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
lea eax, [ebp - 0x82c]
push 0
push eax
push dword [edi + 8]
call dword [sym.imp.KERNEL32.dll_ClearCommError]
push 0x400
lea eax, [ebp - 0x424]
push 0
push eax
call fcn.100750b0
add esp, 0xc
mov dword [ebp - 0x14], 0
xorps xmm0, xmm0
lea ecx, [ebp - 0x24]
movups xmmword [ebp - 0x24], xmm0
call fcn.10040670
push dword [ebp - 0x82c]
push esi
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.10008b40
lea eax, [ebp - 0x424]
add esp, 0x24
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x100324a4
sub eax, edx
push eax
lea eax, [ebp - 0x424]
push eax
call fcn.100407c0
mov eax, dword [ebp - 0x828]
add esp, 8
mov ecx, dword [ebp - 0x834]
jmp 0x100324cd
xor eax, eax
mov esi, dword [ebp - 0x838]
add ecx, eax
mov dword [ebp - 0x834], ecx
cmp ecx, esi
jb 0x10032340
mov eax, esi
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.10071677
mov esp, ebp
pop ebp
ret 4