Function at 0x4025b0
Capabilities:
Encode data using xor
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x844
mov eax, dword [0x4120fc]
xor eax, esp
mov dword [esp + 0x840], eax
push ebx
push esi
mov esi, ecx
push edi
mov ecx, str.Start...
mov dword [esp + 0x10], esi
mov dword [0x5f3dfc], 0
call fcn.004018a0
push 0x1000
push 0x5f3e68
push 0x3e9
push esi
call dword [sym.imp.USER32.dll_GetDlgItemTextA]
push 0
push 0
push 0x147
push 0x3ea
push esi
call dword [sym.imp.USER32.dll_SendDlgItemMessageA]
cmp eax, 0xffffffff
je 0x402620
mov eax, dword [eax*4 + 0x5f30ec]
jmp 0x402625
mov eax, 0x2580
push eax
call fcn.00401c10
mov ebx, eax
add esp, 4
mov dword [esp + 0x18], ebx
cmp ebx, 0xffffffff
jne 0x402678
mov ecx, str.Error_opening_serial_port.
call fcn.004018a0
push 0x10
push 0
push str.Error_opening_serial_port.
push esi
call dword [sym.imp.USER32.dll_MessageBoxA]
push 1
push esi
call fcn.00401820
add esp, 8
mov eax, 1
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x840]
xor ecx, esp
call fcn.00402b2d
mov esp, ebp
pop ebp
ret
mov edi, dword [0x5f3108]
mov ecx, ebx
mov dword [0x5f3108], 1
call fcn.004023b0
push 0
push esi
mov dword [0x5f3108], edi
call fcn.00401820
add esp, 8
call dword [sym.imp.USER32.dll_GetFocus]
mov edi, dword [sym.imp.USER32.dll_GetDlgItem]
push 0x3ed
push esi
mov dword [esp + 0x30], eax
call edi
push eax
call dword [sym.imp.USER32.dll_UpdateWindow]
push 0x3ed
push esi
mov dword [0x5f3108], 0x19
call edi
push eax
call dword [sym.imp.USER32.dll_UpdateWindow]
lea eax, [esp + 0x14]
push eax
lea ecx, [esp + 0x4c]
push ecx
mov dword [esp + 0x1c], 0
call fcn.00402150
add esp, 8
test eax, eax
je 0x402a53
call fcn.00401dc0
push 0x5f4e70
mov edi, eax
mov esi, ebx
call fcn.00401970
add esp, 4
test eax, eax
jne 0x402731
mov esi, dword [esp + 0x10]
mov ecx, str.Error_sending_data.
mov dword [0x5f3dfc], 1
call fcn.004018a0
jmp 0x402ad6
mov edx, dword [esp + 0x18]
push edx
lea eax, [esp + 0x4c]
call fcn.004019f0
add esp, 4
push 0x14
push 0x5f310c
mov edi, eax
call fcn.00402d5f
add esp, 8
test edi, edi
je 0x402a20
mov ecx, 0x5f310c
lea edx, [esp + 0x48]
call fcn.00401d40
test eax, eax
je 0x402a20
mov esi, dword [esp + 0x10]
lea ecx, [esp + 0x48]
mov byte [esp + 0x4a], 0
call fcn.004018a0
mov ebx, dword [0x412f5c]
mov dword [esp + 0x14], ebx
mov dword [esp + 0x1c], 0x413061
test ebx, ebx
je 0x402969
lea ecx, [ecx]
cmp dword [0x5f4e68], 0
je 0x402929
cmp ebx, 0x200
jb 0x4027ba
mov ebx, 0x200
lea edi, [ebx + 2]
push edi
call fcn.00403f57
add esp, 4
mov esi, eax
mov eax, dword [esp + 0x1c]
push ebx
push eax
push esi
mov dword [esp + 0x30], esi
call fcn.004066c0
mov ecx, dword [esp + 0x28]
xor edx, edx
add esp, 0xc
mov eax, 0xffff
cmp dx, bx
jae 0x402814
movzx edx, bx
mov dword [esp + 0x20], edx
movzx edx, byte [ecx]
xor edx, eax
shr ax, 8
and edx, 0xff
xor ax, word [edx*2 + 0x410bd0]
inc ecx
sub dword [esp + 0x20], 1
movzx eax, ax
jne 0x4027f2
mov word [esi + ebx], ax
push esi
mov esi, dword [esp + 0x1c]
call fcn.00401970
add esp, 4
test eax, eax
je 0x40293a
mov eax, dword [esp + 0x24]
push eax
call fcn.00402d7c
mov ecx, esi
add esp, 4
push ecx
lea eax, [esp + 0x4c]
call fcn.004019f0
add esp, 4
push 0x14
push 0x5f310c
mov esi, eax
call fcn.00402d5f
add esp, 8
test esi, esi
je 0x40287a
mov ecx, 0x5f310c
lea edx, [esp + 0x48]
call fcn.00401d40
test eax, eax
je 0x40287a
add dword [esp + 0x1c], ebx
sub dword [esp + 0x14], ebx
jmp 0x4028b9
push 0x14
push str.RETRY
call fcn.00402d5f
add esp, 8
test esi, esi
je 0x40294b
mov ecx, str.RETRY
lea edx, [esp + 0x48]
call fcn.00401d40
test eax, eax
je 0x40294b
mov esi, dword [esp + 0x10]
lea ecx, [esp + 0x48]
mov byte [esp + 0x4d], 0
call fcn.004018a0
push 1
push 0
push 0
push 0
lea edx, [esp + 0x3c]
push edx
call dword [sym.imp.USER32.dll_PeekMessageA]
test eax, eax
je 0x4028e6
lea eax, [esp + 0x2c]
push eax
call dword [sym.imp.USER32.dll_TranslateMessage]
lea ecx, [esp + 0x2c]
push ecx
call dword [sym.imp.USER32.dll_DispatchMessageA]
mov ecx, dword [0x412f5c]
mov esi, dword [esp + 0x14]
mov eax, 0x51eb851f
mul ecx
mov edi, ecx
mov ecx, edx
sub edi, esi
xor edx, edx
shr ecx, 5
mov eax, edi
div ecx
mov edx, dword [esp + 0x10]
push 0
push eax
push 0x402
push 0x3e8
push edx
call dword [sym.imp.USER32.dll_SendDlgItemMessageA]
test esi, esi
je 0x402969
mov ebx, esi
jmp 0x4027a0
mov dword [0x5f3dfc], 1
mov ecx, str.Process_stopped.
jmp 0x402960
mov dword [0x5f3dfc], 1
mov ecx, str.Error_sending_data.
jmp 0x402960
lea edx, [esp + 0x48]
mov dword [0x5f3dfc], 1
call fcn.00401be0
mov ecx, edx
mov esi, dword [esp + 0x10]
call fcn.004018a0
cmp dword [0x5f3dfc], 0
jne 0x402ad2
mov eax, dword [esp + 0x18]
push eax
lea eax, [esp + 0x4c]
mov dword [0x5f3108], 0x32
call fcn.004019f0
add esp, 4
push 0x14
push str.WAIT
mov esi, eax
call fcn.00402d5f
add esp, 8
test esi, esi
je 0x4029f3
mov ecx, str.WAIT
lea edx, [esp + 0x48]
call fcn.00401d40
test eax, eax
je 0x4029f3
mov esi, dword [esp + 0x10]
lea ecx, [esp + 0x48]
mov byte [esp + 0x4c], 0
call fcn.004018a0
xor ecx, ecx
call fcn.004018a0
mov ecx, str.PLEASE_WAIT_UNTIL_THE_DEVICE_TURNS_OFF
call fcn.004018a0
push 0x3ed
push esi
call dword [sym.imp.USER32.dll_GetDlgItem]
push eax
call dword [sym.imp.USER32.dll_UpdateWindow]
jmp 0x402ad6
lea edx, [esp + 0x48]
mov dword [0x5f3dfc], 1
call fcn.00401be0
mov esi, dword [esp + 0x10]
mov ecx, edx
call fcn.004018a0
mov ecx, str.Bad_printer_response.
call fcn.004018a0
jmp 0x402ad6
mov ebx, dword [esp + 0x10]
mov ecx, str.Bad_printer_response_or_timeout.
mov esi, ebx
mov dword [0x5f3dfc], 1
call fcn.004018a0
mov esi, edi
lea edx, [esp + 0x48]
call fcn.00401be0
mov ecx, edx
mov esi, ebx
call fcn.004018a0
jmp 0x402ad6
mov edi, dword [esp + 0x14]
test edi, edi
jne 0x402a71
mov ecx, str.No_communication.
call fcn.004018a0
mov dword [0x5f3dfc], 1
jmp 0x402ad6
mov ecx, str.Bad_Receipt:
call fcn.004018a0
xor ebx, ebx
test edi, edi
jle 0x402aba
lea edi, [esp + 0x44a]
jmp 0x402a90
movzx ecx, byte [esp + ebx + 0x48]
push ecx
lea edx, [edi - 2]
push str.0x_2X
push edx
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
cmp byte [edi], 0x20
jne 0x402ab0
mov byte [edi], 0x30
inc ebx
add edi, 5
cmp ebx, dword [esp + 0x14]
jl 0x402a90
lea ecx, [esp + 0x448]
call fcn.004018a0
mov dword [0x5f3dfc], 1
jmp 0x402ad6
mov esi, dword [esp + 0x10]
mov eax, dword [esp + 0x18]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [0x5f3dfc], 0
jne 0x402af9
mov ecx, str.Process_finished.
call fcn.004018a0
call fcn.004024c0
xor ecx, ecx
call fcn.004018a0
mov ecx, dword [esp + 0x28]
push ecx
call dword [sym.imp.USER32.dll_SetFocus]
push 1
push esi
call fcn.00401820
mov ecx, dword [esp + 0x854]
add esp, 8
pop edi
pop esi
pop ebx
xor ecx, esp
xor eax, eax
call fcn.00402b2d
mov esp, ebp
pop ebp
ret