Function at 0x403f50
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x264
mov eax, dword [section..data]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
push 0x45e5a8
push 0x5a4
push str.C:UserspentesterDownloadsxxxxxxxcs4.5externalmbedtls_2.14.1library_ssl_tls.c
push 2
push 0x476980
xor edi, edi
call fcn.00411980
add esp, 0x14
cmp dword [0x4769b0], edi
je 0x404940
mov eax, dword [0x4769c4]
test eax, eax
je 0x404940
add eax, 0x50
je 0x404907
mov esi, dword [eax]
test esi, esi
je 0x404907
push dword [0x476a4c]
mov esi, dword [esi + 4]
lea edx, [edi + 4]
push dword [0x476a44]
mov ecx, 0x476980
push str.before_encrypt:_output_payload
push 0x5af
push str.C:UserspentesterDownloadsxxxxxxxcs4.5externalmbedtls_2.14.1library_ssl_tls.c
call fcn.00411a40
add esp, 0x14
mov eax, esi
cmp esi, 7
je 0x404102
cmp eax, 2
jne 0x404001
mov eax, dword [0x4769b0]
cmp dword [eax + 0x80], edi
je 0x404102
mov ebx, dword [0x4769c4]
mov edx, dword [0x476a4c]
cmp esi, 6
je 0x4045d0
cmp esi, 8
je 0x4045d0
mov dword [ebp - 0x254], edi
cmp esi, 0xa
je 0x4045d0
cmp esi, 2
jne 0x404934
mov ecx, dword [ebx + 0xc]
lea eax, [edx + 1]
xor edx, edx
mov dword [ebp - 0x258], 0
div ecx
mov ebx, edx
sub ecx, ebx
neg ebx
sbb ebx, ebx
and ebx, ecx
xor ecx, ecx
nop word [eax + eax]
mov eax, dword [0x476a44]
add eax, dword [0x476a4c]
mov byte [eax + ecx], bl
inc ecx
cmp ecx, ebx
jbe 0x404060
mov esi, dword [0x476a4c]
mov eax, dword [0x476a44]
inc esi
add esi, ebx
mov dword [ebp - 0x254], eax
cmp dword [0x476994], 2
mov ecx, esi
mov dword [0x476a4c], esi
jl 0x404371
mov eax, dword [0x4769c4]
mov ecx, dword [0x476980]
push dword [eax + 0xc]
add eax, 0x18
push eax
push dword [ecx + 0x1c]
mov eax, dword [ecx + 0x18]
call eax
add esp, 0xc
test eax, eax
jne 0x404963
mov eax, dword [0x4769c4]
push dword [eax + 0xc]
add eax, 0x18
push eax
push dword [0x476a40]
call fcn.00446970
mov edx, dword [0x4769c4]
add esp, 0xc
mov esi, dword [0x476a4c]
mov eax, dword [0x476a44]
mov dword [ebp - 0x254], eax
mov ecx, dword [edx + 0xc]
add ecx, esi
mov dword [0x476a4c], ecx
jmp 0x404377
cmp dword [0x476994], 1
jl 0x4048fb
mov ecx, dword [0x4769c4]
lea eax, [ecx + 0x38]
test eax, eax
je 0x404140
mov edx, dword [eax]
test edx, edx
je 0x404140
cmp dword [eax + 8], edi
je 0x404140
push 8
push dword [0x476a34]
push dword [eax + 4]
mov eax, dword [edx + 0x14]
call eax
mov ecx, dword [0x4769c4]
add esp, 0xc
lea eax, [ecx + 0x38]
test eax, eax
je 0x40416b
mov edx, dword [eax]
test edx, edx
je 0x40416b
cmp dword [eax + 8], edi
je 0x40416b
push 3
push dword [0x476a38]
push dword [eax + 4]
mov eax, dword [edx + 0x14]
call eax
mov ecx, dword [0x4769c4]
add esp, 0xc
lea eax, [ecx + 0x38]
test eax, eax
je 0x404196
mov edx, dword [eax]
test edx, edx
je 0x404196
cmp dword [eax + 8], edi
je 0x404196
push 2
push dword [0x476a3c]
push dword [eax + 4]
mov eax, dword [edx + 0x14]
call eax
mov ecx, dword [0x4769c4]
add esp, 0xc
lea eax, [ecx + 0x38]
test eax, eax
je 0x4041c5
mov edx, dword [eax]
test edx, edx
je 0x4041c5
cmp dword [eax + 8], edi
je 0x4041c5
push dword [0x476a4c]
push dword [0x476a44]
push dword [eax + 4]
mov eax, dword [edx + 0x14]
call eax
mov ecx, dword [0x4769c4]
add esp, 0xc
add ecx, 0x38
lea edx, [ebp - 0x50]
call fcn.00414400
mov edi, dword [0x4769c4]
add edi, 0x38
je 0x404208
mov eax, dword [edi]
test eax, eax
je 0x404208
mov ebx, dword [edi + 8]
test ebx, ebx
je 0x404208
push dword [edi + 4]
mov eax, dword [eax + 0x10]
call eax
add esp, 4
test eax, eax
jne 0x404208
mov eax, dword [edi]
push dword [eax + 0xc]
mov eax, dword [eax + 0x14]
push ebx
push dword [edi + 4]
call eax
add esp, 0xc
mov eax, dword [0x4769c4]
push dword [eax + 0x14]
lea eax, [ebp - 0x50]
push eax
mov eax, dword [0x476a44]
add eax, dword [0x476a4c]
push eax
call fcn.00446970
mov eax, dword [0x4769c4]
add esp, 0xc
mov edx, 4
mov ecx, 0x476980
push dword [eax + 0x14]
mov eax, dword [0x476a44]
add eax, dword [0x476a4c]
push eax
push str.computed_mac
push 0x5e4
push str.C:UserspentesterDownloadsxxxxxxxcs4.5externalmbedtls_2.14.1library_ssl_tls.c
call fcn.00411a40
mov ebx, dword [0x4769c4]
add esp, 0x14
mov edx, dword [0x476a4c]
mov edi, 1
add edx, dword [ebx + 0x14]
mov dword [0x476a4c], edx
cmp esi, 7
jne 0x40400d
push 0
push edx
push str.before_encrypt:_msglen___d__including__d_bytes_of_padding
push 0x5f6
push str.C:UserspentesterDownloadsxxxxxxxcs4.5externalmbedtls_2.14.1library_ssl_tls.c
push 3
push 0x476980
mov dword [ebp - 0x254], 0
call fcn.00411980
mov eax, dword [0x476a44]
lea edx, [ebp - 0x254]
mov ecx, dword [0x4769c4]
add esp, 0x1c
push edx
push eax
push dword [0x476a4c]
lea edx, [ecx + 0x18]
push eax
push dword [ecx + 0xc]
add ecx, 0x50
call fcn.0041adc0
mov esi, eax
add esp, 0x14
test esi, esi
je 0x404351
mov eax, dword [0x476980]
test eax, eax
je 0x40433e
cmp dword [eax + 0x10], 0
je 0x40433e
cmp dword [0x474488], edi
jl 0x40433e
cmp esi, 0xffff9700
je 0x40433e
mov eax, esi
neg eax
push eax
push esi
push str.mbedtls_cipher_crypt
push str._s___returned__d___0x_04x__n
lea eax, [ebp - 0x250]
push 0x200
push eax
call fcn.0042e840
mov eax, dword [0x476980]
lea ecx, [ebp - 0x250]
push ecx
push 0x5fe
push str.C:UserspentesterDownloadsxxxxxxxcs4.5externalmbedtls_2.14.1library_ssl_tls.c
push edi
push dword [eax + 0x14]
mov eax, dword [eax + 0x10]
call eax
add esp, 0x2c
mov eax, esi
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00444a17
mov esp, ebp
pop ebp
ret
mov eax, dword [0x476a4c]
cmp eax, dword [ebp - 0x254]
je 0x4048be
push str.should_never_happen
push 0x604
jmp 0x40494a
mov edx, dword [0x4769c4]
lea eax, [ebx + 1]
push eax
push dword [edx + 0xc]
push ecx
push str.before_encrypt:_msglen___d__including__d_bytes_of_IV_and__d_bytes_of_padding
push 0x6a1
push str.C:UserspentesterDownloadsxxxxxxxcs4.5externalmbedtls_2.14.1library_ssl_tls.c
push 3
push 0x476980
call fcn.00411980
mov ecx, dword [0x4769c4]
lea eax, [ebp - 0x258]
push eax
mov eax, dword [ebp - 0x254]
push eax
push esi
push eax
push dword [ecx + 0xc]
lea edx, [ecx + 0x18]
add ecx, 0x50
call fcn.0041adc0
mov ebx, eax
add esp, 0x34
test ebx, ebx
je 0x40443e
mov eax, dword [0x476980]
test eax, eax
je 0x40442b
cmp dword [eax + 0x10], 0
je 0x40442b
cmp dword [0x474488], 1
jl 0x40442b
cmp ebx, 0xffff9700
je 0x40442b
mov eax, ebx
neg eax
push eax
push ebx
push str.mbedtls_cipher_crypt
push str._s___returned__d___0x_04x__n
lea eax, [ebp - 0x250]
push 0x200
push eax
call fcn.0042e840
mov eax, dword [0x476980]
lea ecx, [ebp - 0x250]
push ecx
push 0x6a9
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, ebx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00444a17
mov esp, ebp
pop ebp
ret
cmp esi, dword [ebp - 0x258]
je 0x404455
push str.should_never_happen
push 0x6af
jmp 0x40494a
cmp dword [0x476994], 2
jge 0x404477
mov ecx, dword [0x4769c4]
push dword [ecx + 0xc]
lea eax, [ecx + 0x78]
push eax
lea eax, [ecx + 0x18]
push eax
call fcn.00446970
add esp, 0xc
test edi, edi
jne 0x4048aa
push str.using_encrypt_then_mac
push 0x6ce
push str.C:UserspentesterDownloadsxxxxxxxcs4.5externalmbedtls_2.14.1library_ssl_tls.c
push 3
push 0x476980
call fcn.00411980
mov eax, dword [0x476a34]
lea edx, [edi + 4]
add esp, 0x14
mov ecx, dword [eax]
mov eax, dword [eax + 4]
mov dword [ebp - 0x14], ecx
mov ecx, dword [0x476a38]
mov dword [ebp - 0x10], eax
push 0xd
mov ax, word [ecx]
mov word [ebp - 0xc], ax
movzx eax, byte [ecx + 2]
mov ecx, 0x476980
mov byte [ebp - 0xa], al
movzx eax, byte [0x476a4d]
mov byte [ebp - 9], al
movzx eax, byte [0x476a4c]
mov byte [ebp - 8], al
lea eax, [ebp - 0x14]
push eax
push str.MACd_meta_data
push 0x6d5
push str.C:UserspentesterDownloadsxxxxxxxcs4.5externalmbedtls_2.14.1library_ssl_tls.c
call fcn.00411a40
mov ecx, dword [0x4769c4]
add esp, 0x14
lea eax, [ecx + 0x38]
test eax, eax
je 0x404529
mov edx, dword [eax]
test edx, edx
je 0x404529
cmp dword [eax + 8], edi
je 0x404529
push 0xd
lea ecx, [ebp - 0x14]
push ecx
push dword [eax + 4]
mov eax, dword [edx + 0x14]
call eax
mov ecx, dword [0x4769c4]
add esp, 0xc
lea eax, [ecx + 0x38]
test eax, eax
je 0x404559
mov edx, dword [eax]
test edx, edx
je 0x404559
cmp dword [eax + 8], 0
je 0x404559
push dword [0x476a4c]
push dword [0x476a40]
push dword [eax + 4]
mov eax, dword [edx + 0x14]
call eax
mov ecx, dword [0x4769c4]
add esp, 0xc
add ecx, 0x38
lea edx, [ebp - 0x50]
call fcn.00414400
mov esi, dword [0x4769c4]
add esi, 0x38
je 0x40459c
mov eax, dword [esi]
test eax, eax
je 0x40459c
mov ebx, dword [esi + 8]
test ebx, ebx
je 0x40459c
push dword [esi + 4]
mov eax, dword [eax + 0x10]
call eax
add esp, 4
test eax, eax
jne 0x40459c
mov eax, dword [esi]
push dword [eax + 0xc]
mov eax, dword [eax + 0x14]
push ebx
push dword [esi + 4]
call eax
add esp, 0xc
mov eax, dword [0x4769c4]
push dword [eax + 0x14]
lea eax, [ebp - 0x50]
push eax
mov eax, dword [0x476a40]
add eax, dword [0x476a4c]
push eax
call fcn.00446970
mov eax, dword [0x4769c4]
add esp, 0xc
mov eax, dword [eax + 0x14]
add dword [0x476a4c], eax
inc edi
jmp 0x4048aa
mov eax, dword [ebx]
movzx eax, byte [eax + 0x24]
and al, 2
mov byte [ebp - 0x25c], al
mov eax, dword [ebx + 0xc]
sub eax, dword [ebx + 0x10]
mov dword [ebp - 0x258], eax
mov eax, dword [0x476a34]
mov ecx, dword [eax]
mov eax, dword [eax + 4]
mov dword [ebp - 0x10], eax
movzx eax, byte [0x476a48]
mov byte [ebp - 0xc], al
mov eax, dword [0x476980]
mov dword [ebp - 0x14], ecx
mov ecx, dword [0x476990]
test byte [eax + 0xcc], 2
je 0x40463d
mov al, 1
sub al, cl
cmp dword [0x476994], 2
mov byte [ebp - 0xb], al
mov ecx, 1
mov eax, dword [0x476994]
movzx eax, al
cmovne ecx, eax
neg cl
mov byte [ebp - 0xa], cl
jmp 0x404648
mov eax, dword [0x476994]
mov byte [ebp - 0xb], cl
mov byte [ebp - 0xa], al
mov al, byte [0x476a4d]
mov ecx, 0x476980
push 0xd
mov byte [ebp - 9], al
lea eax, [ebp - 0x14]
push eax
push str.additional_data_for_AEAD
mov byte [ebp - 8], dl
mov edx, 4
push 0x625
push str.C:UserspentesterDownloadsxxxxxxxcs4.5externalmbedtls_2.14.1library_ssl_tls.c
call fcn.00411a40
add esp, 0x14
cmp dword [ebx + 0xc], 0xc
jne 0x4048ef
mov eax, dword [ebx + 0x10]
cmp eax, 4
jne 0x4046ae
mov eax, dword [ebx + 0x18]
mov dword [ebp - 0x20], eax
mov eax, dword [0x476a34]
mov ecx, dword [eax]
mov edx, dword [eax + 4]
mov eax, dword [0x476a40]
mov dword [ebp - 0x1c], ecx
mov dword [ebp - 0x18], edx
mov dword [eax], ecx
mov dword [eax + 4], edx
jmp 0x4046ee
cmp eax, 0xc
jne 0x4048ef
mov eax, dword [ebx + 0x20]
lea ecx, [ebp - 0x1c]
movq xmm0, qword [ebx + 0x18]
mov edx, 8
mov esi, dword [0x476a34]
mov dword [ebp - 0x18], eax
mov eax, ecx
movq qword [ebp - 0x20], xmm0
sub esi, eax
nop dword [eax]
mov al, byte [ecx + esi]
lea ecx, [ecx + 1]
xor byte [ecx - 1], al
sub edx, 1
jne 0x4046e0
push dword [ebx + 0xc]
lea eax, [ebp - 0x20]
mov edx, 4
push eax
push str.IV_used__internal_
push 0x644
push str.C:UserspentesterDownloadsxxxxxxxcs4.5externalmbedtls_2.14.1library_ssl_tls.c
mov ecx, 0x476980
call fcn.00411a40
add esp, 0x14
mov edx, 4
mov ecx, 0x476980
push dword [ebp - 0x258]
push dword [0x476a40]
push str.IV_used__transmitted_
push 0x646
push str.C:UserspentesterDownloadsxxxxxxxcs4.5externalmbedtls_2.14.1library_ssl_tls.c
call fcn.00411a40
mov eax, dword [0x476a4c]
add esp, 0x14
mov esi, dword [0x476a44]
mov dword [ebp - 0x254], eax
add eax, dword [ebp - 0x258]
push eax
push str.before_encrypt:_msglen___d__including_0_bytes_of_padding
push 0x651
push str.C:UserspentesterDownloadsxxxxxxxcs4.5externalmbedtls_2.14.1library_ssl_tls.c
push 3
push 0x476980
mov dword [0x476a4c], eax
call fcn.00411980
mov ecx, dword [ebp - 0x254]
add esp, 0x18
xor eax, eax
cmp byte [ebp - 0x25c], al
sete al
lea edx, [ecx + esi]
mov dword [ebp - 0x260], edx
lea eax, [eax*8 + 8]
push eax
push edx
mov dword [ebp - 0x258], eax
lea edx, [ebp - 0x20]
lea eax, [ebp - 0x25c]
push eax
push esi
push ecx
push esi
push ecx
lea eax, [ebp - 0x14]
push eax
push dword [ebx + 0xc]
lea ecx, [ebx + 0x50]
call fcn.0041b330
mov esi, eax
add esp, 0x24
test esi, esi
je 0x404858
mov eax, dword [0x476980]
test eax, eax
je 0x40433e
cmp dword [eax + 0x10], 0
je 0x40433e
cmp dword [0x474488], 1
jl 0x40433e
cmp esi, 0xffff9700
je 0x40433e
mov eax, esi
neg eax
push eax
push esi
push str.mbedtls_cipher_auth_encrypt
push str._s___returned__d___0x_04x__n
lea eax, [ebp - 0x250]
push 0x200
push eax
call fcn.0042e840
mov eax, dword [0x476980]
lea ecx, [ebp - 0x250]
push ecx
push 0x65d
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 edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00444a17
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0x254]
cmp dword [ebp - 0x25c], eax
je 0x404875
push str.should_never_happen
push 0x663
jmp 0x40494a
mov eax, dword [ebp - 0x258]
mov edx, 4
add dword [0x476a4c], eax
mov ecx, 0x476980
push eax
push dword [ebp - 0x260]
inc edi
push str.after_encrypt:_tag
push 0x66a
push str.C:UserspentesterDownloadsxxxxxxxcs4.5externalmbedtls_2.14.1library_ssl_tls.c
call fcn.00411a40
add esp, 0x14
cmp edi, 1
je 0x4048be
push str.should_never_happen
push 0x6f0
jmp 0x40494a
push str.__encrypt_buf
push 0x6f4
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 edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00444a17
mov esp, ebp
pop ebp
ret
push str.should_never_happen
push 0x63f
jmp 0x40494a
push str.should_never_happen
push 0x5de
jmp 0x40494a
push dword [0x476a4c]
mov edx, 4
mov ecx, 0x476980
push dword [0x476a44]
push str.before_encrypt:_output_payload
push 0x5af
push str.C:UserspentesterDownloadsxxxxxxxcs4.5externalmbedtls_2.14.1library_ssl_tls.c
call fcn.00411a40
add esp, 0x14
push str.should_never_happen
push 0x6e9
jmp 0x40494a
push str.should_never_happen
push 0x5a8
push str.C:UserspentesterDownloadsxxxxxxxcs4.5externalmbedtls_2.14.1library_ssl_tls.c
push 1
push 0x476980
call fcn.00411980
mov eax, 0xffff9400
add esp, 0x14
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00444a17
mov esp, ebp
pop ebp
ret