Function at 0x585070
Capabilities:
Encode data using xor

Disassembly:
cmp dword [esp + 0x18], 0
je 0x585084
mov dword [esp + 0x18], fcn.00585c10
jmp 0x59dd40
mov dword [esp + 0x18], fcn.005869d0
jmp 0x59dee0
mov eax, 0x14
call fcn.00549c70
mov eax, dword [esp + 0x28]
push ebx
mov ebx, dword [esp + 0x24]
push ebp
push esi
mov esi, dword [esp + 0x24]
push edi
mov edi, dword [esp + 0x2c]
mov ebp, eax
cmp ebx, 0x10
jb 0x59ddba
shr ebx, 4
mov dword [esp + 0x10], ebx
lea esp, [esp]
mov ecx, edi
sub ebp, esi
mov eax, esi
sub ecx, esi
mov edx, 4
lea ecx, [ecx]
mov ebx, dword [eax + ebp]
xor ebx, dword [eax]
add eax, 4
dec edx
mov dword [ecx + eax - 4], ebx
jne 0x59dd80
mov eax, dword [esp + 0x34]
push eax
push edi
push edi
call dword [esp + 0x48]
mov ebx, dword [esp + 0x3c]
mov ebp, edi
sub ebx, 0x10
add esp, 0xc
add esi, 0x10
add edi, 0x10
dec dword [esp + 0x10]
mov dword [esp + 0x30], ebx
jne 0x59dd70
mov eax, dword [esp + 0x38]
test ebx, ebx
je 0x59deb7
mov ecx, edi
sub ecx, esi
mov dword [esp + 0x14], ecx
mov ecx, 1
sub ecx, esi
mov dword [esp + 0x18], ecx
mov ecx, 2
sub ecx, esi
mov dword [esp + 0x1c], ecx
mov edx, ebp
sub edx, esi
mov ecx, 3
xor eax, eax
sub ecx, esi
mov dword [esp + 0x10], edx
mov dword [esp + 0x20], ecx
jmp 0x59ddfb
mov edx, dword [esp + 0x10]
cmp eax, ebx
jae 0x59de69
mov ebx, dword [esp + 0x14]
lea ecx, [eax + esi]
mov dl, byte [edx + ecx]
xor dl, byte [ecx]
mov byte [ebx + ecx], dl
mov edx, dword [esp + 0x18]
mov ebx, dword [esp + 0x30]
add edx, ecx
cmp edx, ebx
jae 0x59de5e
mov dl, byte [esi + eax + 1]
xor dl, byte [eax + ebp + 1]
mov byte [edi + eax + 1], dl
mov edx, dword [esp + 0x1c]
add edx, ecx
cmp edx, ebx
jae 0x59de61
mov dl, byte [esi + eax + 2]
xor dl, byte [eax + ebp + 2]
mov byte [edi + eax + 2], dl
mov edx, dword [esp + 0x20]
add edx, ecx
cmp edx, ebx
jae 0x59de66
mov cl, byte [esi + eax + 3]
xor cl, byte [eax + ebp + 3]
add eax, 4
mov byte [edi + eax - 1], cl
cmp eax, 0x10
jb 0x59ddf7
jmp 0x59de89
inc eax
jmp 0x59de69
add eax, 2
jmp 0x59de69
add eax, 3
cmp eax, 0x10
jae 0x59de89
mov edx, 0x10
sub ebp, edi
lea ecx, [eax + edi]
sub edx, eax
lea ebx, [ebx]
mov al, byte [ecx + ebp]
mov byte [ecx], al
inc ecx
dec edx
jne 0x59de80
mov ecx, dword [esp + 0x34]
push ecx
push edi
push edi
call dword [esp + 0x48]
add esp, 0xc
mov ebp, edi
cmp ebx, 0x10
jbe 0x59deb3
sub ebx, 0x10
add esi, 0x10
add edi, 0x10
mov dword [esp + 0x30], ebx
test ebx, ebx
jne 0x59ddc2
mov eax, dword [esp + 0x38]
mov edx, dword [ebp]
mov dword [eax], edx
mov ecx, dword [ebp + 4]
mov dword [eax + 4], ecx
mov edx, dword [ebp + 8]
pop edi
mov dword [eax + 8], edx
mov ecx, dword [ebp + 0xc]
pop esi
pop ebp
mov dword [eax + 0xc], ecx
pop ebx
add esp, 0x14
ret
mov eax, 0x3c
call fcn.00549c70
mov eax, dword [0x669404]
xor eax, esp
mov dword [esp + 0x38], eax
mov eax, dword [esp + 0x4c]
mov ecx, dword [esp + 0x54]
push ebx
mov ebx, dword [esp + 0x48]
push ebp
mov ebp, dword [esp + 0x50]
push esi
mov esi, dword [esp + 0x4c]
push edi
mov edi, dword [esp + 0x60]
mov dword [esp + 0x30], eax
mov dword [esp + 0x28], ecx
cmp esi, ebx
je 0x59df90
mov eax, edi
mov dword [esp + 0x14], eax
cmp ebp, 0x10
jb 0x59df75
mov eax, ebp
shr eax, 4
mov dword [esp + 0x18], eax
mov edx, dword [esp + 0x30]
push edx
push ebx
push esi
call dword [esp + 0x34]
mov ecx, dword [esp + 0x20]
add esp, 0xc
mov eax, ebx
sub ecx, ebx
mov dword [esp + 0x1c], 4
nop
mov edx, dword [ecx + eax]
xor dword [eax], edx
add eax, 4
dec dword [esp + 0x1c]
jne 0x59df50
mov dword [esp + 0x14], esi
sub ebp, 0x10
add esi, 0x10
add ebx, 0x10
dec dword [esp + 0x18]
jne 0x59df31
mov eax, dword [esp + 0x14]
mov ecx, dword [eax]
mov dword [edi], ecx
mov edx, dword [eax + 4]
mov dword [edi + 4], edx
mov ecx, dword [eax + 8]
mov dword [edi + 8], ecx
mov edx, dword [eax + 0xc]
mov dword [edi + 0xc], edx
jmp 0x59e031
cmp ebp, 0x10
jb 0x59e031
lea ecx, [esp + 0x38]
mov eax, edi
sub eax, ecx
mov dword [esp + 0x20], eax
mov eax, ebx
mov edx, ecx
sub eax, edx
mov dword [esp + 0x18], eax
mov eax, esi
sub eax, ecx
mov dword [esp + 0x14], eax
mov eax, ebp
shr eax, 4
mov dword [esp + 0x24], eax
shl eax, 4
add ebx, eax
mov edx, dword [esp + 0x30]
push edx
lea eax, [esp + 0x3c]
push eax
push esi
call dword [esp + 0x34]
add esp, 0xc
xor eax, eax
mov dword [esp + 0x1c], eax
lea ecx, [ecx]
mov ecx, dword [esp + 0x14]
lea eax, [esp + eax + 0x38]
mov edx, dword [ecx + eax]
mov ecx, dword [esp + 0x20]
mov dword [esp + 0x2c], edx
mov edx, dword [ecx + eax]
xor edx, dword [eax]
mov ecx, dword [esp + 0x18]
mov dword [ecx + eax], edx
mov edx, dword [esp + 0x2c]
mov ecx, dword [esp + 0x20]
mov dword [ecx + eax], edx
mov eax, dword [esp + 0x1c]
add eax, 4
mov dword [esp + 0x1c], eax
cmp eax, 0x10
jb 0x59dfe0
mov eax, 0x10
add dword [esp + 0x14], eax
add dword [esp + 0x18], eax
sub ebp, eax
add esi, eax
dec dword [esp + 0x24]
jne 0x59dfc5
test ebp, ebp
je 0x59e1a9
lea edx, [esp + 0x38]
mov eax, edi
sub eax, edx
mov dword [esp + 0x20], eax
mov ecx, edx
mov eax, 1
sub eax, ecx
mov dword [esp + 0x2c], eax
mov eax, 2
sub eax, edx
mov dword [esp + 0x24], eax
mov eax, 3
sub eax, ecx
mov dword [esp + 0x34], eax
mov eax, esi
sub eax, edx
mov dword [esp + 0x18], eax
lea eax, [ebx + 2]
sub ebx, ecx
mov dword [esp + 0x14], eax
mov dword [esp + 0x1c], ebx
lea ecx, [ecx]
mov edx, dword [esp + 0x30]
push edx
lea eax, [esp + 0x3c]
push eax
push esi
call dword [esp + 0x34]
add esp, 0xc
xor eax, eax
cmp eax, ebp
jae 0x59e14c
mov edx, dword [esp + 0x18]
mov ebx, dword [esp + 0x1c]
lea ecx, [esp + eax + 0x38]
movzx edx, byte [edx + ecx]
mov byte [esp + 0x13], dl
mov edx, dword [esp + 0x20]
movzx edx, byte [edx + ecx]
xor dl, byte [ecx]
mov byte [ecx + ebx], dl
movzx edx, byte [esp + 0x13]
mov ebx, dword [esp + 0x20]
mov byte [ebx + ecx], dl
mov edx, dword [esp + 0x2c]
add edx, ecx
cmp edx, ebp
jae 0x59e184
mov dl, byte [esi + eax + 1]
movzx ebx, byte [ecx + 1]
xor bl, byte [edi + eax + 1]
mov byte [esp + 0x13], dl
mov edx, dword [esp + 0x14]
mov byte [edx + eax - 1], bl
movzx ebx, byte [esp + 0x13]
mov byte [edi + eax + 1], bl
mov ebx, dword [esp + 0x24]
add ebx, ecx
cmp ebx, ebp
jae 0x59e187
movzx ebx, byte [esi + eax + 2]
mov byte [esp + 0x13], bl
movzx ebx, byte [ecx + 2]
xor bl, byte [edi + eax + 2]
mov byte [edx + eax], bl
movzx ebx, byte [esp + 0x13]
mov byte [edi + eax + 2], bl
mov ebx, dword [esp + 0x34]
add ebx, ecx
cmp ebx, ebp
jae 0x59e18c
mov cl, byte [ecx + 3]
xor cl, byte [edi + eax + 3]
mov bl, byte [esi + eax + 3]
mov byte [edx + eax + 1], cl
mov byte [edi + eax + 3], bl
add eax, 4
cmp eax, 0x10
jb 0x59e094
mov edx, dword [esp + 0x14]
mov ebx, 0x10
cmp ebp, ebx
jbe 0x59e191
add dword [esp + 0x18], ebx
add dword [esp + 0x1c], ebx
add edx, ebx
add esi, ebx
sub ebp, ebx
mov dword [esp + 0x14], edx
jne 0x59e080
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x38]
xor ecx, esp
call fcn.00546bdc
add esp, 0x3c
ret
inc eax
jmp 0x59e14c
add eax, 2
jmp 0x59e150
add eax, 3
jmp 0x59e150
cmp eax, ebx
jae 0x59e1a9
mov edx, ebx
sub esi, edi
lea ecx, [edi + eax]
sub edx, eax
mov edi, edi
mov al, byte [esi + ecx]
mov byte [ecx], al
inc ecx
dec edx
jne 0x59e1a0
mov ecx, dword [esp + 0x48]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.00546bdc
add esp, 0x3c
ret