Function at 0x40b570
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x214
mov eax, dword [section..data]
xor eax, ebp
mov dword [ebp - 4], eax
push esi
push 0x4601f4
push 0x1979
push str.C:UserspentesterDownloadsxxxxxxxcs4.5externalmbedtls_2.14.1library_ssl_tls.c
push 2
push 0x476980
call fcn.00411980
mov eax, dword [0x476980]
add esp, 0x14
mov eax, dword [eax + 0xcc]
not eax
and eax, 1
push eax
lea eax, [ebp - 0x10]
push eax
mov eax, dword [0x4769bc]
push 0x476980
mov eax, dword [eax + 0x458]
call eax
add esp, 0xc
mov edx, 1
call fcn.004082f0
mov esi, eax
test esi, esi
je 0x40b651
mov eax, dword [0x476980]
test eax, eax
je 0x40b640
cmp dword [eax + 0x10], 0
je 0x40b640
cmp dword [0x474488], 1
jl 0x40b640
cmp esi, 0xffff9700
je 0x40b640
mov eax, esi
neg eax
push eax
push esi
push str.mbedtls_ssl_read_record
push str._s___returned__d___0x_04x__n
lea eax, [ebp - 0x210]
push 0x200
push eax
call fcn.0042e840
mov eax, dword [0x476980]
lea ecx, [ebp - 0x210]
push ecx
push 0x197f
push str.C:UserspentesterDownloadsxxxxxxxcs4.5externalmbedtls_2.14.1library_ssl_tls.c
push 1
push dword [eax + 0x14]
mov eax, dword [eax + 0x10]
call eax
add esp, 0x2c
mov eax, esi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00444a17
mov esp, ebp
pop ebp
ret
cmp dword [0x4769f8], 0x16
je 0x40b698
push str.bad_finished_message
push 0x1985
push str.C:UserspentesterDownloadsxxxxxxxcs4.5externalmbedtls_2.14.1library_ssl_tls.c
push 1
push 0x476980
call fcn.00411980
add esp, 0x14
mov dl, 2
push 0xa
call fcn.00409860
mov eax, 0xffff8900
add esp, 4
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00444a17
mov esp, ebp
pop ebp
ret
mov edx, dword [0x4769f0]
cmp byte [edx], 0x14
jne 0x40b7a8
mov eax, dword [0x476980]
mov ecx, dword [eax + 0xcc]
and ecx, 2
mov eax, ecx
or eax, 4
shl eax, 2
cmp dword [0x476a20], eax
jne 0x40b7a8
or ecx, 1
mov byte [ebp - 0x211], 0
lea esi, [edx + ecx*4]
xor edx, edx
mov al, byte [esi + edx]
mov cl, byte [ebp + edx - 0x10]
inc edx
xor cl, al
or cl, byte [ebp - 0x211]
mov byte [ebp - 0x211], cl
cmp edx, 0xc
jb 0x40b6d8
cmp byte [ebp - 0x211], 0
je 0x40b70b
push str.bad_finished_message
push 0x199f
jmp 0x40b7b2
mov eax, dword [ebp - 8]
movq xmm0, qword [ebp - 0x10]
mov dword [0x476a90], eax
mov eax, dword [0x4769bc]
mov dword [0x476a78], 0xc
movq qword [0x476a88], xmm0
cmp dword [eax + 0x8c8], 0
mov eax, dword [0x476980]
je 0x40b765
test byte [eax + 0xcc], 1
jne 0x40b759
mov dword [0x476984], 0xa
test byte [eax + 0xcc], 1
je 0x40b76b
mov dword [0x476984], 0xf
jmp 0x40b76b
inc dword [0x476984]
test byte [eax + 0xcc], 2
je 0x40b779
call fcn.00406a10
push str.__parse_finished
push 0x19bd
push str.C:UserspentesterDownloadsxxxxxxxcs4.5externalmbedtls_2.14.1library_ssl_tls.c
push 2
push 0x476980
call fcn.00411980
add esp, 0x14
xor eax, eax
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00444a17
mov esp, ebp
pop ebp
ret
push str.bad_finished_message
push 0x1996
push str.C:UserspentesterDownloadsxxxxxxxcs4.5externalmbedtls_2.14.1library_ssl_tls.c
push 1
push 0x476980
call fcn.00411980
add esp, 0x14
mov dl, 2
push 0x32
call fcn.00409860
mov ecx, dword [ebp - 4]
add esp, 4
xor ecx, ebp
mov eax, 0xffff8180
pop esi
call fcn.00444a17
mov esp, ebp
pop ebp
ret