Function at 0x581960
Capabilities:
Encode data using xor

Disassembly:
mov eax, 0x18
call fcn.006149d0
cmp dword [esp + 0x20], 0
push ebx
push ebp
push esi
mov dword [esp + 0x10], 0
jle 0x581c50
mov esi, dword [esp + 0x34]
test esi, esi
jle 0x581c50
mov ebp, dword [esp + 0x38]
cmp esi, ebp
jg 0x581c26
cmp ebp, 0xb
jl 0x581c26
push 0xc2
push str.crypto_rsa_rsa_pk1.c
push ebp
call fcn.004829d0
mov ebx, eax
add esp, 0xc
test ebx, ebx
je 0x581c50
mov edx, dword [esp + 0x30]
push edi
add edx, esi
mov edi, ebp
add ebx, ebp
nop dword [eax]
mov eax, esi
mov dword [esp + 0x18], ebx
not eax
lea ecx, [esi - 1]
shr eax, 0x1f
dec ebx
shr ecx, 0x1f
and ecx, eax
dec ecx
mov eax, ecx
and eax, 1
sub edx, eax
sub esi, eax
mov al, byte [edx]
and al, cl
mov byte [ebx], al
sub edi, 1
jne 0x5819d0
mov eax, dword [esp + 0x18]
mov esi, 2
mov dword [esp + 0x1c], ebx
movzx ecx, byte [eax]
movzx eax, byte [ebx]
xor ecx, 2
dec ecx
dec eax
shr ecx, 0x1f
shr eax, 0x1f
neg ecx
neg eax
and ecx, eax
mov dword [esp + 0x10], ecx
movzx edx, byte [ebx + esi]
mov eax, edi
dec edx
not eax
shr edx, 0x1f
neg edx
and eax, edx
or edi, edx
mov dword [esp + 0x18], eax
not eax
mov dword [esp + 0x20], eax
mov ecx, dword [esp + 0x18]
mov eax, dword [esp + 0x20]
and ecx, esi
and eax, dword [esp + 0x14]
inc esi
or eax, ecx
mov dword [esp + 0x14], eax
cmp esi, ebp
jl 0x581a21
mov esi, dword [esp + 0x30]
lea edi, [ebp - 0xb]
mov edx, ebp
mov ecx, esi
sub edx, eax
dec edx
sub ecx, edx
mov dword [esp + 0x18], edx
xor ecx, edx
mov eax, edx
mov edx, dword [esp + 0x14]
xor eax, esi
or ecx, eax
xor ecx, esi
shr ecx, 0x1f
dec ecx
lea eax, [edx - 0xa]
or eax, edx
xor eax, edx
mov edx, dword [esp + 0x10]
shr eax, 0x1f
dec eax
and ecx, eax
mov eax, edi
and edx, ecx
xor eax, esi
mov ecx, edi
mov dword [esp + 0x10], edx
sub ecx, esi
xor ecx, esi
or ecx, eax
xor ecx, edi
shr ecx, 0x1f
neg ecx
mov dword [esp + 0x30], ecx
not ecx
mov dword [esp + 0x20], ecx
mov eax, dword [esp + 0x30]
mov ecx, dword [esp + 0x20]
and eax, edi
and ecx, esi
mov esi, 1
or ecx, eax
mov dword [esp + 0x30], ecx
cmp edi, esi
jle 0x581b47
mov eax, ebp
sub eax, dword [esp + 0x18]
add eax, 0xfffffff5
mov dword [esp + 0x24], eax
and eax, esi
mov edi, ebp
sub edi, esi
lea ecx, [eax - 1]
not eax
shr ecx, 0x1f
shr eax, 0x1f
and ecx, eax
dec ecx
cmp edi, 0xb
jle 0x581b32
movzx ebp, cl
lea eax, [ebx + 0xb]
mov dword [esp + 0x20], ebp
add edi, 0xfffffff5
mov ebx, dword [esp + 0x20]
not ebp
mov dword [esp + 0x20], ebx
lea eax, [eax + 1]
mov dword [esp + 0x14], ebp
mov ecx, dword [esp + 0x20]
mov dl, byte [eax + esi - 1]
and dl, cl
mov ecx, dword [esp + 0x14]
and cl, byte [eax - 1]
or cl, dl
mov byte [eax - 1], cl
sub edi, 1
jne 0x581b04
mov ebx, dword [esp + 0x1c]
mov ebp, dword [esp + 0x3c]
lea eax, [ebp - 0xb]
add esi, esi
cmp esi, eax
mov eax, dword [esp + 0x24]
jl 0x581ad8
mov edx, dword [esp + 0x10]
mov ecx, dword [esp + 0x30]
xor esi, esi
test ecx, ecx
jle 0x581bbc
mov eax, dword [esp + 0x18]
mov edi, dword [esp + 0x18]
shr eax, 0x1f
neg edi
mov dword [esp + 0x14], eax
lea eax, [ebx + 0xb]
mov ebx, dword [esp + 0x14]
mov ebp, eax
mov dword [esp + 0x24], eax
nop dword [eax + eax]
mov eax, edi
inc edi
shr eax, 0x1f
xor al, bl
or al, bl
mov ebx, dword [esp + 0x2c]
neg al
movzx ecx, al
movzx eax, dl
and ecx, eax
mov dword [esp + 0x24], ecx
not ecx
mov dword [esp + 0x20], ecx
mov eax, dword [esp + 0x24]
mov cl, byte [esi + ebp]
and cl, al
mov eax, dword [esp + 0x20]
and al, byte [esi + ebx]
or al, cl
mov ecx, ebx
mov ebx, dword [esp + 0x14]
mov byte [esi + ecx], al
inc esi
cmp esi, dword [esp + 0x30]
jl 0x581b70
mov ebx, dword [esp + 0x1c]
mov ebp, dword [esp + 0x3c]
push 0x108
push str.crypto_rsa_rsa_pk1.c
push ebp
push ebx
call fcn.00482af0
call fcn.0048aed0
push str.RSA_padding_check_PKCS1_type_2
push 0x10f
push str.crypto_rsa_rsa_pk1.c
call fcn.0048afd0
push 0
push 0x9f
push 4
call fcn.0048b0e0
mov esi, dword [esp + 0x38]
mov eax, esi
and eax, 1
push eax
call fcn.004a9040
add esp, 0x2c
mov dword [esp + 0x30], esi
not esi
mov dword [esp + 0x24], esi
mov ecx, dword [esp + 0x30]
and ecx, dword [esp + 0x18]
mov eax, dword [esp + 0x24]
pop edi
pop esi
pop ebp
or eax, ecx
pop ebx
add esp, 0x18
ret
call fcn.0048aed0
push str.RSA_padding_check_PKCS1_type_2
push 0xbe
push str.crypto_rsa_rsa_pk1.c
call fcn.0048afd0
push 0
push 0x9f
push 4
call fcn.0048b0e0
add esp, 0x18
pop esi
pop ebp
or eax, 0xffffffff
pop ebx
add esp, 0x18
ret