Function at 0x58b3d4
Capabilities:
Encode data using xor
Encrypt data using aes
Encrypt data using rc4 ksa
Reference aes constants

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffc8
cmp dword [ebp + 8], 0
je 0x58b94e
mov eax, dword [ebp + 0x10]
sub eax, 0x10
je 0x58b94e
sub eax, 8
je 0x58b94e
sub eax, 8
je 0x58b94e
mov eax, dword [ebp + 0x14]
sub eax, 0x10
je 0x58b94e
sub eax, 8
je 0x58b94e
sub eax, 8
je 0x58b94e
mov eax, dword [ebp + 0x10]
mov dword [0x5ba128], eax
mov eax, dword [ebp + 0x14]
mov dword [0x5ba12c], eax
mov edx, dword [ebp + 0xc]
mov eax, 0x5ba130
mov ecx, dword [ebp + 0x14]
call fcn.00407370
mov edx, dword [ebp + 0xc]
mov eax, 0x5ba150
mov ecx, dword [ebp + 0x14]
call fcn.00407370
mov eax, dword [ebp + 0x10]
sub eax, 0x10
je 0x58b45f
sub eax, 8
je 0x58b48f
jmp 0x58b4ad
cmp dword [ebp + 0x14], 0x10
jne 0x58b471
mov dword [0x5ba170], 0xa
jmp 0x58b4b7
cmp dword [ebp + 0x14], 0x18
jne 0x58b483
mov dword [0x5ba170], 0xc
jmp 0x58b4b7
mov dword [0x5ba170], 0xe
jmp 0x58b4b7
cmp dword [ebp + 0x14], 0x20
je 0x58b4a1
mov dword [0x5ba170], 0xc
jmp 0x58b4b7
mov dword [0x5ba170], 0xe
jmp 0x58b4b7
mov dword [0x5ba170], 0xe
mov eax, dword [ebp + 0x14]
shr eax, 2
mov dword [ebp - 4], eax
mov eax, dword [0x5ba170]
dec eax
test eax, eax
jl 0x58b50d
inc eax
mov dword [ebp - 0x34], eax
mov dword [ebp - 8], 0
mov eax, dword [ebp - 4]
dec eax
test eax, eax
jl 0x58b505
inc eax
mov dword [ebp - 0x38], eax
mov dword [ebp - 0xc], 0
mov eax, dword [ebp - 8]
shl eax, 2
lea eax, [eax*8 + 0x5b9d68]
mov edx, dword [ebp - 0xc]
xor ecx, ecx
mov dword [eax + edx*4], ecx
inc dword [ebp - 0xc]
dec dword [ebp - 0x38]
jne 0x58b4e8
inc dword [ebp - 8]
dec dword [ebp - 0x34]
jne 0x58b4d5
mov eax, dword [0x5ba170]
dec eax
test eax, eax
jl 0x58b55a
inc eax
mov dword [ebp - 0x34], eax
mov dword [ebp - 8], 0
mov eax, dword [ebp - 4]
dec eax
test eax, eax
jl 0x58b552
inc eax
mov dword [ebp - 0x38], eax
mov dword [ebp - 0xc], 0
mov eax, dword [ebp - 8]
shl eax, 2
lea eax, [eax*8 + 0x5b9d68]
mov edx, dword [ebp - 0xc]
xor ecx, ecx
mov dword [eax + edx*4], ecx
inc dword [ebp - 0xc]
dec dword [ebp - 0x38]
jne 0x58b535
inc dword [ebp - 8]
dec dword [ebp - 0x34]
jne 0x58b522
mov eax, dword [0x5ba170]
inc eax
imul dword [ebp - 4]
mov dword [ebp - 0x14], eax
mov eax, dword [ebp + 0x10]
shr eax, 2
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x1c], 0x5ba174
mov eax, dword [ebp + 8]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x18]
dec eax
test eax, eax
jl 0x58b5a9
inc eax
mov dword [ebp - 0x34], eax
mov dword [ebp - 8], 0
mov eax, dword [ebp - 0x1c]
mov edx, dword [ebp - 8]
mov ecx, dword [ebp - 0x20]
mov ecx, dword [ecx]
xor dword [eax + edx*4], ecx
add dword [ebp - 0x20], 4
inc dword [ebp - 8]
dec dword [ebp - 0x34]
jne 0x58b58f
xor eax, eax
mov dword [ebp - 0x24], eax
xor eax, eax
mov dword [ebp - 0xc], eax
jmp 0x58b613
mov eax, dword [ebp - 0x24]
cdq
idiv dword [ebp - 4]
mov ecx, edx
mov eax, dword [ebp - 0x24]
cdq
idiv dword [ebp - 0x18]
shl eax, 2
lea eax, [eax*8 + 0x5b9d68]
mov edx, dword [ebp - 0xc]
mov edx, dword [edx*4 + 0x5ba174]
mov dword [eax + ecx*4], edx
mov eax, dword [ebp - 0x24]
cdq
idiv dword [ebp - 4]
mov edx, dword [0x5ba170]
sub edx, eax
mov eax, edx
shl eax, 2
lea eax, [eax*8 + 0x5b9f48]
push eax
mov eax, dword [ebp - 0x24]
cdq
idiv dword [ebp - 4]
pop eax
mov ecx, dword [ebp - 0xc]
mov ecx, dword [ecx*4 + 0x5ba174]
mov dword [eax + edx*4], ecx
inc dword [ebp - 0x24]
inc dword [ebp - 0xc]
mov eax, dword [ebp - 0xc]
cmp eax, dword [ebp - 0x18]
jge 0x58b623
mov eax, dword [ebp - 0x24]
cmp eax, dword [ebp - 0x14]
jl 0x58b5b5
xor eax, eax
mov dword [ebp - 0x2c], eax
mov eax, dword [ebp - 0x24]
cmp eax, dword [ebp - 0x14]
jge 0x58b947
mov eax, dword [ebp - 0x18]
mov eax, dword [eax*4 + 0x5ba170]
mov dword [ebp - 0x28], eax
mov eax, dword [ebp - 0x28]
shr eax, 0x10
and eax, 0xff
mov al, byte [eax + str.cw]
and ax, 0xff
movsx eax, ax
shl eax, 0x18
xor eax, dword [0x5ba174]
mov edx, dword [ebp - 0x28]
shr edx, 8
and edx, 0xff
mov dl, byte [edx + str.cw]
and dx, 0xff
movsx edx, dx
shl edx, 0x10
xor eax, edx
mov edx, dword [ebp - 0x28]
and edx, 0xff
mov dl, byte [edx + str.cw]
and dx, 0xff
movsx edx, dx
shl edx, 8
xor eax, edx
mov edx, dword [ebp - 0x28]
shr edx, 0x18
and edx, 0xff
mov dl, byte [edx + str.cw]
and dx, 0xff
movsx edx, dx
xor eax, edx
mov edx, dword [ebp - 0x2c]
mov dl, byte [edx + 0x5b206c]
and dx, 0xff
movsx edx, dx
shl edx, 0x18
xor eax, edx
mov dword [0x5ba174], eax
inc dword [ebp - 0x2c]
mov dword [ebp - 8], 1
xor eax, eax
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0x18], 8
je 0x58b71c
mov eax, dword [ebp - 8]
cmp eax, dword [ebp - 0x18]
jge 0x58b896
mov eax, dword [ebp - 0xc]
mov eax, dword [eax*4 + 0x5ba174]
mov edx, dword [ebp - 8]
xor dword [edx*4 + 0x5ba174], eax
inc dword [ebp - 8]
inc dword [ebp - 0xc]
mov eax, dword [ebp - 8]
cmp eax, dword [ebp - 0x18]
jl 0x58b6f5
jmp 0x58b896
mov eax, dword [ebp - 0x18]
shr eax, 1
mov dword [ebp - 0x10], eax
mov dword [ebp - 8], 1
xor eax, eax
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 8]
cmp eax, dword [ebp - 0x10]
jge 0x58b75a
mov eax, dword [ebp - 0xc]
mov eax, dword [eax*4 + 0x5ba174]
mov edx, dword [ebp - 8]
xor dword [edx*4 + 0x5ba174], eax
inc dword [ebp - 0xc]
inc dword [ebp - 8]
mov eax, dword [ebp - 8]
cmp eax, dword [ebp - 0x10]
jl 0x58b738
mov eax, dword [ebp - 0x18]
sar eax, 1
jns 0x58b764
adc eax, 0
mov eax, dword [eax*4 + 0x5ba170]
mov dword [ebp - 0x28], eax
mov eax, dword [ebp - 0x28]
shr eax, 8
and eax, 0xff
mov al, byte [eax + str.cw]
and ax, 0xff
movsx eax, ax
shl eax, 8
mov edx, dword [ebp - 0x18]
sar edx, 1
jns 0x58b793
adc edx, 0
xor eax, dword [edx*4 + 0x5ba174]
mov edx, dword [ebp - 0x28]
shr edx, 0x10
and edx, 0xff
mov dl, byte [edx + str.cw]
and dx, 0xff
movsx edx, dx
shl edx, 0x10
xor eax, edx
mov edx, dword [ebp - 0x28]
shr edx, 0x18
and edx, 0xff
mov dl, byte [edx + str.cw]
and dx, 0xff
movsx edx, dx
shl edx, 0x18
xor eax, edx
mov edx, dword [ebp - 0x18]
sar edx, 1
jns 0x58b7e2
adc edx, 0
mov dword [edx*4 + 0x5ba174], eax
mov eax, dword [ebp - 0x18]
sar eax, 1
jns 0x58b7f3
adc eax, 0
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0xc]
inc eax
mov dword [ebp - 8], eax
mov eax, dword [ebp - 8]
cmp eax, dword [ebp - 0x18]
jge 0x58b827
mov eax, dword [ebp - 0xc]
mov eax, dword [eax*4 + 0x5ba174]
mov edx, dword [ebp - 8]
xor dword [edx*4 + 0x5ba174], eax
inc dword [ebp - 8]
inc dword [ebp - 0xc]
mov eax, dword [ebp - 8]
cmp eax, dword [ebp - 0x18]
jl 0x58b805
xor eax, eax
mov dword [ebp - 0xc], eax
jmp 0x58b886
mov eax, dword [ebp - 0x24]
cdq
idiv dword [ebp - 4]
mov ecx, edx
mov eax, dword [ebp - 0x24]
cdq
idiv dword [ebp - 4]
shl eax, 2
lea eax, [eax*8 + 0x5b9d68]
mov edx, dword [ebp - 0xc]
mov edx, dword [edx*4 + 0x5ba174]
mov dword [eax + ecx*4], edx
mov eax, dword [ebp - 0x24]
cdq
idiv dword [ebp - 4]
mov edx, dword [0x5ba170]
sub edx, eax
mov eax, edx
shl eax, 2
lea eax, [eax*8 + 0x5b9f48]
push eax
mov eax, dword [ebp - 0x24]
cdq
idiv dword [ebp - 4]
pop eax
mov ecx, dword [ebp - 0xc]
mov ecx, dword [ecx*4 + 0x5ba174]
mov dword [eax + edx*4], ecx
mov eax, dword [ebp - 0xc]
cmp eax, dword [ebp - 0x18]
jge 0x58b896
mov eax, dword [ebp - 0x24]
cmp eax, dword [ebp - 0x14]
jl 0x58b82e
mov eax, dword [0x5ba170]
dec eax
test eax, eax
jle 0x58b93b
mov dword [ebp - 0x34], eax
mov dword [ebp - 0x30], 1
mov eax, dword [ebp - 0xc]
cmp eax, dword [ebp - 4]
jge 0x58b92f
mov eax, dword [ebp - 0x30]
shl eax, 2
lea eax, [eax*8 + 0x5b9f48]
mov edx, dword [ebp - 0xc]
mov eax, dword [eax + edx*4]
mov dword [ebp - 0x28], eax
mov eax, dword [ebp - 0x28]
shr eax, 0x18
and eax, 0xff
mov eax, dword [eax*4 + 0x5aff6c]
mov edx, dword [ebp - 0x28]
shr edx, 0x10
and edx, 0xff
xor eax, dword [edx*4 + 0x5b036c]
mov edx, dword [ebp - 0x28]
shr edx, 8
and edx, 0xff
xor eax, dword [edx*4 + 0x5b076c]
mov edx, dword [ebp - 0x28]
and edx, 0xff
xor eax, dword [edx*4 + 0x5b0b6c]
mov edx, dword [ebp - 0x30]
shl edx, 2
lea edx, [edx*8 + 0x5b9f48]
mov ecx, dword [ebp - 0xc]
mov dword [edx + ecx*4], eax
mov eax, dword [ebp - 0xc]
cmp eax, dword [ebp - 4]
jl 0x58b8b6
inc dword [ebp - 0x30]
dec dword [ebp - 0x34]
jne 0x58b8ae
mov eax, dword [ebp - 0x24]
cmp eax, dword [ebp - 0x14]
jl 0x58b634
mov byte [0x5b20ec], 1
mov esp, ebp
pop ebp
ret 0x10