Function at 0x591a20
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x454
cmp dword [esp + 0x458], 0
push ebx
mov ebx, ecx
mov dword [esp + 0xc], ebx
jbe 0x591a46
mov eax, 0x82650004
pop ebx
add esp, 0x454
ret 0x14
mov ecx, dword [ebx]
push edi
mov edi, dword [esp + 0x464]
add ecx, 0x80
mov eax, dword [edi]
mov edx, dword [eax + 0x18]
mov eax, dword [ebx + 4]
adc eax, 0
push eax
push ecx
push 0
mov ecx, edi
call edx
mov dword [esp + 0xc], eax
test eax, eax
js 0x59212d
push dword [ebx + 0x14]
call fcn.004463f0
mov edi, eax
add esp, 4
mov dword [esp + 0x1c], edi
test edi, edi
jne 0x591a9a
pop edi
mov eax, 0x826503e8
pop ebx
add esp, 0x454
ret 0x14
mov ecx, dword [ebx + 0x20]
push esi
mov esi, dword [esp + 0x46c]
lea eax, [ecx - 1]
mov esi, dword [esi + 0x10]
mov dword [esp + 0x24], esi
cmp eax, 0x17
ja case.0x591abb.5
movzx eax, byte [eax + 0x592144]
jmp dword [eax*4 + 0x592138]
mov eax, dword [ebx + 0x14]
xor edx, edx
shl eax, 3
div dword [ebx + 0x18]
jmp 0x591ad2
mov eax, dword [ebx + 0x14]
cmp esi, eax
jbe case.0x591abb.5
mov dword [esp + 0x24], eax
mov eax, dword [esp + 0x46c]
push ebp
xor ebp, ebp
mov dword [esp + 0x2c], ebp
mov eax, dword [eax + 0x43c]
mov edx, dword [eax + 0xc]
mov eax, dword [ebx + 0x14]
mov dword [esp + 0x4c], edx
cmp edx, eax
jbe 0x591b00
mov dword [esp + 0x4c], eax
xor ebx, ebx
lea esi, [esp + 0x64]
mov dword [esp + 0x30], esi
mov dword [esp + 0x40], ebx
cmp ecx, 1
je 0x591b25
cmp ecx, 8
je 0x591b25
mov dword [esp + 0x48], 1
cmp ecx, 0x18
jne 0x591b29
mov dword [esp + 0x48], ebx
mov eax, dword [esp + 0x470]
mov ecx, dword [esp + 0x478]
push 1
mov dword [esp + 0x40], ebx
push dword [eax + 0x14]
call fcn.005ab900
mov eax, dword [esp + 0x470]
xor edx, edx
mov dword [esp + 0x38], edx
cmp dword [eax + 0x14], edx
jle 0x591ebf
jmp 0x591b60
mov ecx, dword [eax + 0x43c]
lea edi, [esp + 0x14]
push edi
lea edi, [esp + 0x54]
push edi
mov eax, dword [ecx]
push 2
push edx
call dword [eax + 0x28]
mov edi, dword [esp + 0x24]
mov edx, eax
mov dword [esp + 0x20], edx
test edx, edx
je 0x591ebf
cmp dword [esp + 0x48], 0
je 0x591bb0
mov eax, dword [esp + 0x470]
mov ecx, dword [eax + 0x43c]
push dword [ecx + 0xc]
push 0
push edx
call fcn.004b40a0
mov edx, dword [esp + 0x2c]
add esp, 0xc
mov ecx, dword [esp + 0x18]
mov dword [esp + 0x44], 0
cmp dword [ecx + 0x1c], 0
jbe 0x591db0
lea eax, [edx + 2]
mov dword [esp + 0x1c], eax
lea ecx, [ecx]
cmp dword [ecx + 0x10], 0
je 0x591d01
mov eax, dword [ecx + 0x14]
xor edi, edi
test eax, eax
je 0x591cd8
test ebp, ebp
je 0x591c23
cmp dword [esp + 0x3c], 0
jne 0x591c23
sub eax, edi
mov esi, ebp
cmp ebp, eax
jbe 0x591bfc
mov esi, eax
movzx eax, byte [esp + 0x13]
push esi
push eax
mov eax, dword [esp + 0x2c]
add eax, edi
push eax
call fcn.004b40a0
add edi, esi
add esp, 0xc
sub ebp, esi
mov esi, dword [esp + 0x30]
mov dword [esp + 0x2c], ebp
jmp 0x591cc5
test ebx, ebx
jne 0x591c70
mov ecx, dword [esp + 0x46c]
lea edx, [esp + 0x34]
push edx
mov ebx, 0x400
lea esi, [esp + 0x68]
push ebx
mov eax, dword [ecx]
mov edx, esi
push edx
mov dword [esp + 0x4c], ebx
mov dword [esp + 0x3c], esi
call dword [eax + 0x1c]
mov dword [esp + 0x14], eax
test eax, eax
jns 0x591c70
cmp dword [esp + 0x34], 0
je 0x591cf7
lea ecx, [eax + 0x7dfdfc16]
neg ecx
sbb ecx, ecx
and ecx, eax
mov dword [esp + 0x14], ecx
cmp dword [esp + 0x3c], 0
mov cl, byte [esi]
je 0x591c87
mov byte [esp + 0x13], cl
mov dword [esp + 0x3c], 0
jmp 0x591cbb
mov al, cl
and al, 0xc0
cmp al, 0xc0
jne 0x591cb3
movzx ebp, cl
and ebp, 0x3f
mov dword [esp + 0x2c], ebp
cmp ebx, 1
jbe 0x591ca9
mov al, byte [esi + 1]
inc esi
mov byte [esp + 0x13], al
dec ebx
jmp 0x591cbb
mov dword [esp + 0x3c], 1
jmp 0x591cbb
mov eax, dword [esp + 0x24]
mov byte [edi + eax], cl
inc edi
inc esi
dec ebx
mov dword [esp + 0x30], esi
mov dword [esp + 0x40], ebx
mov ecx, dword [esp + 0x18]
mov eax, dword [ecx + 0x14]
cmp edi, eax
jb 0x591be7
mov edx, dword [esp + 0x20]
mov edi, dword [esp + 0x24]
mov eax, dword [ecx + 0x20]
dec eax
cmp eax, 0x17
ja case.0x591cf0.5
movzx eax, byte [eax + 0x592170]
jmp dword [eax*4 + 0x59215c]
mov edx, dword [esp + 0x20]
mov ecx, dword [esp + 0x18]
jmp 0x591cd8
mov edx, dword [esp + 0x46c]
lea esi, [esp + 0x34]
push esi
push dword [ecx + 0x14]
mov ecx, edx
mov eax, dword [edx]
push edi
call dword [eax + 0x1c]
mov edx, dword [esp + 0x20]
mov ecx, dword [esp + 0x18]
mov dword [esp + 0x14], eax
jmp 0x591cdc
push dword [esp + 0x4c]
push edi
push edx
call fcn.004b3b20
add esp, 0xc
jmp 0x591d69
mov ebx, dword [esp + 0x28]
xor esi, esi
test ebx, ebx
je case.0x591cf0.5
mov ebp, dword [esp + 0x20]
mov ecx, esi
mov eax, esi
shr ecx, 2
and eax, 3
mov dl, byte [ecx + edi]
mov cl, byte [eax*4 + 0x6abc50]
shr dl, cl
and dl, 3
mov byte [esi + ebp], dl
inc esi
cmp esi, ebx
jb 0x591d44
mov ebp, dword [esp + 0x2c]
mov ecx, dword [esp + 0x18]
mov esi, dword [esp + 0x1c]
mov eax, dword [esp + 0x14]
test eax, eax
js 0x591da8
and eax, 0xc0000000
cmp eax, 0x40000000
je 0x591da8
mov eax, dword [esp + 0x44]
dec esi
mov ebx, dword [esp + 0x40]
inc eax
mov edx, dword [esp + 0x20]
mov dword [esp + 0x1c], esi
mov esi, dword [esp + 0x30]
mov dword [esp + 0x44], eax
cmp eax, dword [ecx + 0x1c]
jb 0x591bd0
mov ebx, dword [esp + 0x40]
mov esi, dword [esp + 0x30]
mov eax, dword [esp + 0x470]
lea edx, [esp + 0x50]
push edx
mov ecx, dword [eax + 0x43c]
mov eax, dword [ecx]
call dword [eax + 0x24]
mov eax, dword [esp + 0x14]
test eax, eax
js 0x591ebf
and eax, 0xc0000000
cmp eax, 0x40000000
je 0x591ebf
mov ecx, dword [esp + 0x478]
push 1
call fcn.005ab9e0
test eax, eax
je 0x591eb7
mov edx, dword [esp + 0x38]
mov eax, dword [esp + 0x470]
inc edx
mov dword [esp + 0x38], edx
cmp edx, dword [eax + 0x14]
jl 0x591b60
jmp 0x591ebf
cmp dword [ecx + 0x1c], 1
jne 0x591e51
mov esi, dword [esp + 0x28]
xor edx, edx
mov ebx, 4
test esi, esi
je case.0x591cf0.5
mov ebp, dword [esp + 0x20]
mov eax, edx
mov cl, bl
shr eax, 1
xor ebx, 4
mov al, byte [eax + edi]
shr al, cl
and al, 0xf
mov byte [edx + ebp], al
inc edx
cmp edx, esi
jb 0x591e34
jmp 0x591d65
mov ebx, dword [esp + 0x28]
xor eax, eax
test ebx, ebx
je case.0x591cf0.5
mov ebp, dword [esp + 0x20]
mov esi, dword [esp + 0x44]
mov ecx, eax
mov edx, eax
shr ecx, 3
and edx, 7
mov cl, byte [ecx + edi]
test byte [edx + 0x6abc68], cl
je 0x591e85
mov cl, byte [esi + 0x6abc60]
or byte [eax + ebp], cl
inc eax
cmp eax, ebx
jb 0x591e67
jmp 0x591d65
mov ebx, dword [esp + 0x28]
xor ecx, ecx
mov esi, dword [esp + 0x1c]
mov edx, esi
test ebx, ebx
je 0x591eae
nop
mov al, byte [ecx + edi]
lea edx, [edx + 3]
inc ecx
mov byte [edx - 3], al
cmp ecx, ebx
jb 0x591ea0
mov ecx, dword [esp + 0x18]
jmp 0x591d71
mov dword [esp + 0x14], 0x826504c7
push edi
call fcn.00446420
mov ecx, dword [esp + 0x47c]
add esp, 4
call fcn.005ab810
mov eax, dword [esp + 0x470]
cmp dword [eax], 2
jne 0x592127
cmp dword [eax + 0x2c], 0x10
jbe 0x592127
mov eax, dword [esp + 0x14]
test eax, eax
js 0x59212b
mov edi, dword [esp + 0x46c]
mov byte [esp + 0x13], 0
test ebx, ebx
je 0x591f1a
mov esi, dword [edi]
neg ebx
mov eax, ebx
mov ecx, edi
cdq
push edx
push eax
push 1
call dword [esi + 0x18]
mov eax, dword [edi]
lea ecx, [esp + 0x34]
push ecx
push 1
lea ecx, [esp + 0x1b]
push ecx
mov ecx, edi
call dword [eax + 0x1c]
mov cl, byte [esp + 0x13]
mov ebx, eax
cmp cl, 0xc
je 0x591fd7
cmp cl, 0xa
je 0x591fc5
mov edx, dword [esp + 0x18]
mov byte [esp + 0x13], 0
mov esi, dword [edx]
mov ecx, dword [edx + 8]
mov eax, dword [edx + 4]
add ecx, esi
mov edx, dword [edx + 0xc]
adc edx, eax
sub ecx, 0x301
sbb edx, 0
add esi, 0x80
adc eax, 0
cmp edx, eax
jl 0x5920fc
jg 0x591f81
cmp ecx, esi
jbe 0x5920fc
mov eax, dword [edi]
push edx
push ecx
push 0
mov ecx, edi
call dword [eax + 0x18]
mov dword [esp + 0x14], eax
test eax, eax
jns 0x591f9f
mov cl, byte [esp + 0x13]
mov ebx, 0x42650005
jmp 0x591fc9
mov eax, dword [edi]
lea ecx, [esp + 0x34]
push ecx
push 1
lea ecx, [esp + 0x1b]
push ecx
mov ecx, edi
call dword [eax + 0x1c]
mov cl, byte [esp + 0x13]
mov dword [esp + 0x14], eax
test eax, eax
jns 0x591fc9
mov ebx, 0x42650005
jmp 0x591fc9
mov eax, dword [esp + 0x14]
cmp cl, 0xc
je 0x591fd7
cmp cl, 0xa
jne 0x592100
mov eax, dword [edi]
mov ecx, edi
mov eax, dword [eax + 4]
call eax
mov ebp, eax
mov dword [esp + 0x38], edx
mov eax, dword [esp + 0x470]
mov ecx, dword [eax + 0x2c]
mov eax, dword [esp + 0x18]
lea esi, [ecx + ecx*2]
mov edi, dword [eax + 8]
mov edx, esi
add edi, dword [eax]
mov ecx, dword [eax + 0xc]
adc ecx, dword [eax + 4]
xor eax, eax
add edx, ebp
adc eax, dword [esp + 0x38]
cmp eax, ecx
jl 0x59203e
jg 0x592016
cmp edx, edi
jbe 0x59203e
mov esi, edi
sub esi, ebp
sbb ecx, dword [esp + 0x38]
js 0x59202c
jg 0x592027
cmp esi, 0xffffffff
jbe 0x59202c
or esi, 0xffffffff
jmp 0x592046
test ecx, ecx
jl 0x5920fc
jg 0x59203e
test esi, esi
jb 0x5920fc
test esi, esi
je 0x5920fc
mov edi, dword [esp + 0x46c]
lea ecx, [esp + 0x34]
push ecx
push esi
lea ecx, [esp + 0x6c]
mov eax, dword [edi]
push ecx
mov ecx, edi
call dword [eax + 0x1c]
mov ebx, eax
test ebx, ebx
js 0x5920fc
mov eax, 0xaaaaaaab
mul esi
mov esi, edx
shr esi, 1
test esi, esi
jle 0x5920fc
cmp byte [esp + 0x13], 0xc
jne 0x5920b3
mov edx, dword [esp + 0x470]
lea ecx, [esp + 0x66]
add edx, 0x35
movzx eax, byte [ecx - 2]
lea ecx, [ecx + 3]
mov byte [edx + 1], al
lea edx, [edx + 4]
movzx eax, byte [ecx - 4]
mov byte [edx - 4], al
movzx eax, byte [ecx - 3]
mov byte [edx - 5], al
sub esi, 1
jne 0x592091
jmp 0x5920fc
mov edi, dword [esp + 0x470]
lea edx, [esp + 0x66]
add edi, 0x35
mov cl, byte [edx - 2]
lea edx, [edx + 3]
mov al, cl
lea edi, [edi + 4]
shr al, 4
shl cl, 2
or al, cl
mov cl, byte [edx - 4]
mov byte [edi - 3], al
mov al, cl
shr al, 4
shl cl, 2
or al, cl
mov cl, byte [edx - 3]
mov byte [edi - 4], al
mov al, cl
shr al, 4
shl cl, 2
or al, cl
mov byte [edi - 5], al
sub esi, 1
jne 0x5920c1
mov eax, dword [esp + 0x14]
mov ecx, eax
and ecx, 0xc0000000
cmp ecx, 0x80000000
je 0x59212b
cmp ecx, 0x40000000
je 0x59212b
pop ebp
pop esi
pop edi
mov eax, ebx
pop ebx
add esp, 0x454
ret 0x14
mov eax, dword [esp + 0x14]
pop ebp
pop esi
pop edi
pop ebx
add esp, 0x454
ret 0x14