Function at 0x10004920
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 0x1006a6e0
push 0x5a4
push str.C:UserspentesterDownloadsxxxxxxxcs4.5externalmbedtls_2.14.1library_ssl_tls.c
push 2
push 0x10077880
xor edi, edi
call fcn.10012320
add esp, 0x14
cmp dword [0x100778b0], edi
je 0x10005310
mov eax, dword [0x100778c4]
test eax, eax
je 0x10005310
add eax, 0x50
je 0x100052d7
mov esi, dword [eax]
test esi, esi
je 0x100052d7
push dword [0x1007794c]
mov esi, dword [esi + 4]
lea edx, [edi + 4]
push dword [0x10077944]
mov ecx, 0x10077880
push str.before_encrypt:_output_payload
push 0x5af
push str.C:UserspentesterDownloadsxxxxxxxcs4.5externalmbedtls_2.14.1library_ssl_tls.c
call fcn.100123e0
add esp, 0x14
mov eax, esi
cmp esi, 7
je 0x10004ad2
cmp eax, 2
jne 0x100049d1
mov eax, dword [0x100778b0]
cmp dword [eax + 0x80], edi
je 0x10004ad2
mov ebx, dword [0x100778c4]
mov edx, dword [0x1007794c]
cmp esi, 6
je 0x10004fa0
cmp esi, 8
je 0x10004fa0
mov dword [ebp - 0x254], edi
cmp esi, 0xa
je 0x10004fa0
cmp esi, 2
jne 0x10005304
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 [0x10077944]
add eax, dword [0x1007794c]
mov byte [eax + ecx], bl
inc ecx
cmp ecx, ebx
jbe 0x10004a30
mov esi, dword [0x1007794c]
mov eax, dword [0x10077944]
inc esi
add esi, ebx
mov dword [ebp - 0x254], eax
cmp dword [0x10077894], 2
mov ecx, esi
mov dword [0x1007794c], esi
jl 0x10004d41
mov eax, dword [0x100778c4]
mov ecx, dword [0x10077880]
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 0x10005333
mov eax, dword [0x100778c4]
push dword [eax + 0xc]
add eax, 0x18
push eax
push dword [0x10077940]
call fcn.10047450
mov edx, dword [0x100778c4]
add esp, 0xc
mov esi, dword [0x1007794c]
mov eax, dword [0x10077944]
mov dword [ebp - 0x254], eax
mov ecx, dword [edx + 0xc]
add ecx, esi
mov dword [0x1007794c], ecx
jmp 0x10004d47
cmp dword [0x10077894], 1
jl 0x100052cb
mov ecx, dword [0x100778c4]
lea eax, [ecx + 0x38]
test eax, eax
je 0x10004b10
mov edx, dword [eax]
test edx, edx
je 0x10004b10
cmp dword [eax + 8], edi
je 0x10004b10
push 8
push dword [0x10077934]
push dword [eax + 4]
mov eax, dword [edx + 0x14]
call eax
mov ecx, dword [0x100778c4]
add esp, 0xc
lea eax, [ecx + 0x38]
test eax, eax
je 0x10004b3b
mov edx, dword [eax]
test edx, edx
je 0x10004b3b
cmp dword [eax + 8], edi
je 0x10004b3b
push 3
push dword [0x10077938]
push dword [eax + 4]
mov eax, dword [edx + 0x14]
call eax
mov ecx, dword [0x100778c4]
add esp, 0xc
lea eax, [ecx + 0x38]
test eax, eax
je 0x10004b66
mov edx, dword [eax]
test edx, edx
je 0x10004b66
cmp dword [eax + 8], edi
je 0x10004b66
push 2
push dword [0x1007793c]
push dword [eax + 4]
mov eax, dword [edx + 0x14]
call eax
mov ecx, dword [0x100778c4]
add esp, 0xc
lea eax, [ecx + 0x38]
test eax, eax
je 0x10004b95
mov edx, dword [eax]
test edx, edx
je 0x10004b95
cmp dword [eax + 8], edi
je 0x10004b95
push dword [0x1007794c]
push dword [0x10077944]
push dword [eax + 4]
mov eax, dword [edx + 0x14]
call eax
mov ecx, dword [0x100778c4]
add esp, 0xc
add ecx, 0x38
lea edx, [ebp - 0x50]
call fcn.10014da0
mov edi, dword [0x100778c4]
add edi, 0x38
je 0x10004bd8
mov eax, dword [edi]
test eax, eax
je 0x10004bd8
mov ebx, dword [edi + 8]
test ebx, ebx
je 0x10004bd8
push dword [edi + 4]
mov eax, dword [eax + 0x10]
call eax
add esp, 4
test eax, eax
jne 0x10004bd8
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 [0x100778c4]
push dword [eax + 0x14]
lea eax, [ebp - 0x50]
push eax
mov eax, dword [0x10077944]
add eax, dword [0x1007794c]
push eax
call fcn.10047450
mov eax, dword [0x100778c4]
add esp, 0xc
mov edx, 4
mov ecx, 0x10077880
push dword [eax + 0x14]
mov eax, dword [0x10077944]
add eax, dword [0x1007794c]
push eax
push str.computed_mac
push 0x5e4
push str.C:UserspentesterDownloadsxxxxxxxcs4.5externalmbedtls_2.14.1library_ssl_tls.c
call fcn.100123e0
mov ebx, dword [0x100778c4]
add esp, 0x14
mov edx, dword [0x1007794c]
mov edi, 1
add edx, dword [ebx + 0x14]
mov dword [0x1007794c], edx
cmp esi, 7
jne 0x100049dd
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 0x10077880
mov dword [ebp - 0x254], 0
call fcn.10012320
mov eax, dword [0x10077944]
lea edx, [ebp - 0x254]
mov ecx, dword [0x100778c4]
add esp, 0x1c
push edx
push eax
push dword [0x1007794c]
lea edx, [ecx + 0x18]
push eax
push dword [ecx + 0xc]
add ecx, 0x50
call fcn.1001b760
mov esi, eax
add esp, 0x14
test esi, esi
je 0x10004d21
mov eax, dword [0x10077880]
test eax, eax
je 0x10004d0e
cmp dword [eax + 0x10], 0
je 0x10004d0e
cmp dword [0x10075388], edi
jl 0x10004d0e
cmp esi, 0xffff9700
je 0x10004d0e
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.1002f1c0
mov eax, dword [0x10077880]
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.10045387
mov esp, ebp
pop ebp
ret
mov eax, dword [0x1007794c]
cmp eax, dword [ebp - 0x254]
je 0x1000528e
push str.should_never_happen
push 0x604
jmp 0x1000531a
mov edx, dword [0x100778c4]
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 0x10077880
call fcn.10012320
mov ecx, dword [0x100778c4]
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.1001b760
mov ebx, eax
add esp, 0x34
test ebx, ebx
je 0x10004e0e
mov eax, dword [0x10077880]
test eax, eax
je 0x10004dfb
cmp dword [eax + 0x10], 0
je 0x10004dfb
cmp dword [0x10075388], 1
jl 0x10004dfb
cmp ebx, 0xffff9700
je 0x10004dfb
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.1002f1c0
mov eax, dword [0x10077880]
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.10045387
mov esp, ebp
pop ebp
ret
cmp esi, dword [ebp - 0x258]
je 0x10004e25
push str.should_never_happen
push 0x6af
jmp 0x1000531a
cmp dword [0x10077894], 2
jge 0x10004e47
mov ecx, dword [0x100778c4]
push dword [ecx + 0xc]
lea eax, [ecx + 0x78]
push eax
lea eax, [ecx + 0x18]
push eax
call fcn.10047450
add esp, 0xc
test edi, edi
jne 0x1000527a
push str.using_encrypt_then_mac
push 0x6ce
push str.C:UserspentesterDownloadsxxxxxxxcs4.5externalmbedtls_2.14.1library_ssl_tls.c
push 3
push 0x10077880
call fcn.10012320
mov eax, dword [0x10077934]
lea edx, [edi + 4]
add esp, 0x14
mov ecx, dword [eax]
mov eax, dword [eax + 4]
mov dword [ebp - 0x14], ecx
mov ecx, dword [0x10077938]
mov dword [ebp - 0x10], eax
push 0xd
mov ax, word [ecx]
mov word [ebp - 0xc], ax
movzx eax, byte [ecx + 2]
mov ecx, 0x10077880
mov byte [ebp - 0xa], al
movzx eax, byte [0x1007794d]
mov byte [ebp - 9], al
movzx eax, byte [0x1007794c]
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.100123e0
mov ecx, dword [0x100778c4]
add esp, 0x14
lea eax, [ecx + 0x38]
test eax, eax
je 0x10004ef9
mov edx, dword [eax]
test edx, edx
je 0x10004ef9
cmp dword [eax + 8], edi
je 0x10004ef9
push 0xd
lea ecx, [ebp - 0x14]
push ecx
push dword [eax + 4]
mov eax, dword [edx + 0x14]
call eax
mov ecx, dword [0x100778c4]
add esp, 0xc
lea eax, [ecx + 0x38]
test eax, eax
je 0x10004f29
mov edx, dword [eax]
test edx, edx
je 0x10004f29
cmp dword [eax + 8], 0
je 0x10004f29
push dword [0x1007794c]
push dword [0x10077940]
push dword [eax + 4]
mov eax, dword [edx + 0x14]
call eax
mov ecx, dword [0x100778c4]
add esp, 0xc
add ecx, 0x38
lea edx, [ebp - 0x50]
call fcn.10014da0
mov esi, dword [0x100778c4]
add esi, 0x38
je 0x10004f6c
mov eax, dword [esi]
test eax, eax
je 0x10004f6c
mov ebx, dword [esi + 8]
test ebx, ebx
je 0x10004f6c
push dword [esi + 4]
mov eax, dword [eax + 0x10]
call eax
add esp, 4
test eax, eax
jne 0x10004f6c
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 [0x100778c4]
push dword [eax + 0x14]
lea eax, [ebp - 0x50]
push eax
mov eax, dword [0x10077940]
add eax, dword [0x1007794c]
push eax
call fcn.10047450
mov eax, dword [0x100778c4]
add esp, 0xc
mov eax, dword [eax + 0x14]
add dword [0x1007794c], eax
inc edi
jmp 0x1000527a
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 [0x10077934]
mov ecx, dword [eax]
mov eax, dword [eax + 4]
mov dword [ebp - 0x10], eax
movzx eax, byte [0x10077948]
mov byte [ebp - 0xc], al
mov eax, dword [0x10077880]
mov dword [ebp - 0x14], ecx
mov ecx, dword [0x10077890]
test byte [eax + 0xcc], 2
je 0x1000500d
mov al, 1
sub al, cl
cmp dword [0x10077894], 2
mov byte [ebp - 0xb], al
mov ecx, 1
mov eax, dword [0x10077894]
movzx eax, al
cmovne ecx, eax
neg cl
mov byte [ebp - 0xa], cl
jmp 0x10005018
mov eax, dword [0x10077894]
mov byte [ebp - 0xb], cl
mov byte [ebp - 0xa], al
mov al, byte [0x1007794d]
mov ecx, 0x10077880
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.100123e0
add esp, 0x14
cmp dword [ebx + 0xc], 0xc
jne 0x100052bf
mov eax, dword [ebx + 0x10]
cmp eax, 4
jne 0x1000507e
mov eax, dword [ebx + 0x18]
mov dword [ebp - 0x20], eax
mov eax, dword [0x10077934]
mov ecx, dword [eax]
mov edx, dword [eax + 4]
mov eax, dword [0x10077940]
mov dword [ebp - 0x1c], ecx
mov dword [ebp - 0x18], edx
mov dword [eax], ecx
mov dword [eax + 4], edx
jmp 0x100050be
cmp eax, 0xc
jne 0x100052bf
mov eax, dword [ebx + 0x20]
lea ecx, [ebp - 0x1c]
movq xmm0, qword [ebx + 0x18]
mov edx, 8
mov esi, dword [0x10077934]
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 0x100050b0
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, 0x10077880
call fcn.100123e0
add esp, 0x14
mov edx, 4
mov ecx, 0x10077880
push dword [ebp - 0x258]
push dword [0x10077940]
push str.IV_used__transmitted_
push 0x646
push str.C:UserspentesterDownloadsxxxxxxxcs4.5externalmbedtls_2.14.1library_ssl_tls.c
call fcn.100123e0
mov eax, dword [0x1007794c]
add esp, 0x14
mov esi, dword [0x10077944]
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 0x10077880
mov dword [0x1007794c], eax
call fcn.10012320
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.1001bcd0
mov esi, eax
add esp, 0x24
test esi, esi
je 0x10005228
mov eax, dword [0x10077880]
test eax, eax
je 0x10004d0e
cmp dword [eax + 0x10], 0
je 0x10004d0e
cmp dword [0x10075388], 1
jl 0x10004d0e
cmp esi, 0xffff9700
je 0x10004d0e
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.1002f1c0
mov eax, dword [0x10077880]
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.10045387
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0x254]
cmp dword [ebp - 0x25c], eax
je 0x10005245
push str.should_never_happen
push 0x663
jmp 0x1000531a
mov eax, dword [ebp - 0x258]
mov edx, 4
add dword [0x1007794c], eax
mov ecx, 0x10077880
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.100123e0
add esp, 0x14
cmp edi, 1
je 0x1000528e
push str.should_never_happen
push 0x6f0
jmp 0x1000531a
push str.__encrypt_buf
push 0x6f4
push str.C:UserspentesterDownloadsxxxxxxxcs4.5externalmbedtls_2.14.1library_ssl_tls.c
push 2
push 0x10077880
call fcn.10012320
add esp, 0x14
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.10045387
mov esp, ebp
pop ebp
ret
push str.should_never_happen
push 0x63f
jmp 0x1000531a
push str.should_never_happen
push 0x5de
jmp 0x1000531a
push dword [0x1007794c]
mov edx, 4
mov ecx, 0x10077880
push dword [0x10077944]
push str.before_encrypt:_output_payload
push 0x5af
push str.C:UserspentesterDownloadsxxxxxxxcs4.5externalmbedtls_2.14.1library_ssl_tls.c
call fcn.100123e0
add esp, 0x14
push str.should_never_happen
push 0x6e9
jmp 0x1000531a
push str.should_never_happen
push 0x5a8
push str.C:UserspentesterDownloadsxxxxxxxcs4.5externalmbedtls_2.14.1library_ssl_tls.c
push 1
push 0x10077880
call fcn.10012320
mov eax, 0xffff9400
add esp, 0x14
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.10045387
mov esp, ebp
pop ebp
ret