Function at 0x402a1e
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x74
push ebx
mov ebx, dword [sym.imp.KERNEL32.dll_WriteFile]
push esi
push edi
mov esi, str.com1
lea edi, [ebp - 0x14]
movsd dword es:[edi], dword [esi]
movsb byte es:[edi], byte [esi]
mov dword [0x41df44], 1
mov dword [ebp - 0xc], 0x1c200
mov byte [ebp - 1], 0x31
mov al, byte [ebp - 1]
mov byte [ebp - 0x11], al
xor eax, eax
push eax
push 0x80
push 3
push eax
push eax
push 0xc0000000
lea eax, [ebp - 0x14]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [0x41defc], eax
cmp eax, 0xffffffff
je 0x402b9c
lea ecx, [ebp - 0x3c]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_GetCommTimeouts]
push 5
pop ecx
lea eax, [ebp - 0x28]
push eax
push dword [0x41defc]
lea esi, [ebp - 0x3c]
lea edi, [ebp - 0x28]
rep movsd dword es:[edi], dword [esi]
and dword [ebp - 0x24], 0
mov dword [ebp - 0x28], 0x14
mov dword [ebp - 0x20], 0x64
call dword [sym.imp.KERNEL32.dll_SetCommTimeouts]
lea eax, [ebp - 0x74]
push eax
push dword [0x41defc]
mov dword [ebp - 0x74], 0x1c
call dword [sym.imp.KERNEL32.dll_GetCommState]
mov eax, dword [ebp - 0xc]
push 7
pop ecx
lea esi, [ebp - 0x74]
lea edi, [ebp - 0x58]
rep movsd dword es:[edi], dword [esi]
and dword [ebp - 0x50], 0xfffffffd
mov dword [ebp - 0x54], eax
lea eax, [ebp - 0x58]
push eax
push dword [0x41defc]
mov byte [ebp - 0x46], 8
mov byte [ebp - 0x45], 0
mov byte [ebp - 0x44], 0
call dword [sym.imp.KERNEL32.dll_SetCommState]
push 0
lea eax, [ebp - 8]
push eax
push 1
push 0x419704
push dword [0x41defc]
call ebx
mov esi, dword [sym.imp.KERNEL32.dll_Sleep]
push 0x32
call esi
mov edi, dword [sym.imp.KERNEL32.dll_PurgeComm]
push 0xf
push dword [0x41defc]
call edi
push 0
lea eax, [ebp - 8]
push eax
push 2
push 0x419708
push dword [0x41defc]
call ebx
push 0
lea eax, [ebp - 8]
push eax
push 2
push 0x41dfc8
push dword [0x41defc]
call dword [sym.imp.KERNEL32.dll_ReadFile]
cmp dword [ebp - 8], 2
jne 0x402b70
cmp byte [0x41dfc8], 0x4f
jne 0x402b70
cmp byte [0x41dfc9], 0x4b
je 0x402be0
lea eax, [ebp - 0x3c]
push eax
push dword [0x41defc]
call dword [sym.imp.KERNEL32.dll_SetCommTimeouts]
lea eax, [ebp - 0x74]
push eax
push dword [0x41defc]
call dword [sym.imp.KERNEL32.dll_SetCommState]
push dword [0x41defc]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
inc byte [ebp - 1]
cmp byte [ebp - 1], 0x39
jbe 0x402a4c
sub dword [ebp - 0xc], 0x19c80
and dword [0x41df44], 0
cmp dword [ebp - 0xc], 0x2580
jge 0x402a48
push 0x10
push 0x419710
push 0x419718
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
xor eax, eax
inc eax
pop edi
pop esi
pop ebx
leave
ret
lea eax, [ebp - 0x28]
push eax
push dword [0x41defc]
mov dword [ebp - 0x20], 0xc8
call dword [sym.imp.KERNEL32.dll_SetCommTimeouts]
push 0x32
call esi
push 0xf
push dword [0x41defc]
call edi
xor esi, esi
push esi
lea eax, [ebp - 8]
push eax
push 2
push 0x41970c
push dword [0x41defc]
call ebx
push esi
lea eax, [ebp - 8]
push eax
push 0x7f
push 0x41dfc8
push dword [0x41defc]
mov byte [0x41dfc8], 0
call dword [sym.imp.KERNEL32.dll_ReadFile]
call fcn.00402fda
cmp dword [0x41e054], 3
jne 0x402c5a
cmp dword [0x41df44], esi
jne 0x402c5a
mov dword [0x41e054], 1
xor eax, eax
jmp 0x402bdb