Function at 0x100041a7
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x24
mov eax, dword [0x10013284]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
push ebx
push esi
xor bl, bl
push edi
add eax, 6
mov esi, ecx
mov byte [ebp - 5], 0
mov byte [ebp - 6], bl
call fcn.1000f030
mov edx, dword [ebp + 0xc]
mov edi, esp
xor eax, eax
cmp edx, 2
lea ecx, [edi + 1]
mov dword [ebp - 0x18], edi
mov dword [ebp - 0x14], eax
mov byte [edi], 0x24
mov dword [ebp - 0xc], ecx
jl 0x1000404f
lea edi, [edx - 1]
mov cl, byte [esi + eax]
mov edx, dword [ebp - 0xc]
add byte [ebp - 5], cl
mov byte [edx], cl
mov cl, byte [esi + eax + 1]
mov byte [edx + 1], cl
add edx, 2
add eax, 2
add bl, cl
cmp eax, edi
mov dword [ebp - 0xc], edx
jl 0x10004027
mov ecx, edx
mov edx, dword [ebp + 0xc]
mov edi, esp
cmp eax, edx
jge 0x1000405b
mov al, byte [eax + esi]
mov byte [ecx], al
inc ecx
jmp 0x1000405e
mov al, byte [ebp - 6]
add bl, byte [ebp - 5]
mov byte [ecx], 0x23
add al, bl
movzx edx, al
mov eax, edx
shr eax, 4
inc ecx
cmp eax, 0xa
jge 0x10004079
add eax, 0x30
jmp 0x1000407c
add eax, 0x57
mov byte [ecx], al
and edx, 0xf
inc ecx
cmp edx, 0xa
lea eax, [edx + 0x30]
jl 0x1000408d
lea eax, [edx + 0x57]
inc ecx
mov byte [ecx - 1], al
mov ebx, ecx
sub ebx, edi
mov dword [ebp - 0xc], ecx
mov dword [ebp - 0x24], ebx
jmp 0x100040a0
xor esi, esi
mov dword [ebp - 0x10], esi
mov byte [ecx], 0
call fcn.100048e5
push str.Sending_packet:
call fcn.10001980
add esp, 4
call fcn.100048e5
nop
movsx eax, byte [esi + edi]
push eax
push 0x10011b10
call fcn.10001980
inc esi
add esp, 8
cmp esi, 2
jl 0x100040c0
call fcn.100048e5
push 0x10011e7c
call fcn.10001980
mov esi, ebx
add esp, 4
test esi, esi
jle 0x1000411f
mov ebx, dword [ebp + 8]
push 0
lea ecx, [ebp - 0x1c]
push ecx
push esi
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x1000427c
mov eax, dword [ebp - 0x1c]
test eax, eax
jl 0x1000427c
sub esi, eax
add edi, eax
test esi, esi
jg 0x100040f0
jmp 0x10004122
mov ebx, dword [ebp + 8]
push ebx
mov esi, 2
call fcn.10004850
mov esi, eax
test esi, esi
jge 0x1000415b
cmp esi, 0xfffffffd
je 0x10004149
cmp esi, 0xffffffff
jne 0x1000415b
call fcn.100048e5
push str.Serial_communication_error_n
jmp 0x10004153
call fcn.100048e5
push str.Serial_connection_closed_n
call fcn.10001980
add esp, 4
lea edi, [esi + 2]
cmp edi, 0x2f
ja case.0x100041a0.1
movzx edx, byte [edi + 0x100042c8]
jmp dword [edx*4 + 0x100042c0]
cmp dword [ebp - 0x10], 0
je case.0x1000416e.1
call fcn.100048e5
push 0x10011420
call fcn.10001980
add esp, 4
mov dword [ebp - 0x10], 0
cmp edi, 0x2f
ja case.0x100041a0.1
movzx eax, byte [edi + 0x1000430c]
jmp dword [eax*4 + 0x100042f8]
call fcn.100048e5
push str.Packet_instead_of_Ack__ignoring_it_n
call fcn.10001980
add esp, 4
mov edi, ebx
call fcn.10004340
mov esi, 1
mov edi, 0x10011ee4
lea ebx, [ebx]
push 0
lea ecx, [ebp - 0x20]
push ecx
push esi
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x10004122
mov eax, dword [ebp - 0x20]
test eax, eax
jl 0x10004122
sub esi, eax
add edi, eax
test esi, esi
jg 0x100041d0
jmp 0x10004122
cmp dword [ebp - 0x10], 0
jne 0x1000421e
mov dword [ebp - 0x10], 1
call fcn.100048e5
push str.putpkt:_Junk:
call fcn.10001980
add esp, 4
call fcn.100048e5
and esi, 0x7f
push esi
push 0x10011b10
call fcn.10001980
add esp, 8
jmp 0x10004122
call fcn.100048e5
push str.Nak_n
call fcn.10001980
add esp, 4
cmp esi, 0xfffffffe
jne 0x10004262
call fcn.100048e5
push str.SERIAL_TIMEOUT_n
call fcn.10001980
add esp, 4
mov eax, dword [ebp - 0x14]
inc eax
cmp eax, 3
mov dword [ebp - 0x14], eax
jg 0x1000428e
mov edi, dword [ebp - 0x18]
mov ecx, dword [ebp - 0xc]
mov ebx, dword [ebp - 0x24]
jmp 0x100040a0
call fcn.100048e5
push str.putpkt:_serial_write_fails_____n
call fcn.10001980
add esp, 4
xor eax, eax
lea esp, [ebp - 0x30]
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.100048d6
mov esp, ebp
pop ebp
ret 8
call fcn.100048e5
push str.Ack_n
call fcn.10001980
add esp, 4
mov eax, 1
jmp 0x10004290