Function at 0x401790
Capabilities:
Terminate process

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c
push ebx
mov ebx, ecx
mov dword [ebp - 0xc], 0
push esi
push edi
xor edi, edi
mov esi, 6
mov eax, dword [ebx + 0x18]
mov edx, dword [ebx + 0x1c]
mov dword [ebp - 8], edi
mov dword [ebp - 4], eax
mov dword [ebp - 0x10], esi
cmp edx, eax
jl 0x401884
mov eax, dword [ebx + 0x10]
xorps xmm0, xmm0
mov ecx, dword [ebx + 8]
mov esi, dword [ebx + 0x2c]
mov dword [ebp - 4], esi
mov eax, dword [eax]
mov dword [ebp - 0x18], ecx
mov dword [ebp - 0x14], eax
movq qword [ecx], xmm0
call dword [sym.imp.KERNEL32.dll_GetTickCount64]
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x28], edx
call dword [sym.imp.KERNEL32.dll_GetTickCount64]
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x14]
push 0
push esi
push 0x400
mov ecx, dword [eax + 4]
push dword [ebp - 0x18]
mov dword [ebp - 0x24], edx
mov eax, dword [ecx]
call dword [eax + 0x1c]
mov esi, eax
test esi, esi
jne 0x401833
mov ecx, dword [ebp - 0x1c]
sub ecx, dword [ebp - 0x20]
mov esi, dword [ebp - 0x24]
mov eax, dword [ebp - 4]
sbb esi, dword [ebp - 0x28]
cdq
cmp esi, edx
mov esi, dword [ebp - 4]
jb 0x4017e7
ja 0x40182c
cmp ecx, eax
jb 0x4017e7
xor esi, esi
mov dword [ebp - 4], esi
jmp 0x40183e
mov dword [ebp - 4], esi
test esi, esi
js 0x401949
cmp dword [ebx + 0x28], 2
jl 0x401877
push esi
push str.recv___d_:_n
push 2
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
add esp, 4
push eax
call fcn.00401050
add esp, 0xc
push esi
push 2
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
mov edx, dword [ebx + 8]
add esp, 4
mov ecx, eax
call fcn.00401170
add esp, 4
xor edx, edx
test esi, esi
mov esi, dword [ebp - 0x10]
je 0x401a2b
mov eax, dword [ebx + 8]
mov cl, byte [edx + eax]
inc edx
test byte [ebx + 0x14], 2
movzx eax, cl
je 0x4018fb
cmp dword [ebp - 0xc], 0
je 0x4018a8
cmp cl, 0x5e
je 0x4018da
cmp cl, 0x5d
jne 0x40196b
cmp cl, 0x7e
jne 0x4018cc
cmp dword [ebp - 8], 0
jne 0x4018bc
mov dword [ebp - 8], 1
jmp 0x401923
test edi, edi
jne 0x40198d
mov eax, dword [ebp - 4]
jmp 0x4017b8
cmp cl, 0x7d
jne 0x4018da
mov dword [ebp - 0xc], 0x20
jmp 0x401923
cmp dword [ebp - 8], 0
mov eax, dword [ebp - 4]
je 0x4017b8
cmp edi, esi
jge 0x4019e4
xor cl, byte [ebp - 0xc]
mov dword [ebp - 0xc], 0
jmp 0x40191d
cmp dword [ebp - 8], 0
jne 0x401915
cmp cl, 0x7e
jne 0x401915
mov eax, dword [ebp - 4]
mov dword [ebp - 8], 1
jmp 0x4017b8
cmp edi, esi
je 0x401a05
mov eax, dword [ebx]
mov byte [edi + eax], cl
inc edi
mov eax, dword [ebp - 4]
cmp edi, 4
jne 0x4017b8
mov eax, dword [ebx]
movzx esi, byte [eax + 2]
movzx eax, byte [eax + 3]
shl esi, 8
or esi, eax
mov eax, dword [ebp - 4]
add esi, 6
jmp 0x4017b5
push esi
push str.usb_recv_failed__ret___d_n
push 2
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
add esp, 4
push eax
call fcn.00401050
add esp, 0xc
push 1
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_exit]
push eax
push str.unexpected_escaped_byte__0x_02x__n
push 2
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
add esp, 4
push eax
call fcn.00401050
add esp, 0xc
push 1
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_exit]
cmp edi, esi
jge 0x4019b2
push str.recieved_message_too_short_n
push 2
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
add esp, 4
push eax
call fcn.00401050
add esp, 8
push 1
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_exit]
mov eax, dword [ebp - 4]
mov dword [ebx + 0x18], eax
mov dword [ebx + 0x1c], edx
mov dword [ebx + 0x20], edi
cmp edi, 6
jl 0x401991
cmp edi, esi
je 0x401a44
push esi
push edi
push str.bad_length___d__expected__d__n
push 2
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
add esp, 4
push eax
call fcn.00401050
add esp, 0x10
jmp 0x4019aa
push str.recieved_message_too_long_n
push 2
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
add esp, 4
push eax
call fcn.00401050
add esp, 8
push 1
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_exit]
cmp cl, 0x7e
je 0x401a2b
push str.expected_end_of_message_n
push 2
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
add esp, 4
push eax
call fcn.00401050
add esp, 8
push 1
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_exit]
mov eax, dword [ebp - 4]
mov dword [ebx + 0x18], eax
mov dword [ebx + 0x1c], edx
mov dword [ebx + 0x20], edi
test edi, edi
jne 0x4019be
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
test byte [ebx + 0x14], 1
lea eax, [esi - 2]
mov edx, dword [ebx]
je 0x401a5a
push eax
call fcn.004013d0
add esp, 4
jmp 0x401a65
push 2
push eax
call fcn.00401490
add esp, 8
mov edx, dword [ebx]
mov dword [ebp - 0x10], eax
movzx ecx, byte [edx + esi - 2]
movzx eax, byte [edx + esi - 1]
shl ecx, 8
or ecx, eax
mov eax, dword [ebp - 0x10]
cmp ecx, eax
je 0x401aa0
push eax
push ecx
push str.bad_checksum__0x_04x__expected_0x_04x__n
push 2
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
add esp, 4
push eax
call fcn.00401050
add esp, 0x10
jmp 0x4019aa
cmp dword [ebx + 0x28], 1
jne 0x401ada
movzx ecx, byte [edx + 2]
movzx eax, byte [edx + 3]
shl ecx, 8
or ecx, eax
movzx eax, byte [edx + 1]
push ecx
movzx ecx, byte [edx]
shl ecx, 8
or ecx, eax
push ecx
push str.recv:_type__0x_02x__size___d_n
push 2
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
add esp, 4
push eax
call fcn.00401050
add esp, 0x10
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret