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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2a4
mov eax, dword [section..data]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
push 0x45e778
push 0x701
push str.C:UserspentesterDownloadsxxxxxxxcs4.5externalmbedtls_2.14.1library_ssl_tls.c
push 2
push 0x476980
mov dword [ebp - 0x298], 0
xor edi, edi
mov dword [ebp - 0x294], 1
call fcn.00411980
add esp, 0x14
cmp dword [0x4769ac], edi
je 0x405858
mov esi, dword [0x4769c0]
test esi, esi
je 0x405858
lea ecx, [esi + 0x90]
test ecx, ecx
je 0x4049f9
mov eax, dword [ecx]
test eax, eax
je 0x4049f9
mov eax, dword [eax + 4]
jmp 0x4049fb
xor eax, eax
mov edx, dword [esi + 8]
mov ebx, dword [0x4769fc]
cmp ebx, edx
jae 0x404a3e
push edx
push ebx
push str.in_msglen___d____minlen___d_
push 0x70e
push str.C:UserspentesterDownloadsxxxxxxxcs4.5externalmbedtls_2.14.1library_ssl_tls.c
push 1
push 0x476980
call fcn.00411980
add esp, 0x1c
mov eax, 0xffff8e80
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00444a17
mov esp, ebp
pop ebp
ret
cmp eax, 7
jne 0x404b09
mov eax, dword [0x4769f0]
lea edx, [ebp - 0x28c]
push edx
push eax
push ebx
push eax
push dword [esi + 0xc]
mov dword [ebp - 0x28c], edi
lea edx, [esi + 0x28]
xor edi, edi
call fcn.0041adc0
mov esi, eax
add esp, 0x14
test esi, esi
je 0x404ae8
mov eax, dword [0x476980]
test eax, eax
je 0x404ad5
cmp dword [eax + 0x10], edi
je 0x404ad5
cmp dword [0x474488], 1
jl 0x404ad5
cmp esi, 0xffff9700
je 0x404ad5
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 - 0x280]
push 0x200
push eax
call fcn.0042e840
mov eax, dword [0x476980]
lea ecx, [ebp - 0x280]
push ecx
push 0x720
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 ebx, dword [0x4769fc]
cmp ebx, dword [ebp - 0x28c]
je 0x40545c
push str.should_never_happen
push 0x726
jmp 0x405862
cmp eax, 6
je 0x4050ba
cmp eax, 8
je 0x4050ba
cmp eax, 0xa
je 0x4050ba
cmp eax, 2
jne 0x4050ab
mov edi, dword [0x476994]
xor edx, edx
mov dword [ebp - 0x28c], edx
cmp edi, eax
jl 0x404b42
mov edx, dword [esi + 0xc]
mov eax, dword [esi + 0xc]
mov dword [ebp - 0x290], eax
add eax, edx
cmp ebx, eax
jb 0x40506d
mov eax, dword [esi + 0x14]
inc eax
add eax, edx
cmp ebx, eax
jb 0x40506d
mov eax, dword [0x4769f0]
mov dword [ebp - 0x294], eax
mov eax, dword [0x4769ac]
mov dword [ebp - 0x288], ebx
cmp dword [eax + 0x80], 1
jne 0x404dc3
push str.using_encrypt_then_mac
push 0x7c0
push str.C:UserspentesterDownloadsxxxxxxxcs4.5externalmbedtls_2.14.1library_ssl_tls.c
push 3
push 0x476980
call fcn.00411980
mov eax, dword [0x4769c0]
add esp, 0x14
mov edx, dword [0x4769fc]
mov eax, dword [eax + 0x14]
sub edx, eax
sub dword [ebp - 0x288], eax
mov eax, dword [0x4769e0]
mov dword [0x4769fc], edx
push 0xd
mov ecx, dword [eax]
mov eax, dword [eax + 4]
mov dword [ebp - 0x14], ecx
mov ecx, dword [0x4769e4]
mov dword [ebp - 0x10], eax
mov ax, word [ecx]
mov word [ebp - 0xc], ax
mov al, byte [ecx + 2]
mov ecx, 0x476980
mov byte [ebp - 0xa], al
mov eax, edx
shr eax, 8
mov byte [ebp - 9], al
lea eax, [ebp - 0x14]
push eax
push str.MACd_meta_data
mov byte [ebp - 8], dl
mov edx, 4
push 0x7ca
push str.C:UserspentesterDownloadsxxxxxxxcs4.5externalmbedtls_2.14.1library_ssl_tls.c
call fcn.00411a40
mov ecx, dword [0x4769c0]
add esp, 0x14
lea eax, [ecx + 0x44]
test eax, eax
je 0x404c45
mov edx, dword [eax]
test edx, edx
je 0x404c45
cmp dword [eax + 8], 0
je 0x404c45
push 0xd
lea ecx, [ebp - 0x14]
push ecx
push dword [eax + 4]
mov eax, dword [edx + 0x14]
call eax
mov ecx, dword [0x4769c0]
add esp, 0xc
lea eax, [ecx + 0x44]
test eax, eax
je 0x404c75
mov edx, dword [eax]
test edx, edx
je 0x404c75
cmp dword [eax + 8], 0
je 0x404c75
push dword [0x4769fc]
push dword [0x4769ec]
push dword [eax + 4]
mov eax, dword [edx + 0x14]
call eax
mov ecx, dword [0x4769c0]
add esp, 0xc
add ecx, 0x44
lea edx, [ebp - 0x50]
call fcn.00414400
mov esi, dword [0x4769c0]
add esi, 0x44
je 0x404cb8
mov eax, dword [esi]
test eax, eax
je 0x404cb8
mov edi, dword [esi + 8]
test edi, edi
je 0x404cb8
push dword [esi + 4]
mov eax, dword [eax + 0x10]
call eax
add esp, 4
test eax, eax
jne 0x404cb8
mov eax, dword [esi]
push dword [eax + 0xc]
mov eax, dword [eax + 0x14]
push edi
push dword [esi + 4]
call eax
add esp, 0xc
mov eax, dword [0x4769c0]
mov edx, 4
mov ecx, 0x476980
push dword [eax + 0x14]
mov eax, dword [0x4769fc]
add eax, dword [0x4769ec]
push eax
push str.message__mac
push 0x7d3
push str.C:UserspentesterDownloadsxxxxxxxcs4.5externalmbedtls_2.14.1library_ssl_tls.c
call fcn.00411a40
mov eax, dword [0x4769c0]
add esp, 0x14
mov edx, 4
mov ecx, 0x476980
push dword [eax + 0x14]
lea eax, [ebp - 0x50]
push eax
push str.expected_mac
push 0x7d5
push str.C:UserspentesterDownloadsxxxxxxxcs4.5externalmbedtls_2.14.1library_ssl_tls.c
call fcn.00411a40
mov eax, dword [0x4769c0]
xor edi, edi
mov ebx, dword [0x4769fc]
add esp, 0x14
add ebx, dword [0x4769ec]
mov byte [ebp - 0x281], 0
cmp dword [eax + 0x14], edi
jbe 0x404d6a
lea eax, [ebp - 0x50]
sub ebx, eax
mov edx, eax
mov esi, eax
movzx eax, byte [edx + ebx]
lea edx, [edx + 1]
mov cl, byte [esi]
lea esi, [esi + 1]
xor cl, al
inc edi
movzx eax, byte [ebp - 0x281]
or al, cl
mov byte [ebp - 0x281], al
mov eax, dword [0x4769c0]
cmp edi, dword [eax + 0x14]
jb 0x404d42
cmp byte [ebp - 0x281], 0
je 0x404da7
push str.message_mac_does_not_match
push 0x7da
push str.C:UserspentesterDownloadsxxxxxxxcs4.5externalmbedtls_2.14.1library_ssl_tls.c
push 1
push 0x476980
call fcn.00411980
mov eax, 0xffff8e80
add esp, 0x14
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00444a17
mov esp, ebp
pop ebp
ret
mov ebx, dword [0x4769fc]
mov esi, dword [0x4769c0]
mov edi, dword [0x476994]
mov dword [ebp - 0x298], 1
mov ecx, dword [esi + 0xc]
xor edx, edx
mov eax, ebx
div ecx
test edx, edx
je 0x404e06
push ecx
push ebx
push str.msglen___d_____ivlen___d____0
push 0x7e8
push str.C:UserspentesterDownloadsxxxxxxxcs4.5externalmbedtls_2.14.1library_ssl_tls.c
push 1
push 0x476980
call fcn.00411980
add esp, 0x1c
mov eax, 0xffff8e80
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00444a17
mov esp, ebp
pop ebp
ret
cmp edi, 2
mov edi, dword [ebp - 0x288]
jl 0x404e41
sub ebx, ecx
sub edi, ecx
mov dword [0x4769fc], ebx
xor dl, dl
cmp dword [esi + 0xc], 0
jbe 0x404e41
xor ecx, ecx
mov eax, dword [0x4769ec]
inc dl
mov al, byte [ecx + eax]
mov byte [ecx + esi + 0x28], al
mov esi, dword [0x4769c0]
movzx ecx, dl
cmp ecx, dword [esi + 0xc]
jb 0x404e25
lea eax, [ebp - 0x28c]
push eax
mov eax, dword [ebp - 0x294]
lea edx, [esi + 0x28]
push eax
push edi
push eax
push dword [esi + 0xc]
lea ecx, [esi + 0x90]
call fcn.0041adc0
mov esi, eax
add esp, 0x14
test esi, esi
je 0x404ef6
mov eax, dword [0x476980]
test eax, eax
je 0x404ad5
cmp dword [eax + 0x10], 0
je 0x404ad5
cmp dword [0x474488], 1
jl 0x404ad5
cmp esi, 0xffff9700
je 0x404ad5
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 - 0x280]
push 0x200
push eax
call fcn.0042e840
mov eax, dword [0x476980]
lea ecx, [ebp - 0x280]
push ecx
push 0x801
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
cmp edi, dword [ebp - 0x28c]
je 0x404f0d
push str.should_never_happen
push 0x807
jmp 0x405862
cmp dword [0x476994], 2
jge 0x404f32
mov ecx, dword [0x4769c0]
push dword [ecx + 0xc]
lea eax, [ecx + 0xb8]
push eax
lea eax, [ecx + 0x28]
push eax
call fcn.00446970
add esp, 0xc
mov ebx, dword [0x4769fc]
mov eax, dword [0x4769f0]
mov dword [ebp - 0x290], ebx
movzx edi, byte [eax + ebx - 1]
mov eax, dword [0x4769c0]
inc edi
mov esi, dword [eax + 0x14]
lea eax, [esi + edi]
cmp ebx, eax
jae 0x404f67
cmp dword [ebp - 0x298], 0
jne 0x404f67
xor edi, edi
xor edx, edx
jmp 0x404f6c
mov edx, 1
cmp dword [0x476994], 0
jle 0x40505e
xor eax, eax
mov ecx, ebx
mov dword [ebp - 0x28c], eax
sub ecx, edi
lea eax, [esi + 0x4000]
cmp eax, ecx
sbb esi, esi
xor eax, eax
inc esi
cmp edi, ebx
mov ebx, 1
cmovbe eax, edx
and esi, eax
mov eax, esi
mov dword [ebp - 0x2a0], esi
imul eax, ecx
mov dword [ebp - 0x294], eax
xor eax, eax
mov dword [ebp - 0x288], eax
mov dword [ebp - 0x29c], eax
nop dword [eax]
mov edx, dword [0x4769f0]
cmp eax, edi
sbb esi, esi
add edx, eax
add edx, dword [ebp - 0x294]
and esi, ebx
xor ecx, ecx
lea ebx, [edi - 1]
movzx eax, byte [edx]
cmp eax, ebx
mov eax, dword [ebp - 0x288]
sete cl
inc eax
and ecx, esi
add dword [ebp - 0x28c], ecx
cmp eax, edi
movzx eax, byte [edx + 1]
lea edx, [edi - 1]
sbb ebx, ebx
xor ecx, ecx
neg ebx
and ebx, esi
cmp eax, edx
mov eax, dword [ebp - 0x288]
mov edx, dword [ebp - 0x29c]
cmove ecx, ebx
add eax, 2
add edx, ecx
mov dword [ebp - 0x29c], edx
mov dword [ebp - 0x288], eax
cmp eax, 0x100
jb 0x404fc0
mov eax, dword [ebp - 0x28c]
mov ebx, dword [ebp - 0x290]
add eax, edx
xor edx, edx
cmp eax, edi
cmove edx, dword [ebp - 0x2a0]
imul eax, edx, 0x1ff
mov dword [ebp - 0x294], edx
and edi, eax
sub ebx, edi
mov dword [0x4769fc], ebx
jmp 0x405461
push str.should_never_happen
push 0x862
jmp 0x405862
push dword [esi + 0x14]
push dword [ebp - 0x290]
push ebx
push str.msglen___d____max__ivlen__d___maclen___d___1______expl_IV__
push 0x7af
push str.C:UserspentesterDownloadsxxxxxxxcs4.5externalmbedtls_2.14.1library_ssl_tls.c
push 1
push 0x476980
call fcn.00411980
add esp, 0x20
mov eax, 0xffff8e80
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 0x86c
jmp 0x405862
mov eax, dword [esi]
xor ecx, ecx
mov edx, dword [esi + 0xc]
sub edx, dword [esi + 0x10]
mov al, byte [eax + 0x24]
and al, 2
test al, al
mov byte [ebp - 0x281], al
mov byte [ebp - 0x2a0], al
sete cl
lea ecx, [ecx*8 + 8]
lea eax, [ecx + edx]
cmp ebx, eax
jae 0x40511f
push ecx
push edx
push ebx
push str.msglen___d____explicit_iv_len___d___taglen___d_
push 0x745
push str.C:UserspentesterDownloadsxxxxxxxcs4.5externalmbedtls_2.14.1library_ssl_tls.c
push 1
push 0x476980
call fcn.00411980
add esp, 0x20
mov eax, 0xffff8e80
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 [0x4769f0]
sub ebx, ecx
mov dword [ebp - 0x288], eax
sub ebx, edx
mov edx, dword [0x476994]
mov eax, ebx
shr eax, 8
mov dword [ebp - 0x290], eax
mov eax, dword [0x4769e0]
mov dword [0x4769fc], ebx
mov ecx, dword [eax]
mov eax, dword [eax + 4]
mov dword [ebp - 0x10], eax
mov al, byte [0x4769f8]
mov byte [ebp - 0xc], al
mov eax, dword [0x476980]
mov dword [ebp - 0x14], ecx
mov ecx, dword [0x476990]
test byte [eax + 0xcc], 2
je 0x40518d
mov al, 1
sub al, cl
cmp edx, 2
mov byte [ebp - 0xb], al
mov ecx, 1
movzx eax, dl
cmovne ecx, eax
neg cl
mov byte [ebp - 0xa], cl
jmp 0x405193
mov byte [ebp - 0xb], cl
mov byte [ebp - 0xa], dl
mov eax, dword [ebp - 0x290]
mov edx, 4
push 0xd
mov byte [ebp - 9], al
mov ecx, 0x476980
lea eax, [ebp - 0x14]
mov byte [ebp - 8], bl
push eax
push str.additional_data_for_AEAD
push 0x758
push str.C:UserspentesterDownloadsxxxxxxxcs4.5externalmbedtls_2.14.1library_ssl_tls.c
call fcn.00411a40
add esp, 0x14
cmp dword [esi + 0xc], 0xc
jne 0x40584c
mov eax, dword [esi + 0x10]
cmp eax, 4
jne 0x4051f0
mov eax, dword [esi + 0x28]
mov dword [ebp - 0x20], eax
mov eax, dword [0x4769ec]
mov ecx, dword [eax]
mov eax, dword [eax + 4]
mov dword [ebp - 0x1c], ecx
mov dword [ebp - 0x18], eax
jmp 0x405230
cmp eax, 0xc
jne 0x40584c
mov eax, dword [esi + 0x30]
lea ecx, [ebp - 0x1c]
movq xmm0, qword [esi + 0x28]
mov edx, 8
mov edi, dword [0x4769e0]
mov dword [ebp - 0x18], eax
mov eax, ecx
movq qword [ebp - 0x20], xmm0
sub edi, eax
nop dword [eax + eax]
mov al, byte [edi + ecx]
lea ecx, [ecx + 1]
xor byte [ecx - 1], al
sub edx, 1
jne 0x405220
xor edi, edi
push dword [esi + 0xc]
lea eax, [ebp - 0x20]
mov edx, 4
push eax
push str.IV_used
push 0x775
push str.C:UserspentesterDownloadsxxxxxxxcs4.5externalmbedtls_2.14.1library_ssl_tls.c
mov ecx, 0x476980
call fcn.00411a40
mov ecx, dword [ebp - 0x288]
add esp, 0x14
add ecx, ebx
xor eax, eax
cmp byte [ebp - 0x2a0], al
mov edx, 4
mov dword [ebp - 0x28c], ecx
sete al
lea eax, [eax*8 + 8]
push eax
push ecx
push str.TAG_used
push 0x776
push str.C:UserspentesterDownloadsxxxxxxxcs4.5externalmbedtls_2.14.1library_ssl_tls.c
mov ecx, 0x476980
call fcn.00411a40
mov al, byte [ebp - 0x281]
xor ecx, ecx
mov edx, dword [esi + 0xc]
add esp, 0x14
mov esi, dword [0x4769c0]
test al, al
sete cl
lea ecx, [ecx*8 + 8]
mov dword [ebp - 0x29c], ecx
mov ecx, dword [esi + 0x90]
cmp dword [ecx + 4], 6
jne 0x40530c
mov eax, dword [ebp - 0x288]
push eax
push eax
push dword [ebp - 0x29c]
lea eax, [ebp - 0x14]
push dword [ebp - 0x28c]
push ecx
mov ecx, dword [esi + 0xcc]
push eax
push edx
lea eax, [ebp - 0x20]
mov edx, ebx
push eax
call fcn.00434cb0
mov esi, eax
add esp, 0x20
mov eax, 0xffff9d00
cmp esi, 0xffffffee
cmove esi, eax
mov eax, ebx
jmp 0x4053a9
cmp dword [ecx + 4], 8
jne 0x405351
push dword [ebp - 0x29c]
mov eax, dword [ebp - 0x288]
push dword [ebp - 0x28c]
push eax
push eax
push ecx
mov ecx, dword [esi + 0xcc]
lea eax, [ebp - 0x14]
push eax
push edx
lea eax, [ebp - 0x20]
mov edx, ebx
push eax
call fcn.00433390
mov esi, eax
add esp, 0x20
mov eax, 0xffff9d00
cmp esi, 0xfffffff1
cmove esi, eax
mov eax, ebx
jmp 0x4053a9
cmp dword [ecx], 0x49
jne 0x40539e
cmp edx, dword [ecx + 0x10]
jne 0x405397
test al, al
jne 0x405397
mov eax, dword [ebp - 0x288]
mov edx, ebx
push eax
push eax
push dword [ebp - 0x28c]
lea eax, [ebp - 0x14]
push ecx
mov ecx, dword [esi + 0xcc]
push eax
lea eax, [ebp - 0x20]
push eax
call fcn.00433a40
mov esi, eax
add esp, 0x18
mov eax, 0xffff9d00
cmp esi, 0xffffffaa
cmove esi, eax
mov eax, ebx
jmp 0x4053a9
mov esi, 0xffff9f00
jmp 0x4053a3
mov esi, 0xffff9f80
mov eax, dword [ebp - 0x290]
test esi, esi
je 0x405439
mov eax, dword [0x476980]
test eax, eax
je 0x40541a
cmp dword [eax + 0x10], 0
je 0x40541a
cmp dword [0x474488], 1
jl 0x40541a
cmp esi, 0xffff9700
je 0x404ad5
mov eax, esi
neg eax
push eax
push esi
push str.mbedtls_cipher_auth_decrypt
push str._s___returned__d___0x_04x__n
lea eax, [ebp - 0x280]
push 0x200
push eax
call fcn.0042e840
mov ecx, dword [0x476980]
lea eax, [ebp - 0x280]
push eax
push 0x782
push str.C:UserspentesterDownloadsxxxxxxxcs4.5externalmbedtls_2.14.1library_ssl_tls.c
push 1
push dword [ecx + 0x14]
mov ecx, dword [ecx + 0x10]
call ecx
add esp, 0x2c
cmp esi, 0xffff9d00
je 0x404a28
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 dword [ebp - 0x298], 1
cmp eax, ebx
je 0x405456
push str.should_never_happen
push 0x78d
jmp 0x405862
mov ebx, dword [0x4769fc]
mov edx, 1
mov eax, dword [ebp - 0x298]
test eax, eax
jne 0x4056f4
mov eax, dword [0x4769c0]
sub ebx, dword [eax + 0x14]
mov eax, dword [0x4769e8]
mov dword [0x4769fc], ebx
shr ebx, 8
mov byte [eax], bl
mov eax, dword [0x4769e8]
mov cl, byte [0x4769fc]
mov byte [eax + 1], cl
cmp dword [0x476994], 0
jle 0x40571f
mov esi, dword [0x4769fc]
mov ecx, 0x100
lea ebx, [esi + edi]
cmp ecx, ebx
lea eax, [ebx - 0x100]
sbb ecx, ecx
and ecx, eax
mov dword [ebp - 0x290], ecx
mov ecx, dword [0x4769c0]
mov eax, dword [ecx]
mov eax, dword [eax + 0xc]
add eax, 0xfffffffd
cmp eax, 4
ja case.0x4054d9.5
jmp dword [eax*4 + 0x40588c]
lea eax, [esi + 0x15]
lea esi, [ebx + 0x15]
shr eax, 6
shr esi, 6
jmp 0x4054fa
lea eax, [esi + 0x1d]
lea esi, [ebx + 0x1d]
shr eax, 7
shr esi, 7
sub esi, eax
imul eax, edx, 0xff
and esi, eax
lea eax, [ecx + 0x44]
test eax, eax
je 0x405530
mov edx, dword [eax]
test edx, edx
je 0x405530
cmp dword [eax + 8], 0
je 0x405530
push 8
push dword [0x4769e0]
push dword [eax + 4]
mov eax, dword [edx + 0x14]
call eax
mov ecx, dword [0x4769c0]
add esp, 0xc
lea eax, [ecx + 0x44]
test eax, eax
je 0x40555c
mov edx, dword [eax]
test edx, edx
je 0x40555c
cmp dword [eax + 8], 0
je 0x40555c
push 3
push dword [0x4769e4]
push dword [eax + 4]
mov eax, dword [edx + 0x14]
call eax
mov ecx, dword [0x4769c0]
add esp, 0xc
lea eax, [ecx + 0x44]
test eax, eax
je 0x405588
mov edx, dword [eax]
test edx, edx
je 0x405588
cmp dword [eax + 8], 0
je 0x405588
push 2
push dword [0x4769e8]
push dword [eax + 4]
mov eax, dword [edx + 0x14]
call eax
mov ecx, dword [0x4769c0]
add esp, 0xc
mov edx, dword [0x4769f0]
add ecx, 0x44
je 0x4055b7
mov eax, dword [ecx]
test eax, eax
je 0x4055b7
cmp dword [ecx + 8], 0
je 0x4055b7
push dword [0x4769fc]
mov eax, dword [eax + 0x14]
push edx
push dword [ecx + 4]
call eax
mov edx, dword [0x4769f0]
add esp, 0xc
mov eax, dword [0x4769fc]
xor cl, cl
add eax, edx
test edi, edi
je 0x4055ce
xor cl, byte [eax]
lea eax, [eax + 1]
sub edi, 1
jne 0x4055c4
mov byte [ebp - 0x281], cl
lea edx, [ebp - 0x80]
mov al, byte [ebp - 0x281]
mov ecx, dword [0x4769c0]
lea ecx, [ecx + 0x44]
call fcn.00414400
add esi, 1
je 0x405616
mov eax, dword [0x4769c0]
add eax, 0x44
je 0x405611
mov ecx, dword [eax]
test ecx, ecx
je 0x405611
push dword [0x4769f0]
push dword [eax + 4]
mov eax, dword [ecx + 0x2c]
call eax
add esp, 8
sub esi, 1
jne 0x4055f0
mov esi, dword [0x4769c0]
add esi, 0x44
je 0x40564e
mov eax, dword [esi]
test eax, eax
je 0x40564e
mov edi, dword [esi + 8]
test edi, edi
je 0x40564e
push dword [esi + 4]
mov eax, dword [eax + 0x10]
call eax
add esp, 4
test eax, eax
jne 0x40564e
mov eax, dword [esi]
push dword [eax + 0xc]
mov eax, dword [eax + 0x14]
push edi
push dword [esi + 4]
call eax
add esp, 0xc
mov eax, dword [0x4769c0]
xor dl, dl
mov ecx, dword [0x4769f0]
add ecx, dword [ebp - 0x290]
mov eax, dword [eax + 0x14]
sub eax, dword [ebp - 0x290]
add eax, ebx
je 0x40567a
nop
xor dl, byte [ecx]
lea ecx, [ecx + 1]
sub eax, 1
jne 0x405670
mov byte [ebp - 0x281], dl
xor edi, edi
mov al, byte [ebp - 0x281]
mov eax, dword [0x4769c0]
mov ebx, dword [0x4769fc]
add ebx, dword [0x4769f0]
mov byte [ebp - 0x281], 0
cmp dword [eax + 0x14], edi
jbe 0x4056d4
lea eax, [ebp - 0x80]
sub ebx, eax
mov edx, eax
mov esi, eax
nop
mov al, byte [ebx + edx]
lea edx, [edx + 1]
mov cl, byte [esi]
lea esi, [esi + 1]
xor cl, al
inc edi
or cl, byte [ebp - 0x281]
mov eax, dword [0x4769c0]
mov byte [ebp - 0x281], cl
cmp edi, dword [eax + 0x14]
jb 0x4056b0
mov al, byte [ebp - 0x281]
xor ecx, ecx
mov edx, dword [ebp - 0x294]
test al, al
mov eax, dword [ebp - 0x298]
mov ebx, dword [0x4769fc]
cmovne edx, ecx
inc eax
test edx, edx
je 0x404a28
cmp eax, 1
je 0x40572e
push str.should_never_happen
push 0x912
jmp 0x405862
push str.should_never_happen
push 0x8d0
jmp 0x405862
push str.should_never_happen
push 0x8f3
jmp 0x405862
test ebx, ebx
jne 0x405799
cmp dword [0x476994], 3
jne 0x40577a
mov eax, dword [0x4769f8]
cmp eax, 0x17
je 0x40577a
push eax
push str.invalid_zero_length_message_type:__d
push 0x91d
push str.C:UserspentesterDownloadsxxxxxxxcs4.5externalmbedtls_2.14.1library_ssl_tls.c
push 1
push 0x476980
call fcn.00411980
add esp, 0x18
mov eax, 0xffff8e00
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 [0x476a24]
inc eax
mov dword [0x476a24], eax
cmp eax, 3
jle 0x4057a3
push str.received_four_consecutive_empty_messages__possible_DoS_attack
push 0x92b
jmp 0x404d7d
mov dword [0x476a24], 0
mov esi, dword [0x476980]
test byte [esi + 0xcc], 2
jne 0x40581b
mov cl, 8
mov eax, dword [esi + 0xcc]
movzx edx, cl
and eax, 2
cmp edx, eax
jbe 0x4057da
mov eax, dword [0x4769e0]
add byte [edx + eax - 1], 1
mov esi, dword [0x476980]
jne 0x4057da
dec cl
jmp 0x4057b4
mov eax, dword [esi + 0xcc]
and eax, 2
cmp edx, eax
jne 0x40581b
push str.incoming_message_counter_would_wrap
push 0x942
push str.C:UserspentesterDownloadsxxxxxxxcs4.5externalmbedtls_2.14.1library_ssl_tls.c
push 1
push 0x476980
call fcn.00411980
mov eax, 0xffff9480
add esp, 0x14
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.__decrypt_buf
push 0x947
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 0x771
jmp 0x405862
push str.should_never_happen
push 0x705
push str.C:UserspentesterDownloadsxxxxxxxcs4.5externalmbedtls_2.14.1library_ssl_tls.c
push 1
push 0x476980
call fcn.00411980
mov ecx, dword [ebp - 4]
add esp, 0x14
xor ecx, ebp
mov eax, 0xffff9400
pop edi
pop esi
pop ebx
call fcn.00444a17
mov esp, ebp
pop ebp
ret