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

Disassembly:
sub esp, 0x1c
cmp dword [esp + 0x20], 0
push edi
mov edi, ecx
jne 0x10031962
lea eax, [esp + 0x24]
push eax
lea ecx, [esp + 0x18]
mov dword [esp + 0x28], str.Empty_key
call fcn.100d14b4
push 0x101322bc
lea ecx, [esp + 0x18]
push ecx
call fcn.100d7b5b
cmp eax, 0x10
je 0x10031991
cmp eax, 0x20
je 0x10031991
lea edx, [esp + 0x24]
push edx
lea ecx, [esp + 0x18]
mov dword [esp + 0x28], str.Incorrect_block_length
call fcn.100d14b4
push 0x101322bc
lea eax, [esp + 0x18]
push eax
call fcn.100d7b5b
push ebx
push ebp
push eax
lea ecx, [esi + 0x3d4]
push edi
mov ebx, 0x20
push ecx
mov dword [esi + 0x3c8], ebx
mov dword [esi + 0x3cc], eax
call fcn.100d4950
mov edx, dword [esi + 0x3cc]
push edx
lea eax, [esi + 0x3f4]
push edi
push eax
call fcn.100d4950
mov eax, dword [esi + 0x3c8]
add esp, 0x18
cmp eax, 0x10
je 0x100319fc
cmp eax, 0x18
je 0x100319e5
mov dword [esi + 0x3d0], 0xe
jmp 0x10031a22
xor ecx, ecx
cmp dword [esi + 0x3cc], ebx
sete cl
lea ecx, [ecx + ecx + 0xc]
mov dword [esi + 0x3d0], ecx
jmp 0x10031a22
mov eax, dword [esi + 0x3cc]
cmp eax, 0x10
jne 0x10031a0e
mov eax, 0xa
jmp 0x10031a1c
xor edx, edx
cmp eax, 0x18
setne dl
lea edx, [edx + edx + 0xc]
mov eax, edx
mov dword [esi + 0x3d0], eax
mov eax, dword [esi + 0x3cc]
cdq
and edx, 3
add eax, edx
mov ebp, eax
sar ebp, 2
xor edx, edx
cmp dword [esi + 0x3d0], edx
mov dword [esp + 0xc], ebp
jl 0x10031a5c
lea ebx, [esi + 8]
test ebp, ebp
jle 0x10031a50
mov ecx, ebp
xor eax, eax
mov edi, ebx
rep stosd dword es:[edi], eax
inc edx
add ebx, 0x20
cmp edx, dword [esi + 0x3d0]
jle 0x10031a44
xor edx, edx
cmp dword [esi + 0x3d0], edx
jl 0x10031a88
lea ebx, [esi + 0x1e8]
lea esp, [esp]
test ebp, ebp
jle 0x10031a7c
mov ecx, ebp
xor eax, eax
mov edi, ebx
rep stosd dword es:[edi], eax
inc edx
add ebx, 0x20
cmp edx, dword [esi + 0x3d0]
jle 0x10031a70
mov eax, dword [esi + 0x3d0]
inc eax
imul eax, ebp
mov dword [esp + 0x10], eax
mov eax, dword [esi + 0x3c8]
cdq
and edx, 3
add eax, edx
mov edi, eax
mov eax, dword [esp + 0x2c]
sar edi, 2
lea ecx, [esi + 0x414]
test edi, edi
jle 0x10031ae3
mov edx, edi
movzx ebx, byte [eax]
shl ebx, 0x18
mov dword [ecx], ebx
movzx ebx, byte [eax + 1]
inc eax
shl ebx, 0x10
or dword [ecx], ebx
movzx ebx, byte [eax + 1]
inc eax
shl ebx, 8
or dword [ecx], ebx
movzx ebx, byte [eax + 1]
or dword [ecx], ebx
inc eax
inc eax
add ecx, 4
sub edx, 1
jne 0x10031ab7
xor ebx, ebx
mov dword [esp + 0x2c], ebx
test edi, edi
jle 0x10031b37
lea ecx, [esi + 0x414]
mov dword [esp + 0x2c], ecx
cmp ebx, dword [esp + 0x10]
jge 0x10031b33
mov eax, ebx
cdq
idiv ebp
mov ecx, dword [ecx]
inc ebx
lea ebp, [edx + eax*8]
mov dword [esi + ebp*4 + 8], ecx
mov ecx, dword [esi + 0x3d0]
mov ebp, dword [esp + 0xc]
sub ecx, eax
lea edx, [edx + ecx*8]
mov ecx, dword [esp + 0x2c]
mov eax, dword [ecx]
add ecx, 4
cmp ebx, edi
mov dword [esi + edx*4 + 0x1e8], eax
mov dword [esp + 0x2c], ecx
jl 0x10031af7
mov dword [esp + 0x2c], ebx
cmp ebx, dword [esp + 0x10]
jge 0x10031cd4
mov dword [esp + 0x14], 0x10127dc0
lea esp, [esp]
mov eax, dword [esi + edi*4 + 0x410]
mov ecx, eax
sar ecx, 0x10
and ecx, 0xff
movsx edx, byte [ecx + str.cw]
mov ecx, dword [esp + 0x14]
movsx ecx, byte [ecx]
xor edx, ecx
inc dword [esp + 0x14]
mov ecx, eax
sar ecx, 8
and ecx, 0xff
movzx ecx, byte [ecx + str.cw]
shl edx, 8
xor edx, ecx
mov ecx, eax
and ecx, 0xff
movzx ecx, byte [ecx + str.cw]
sar eax, 0x18
shl edx, 8
and eax, 0xff
movzx eax, byte [eax + str.cw]
xor edx, ecx
shl edx, 8
xor edx, eax
xor dword [esi + 0x414], edx
cmp edi, 8
je 0x10031be4
cmp edi, 1
jle 0x10031c72
lea eax, [esi + 0x418]
lea ecx, [edi - 1]
mov edx, dword [eax - 4]
xor dword [eax], edx
add eax, 4
sub ecx, 1
jne 0x10031bd2
jmp 0x10031c72
lea eax, [esi + 0x418]
mov ecx, 3
nop
mov edx, dword [eax - 4]
xor dword [eax], edx
add eax, 4
sub ecx, 1
jne 0x10031bf0
mov eax, dword [esi + 0x420]
mov ecx, eax
sar ecx, 0x18
and ecx, 0xff
movsx edx, byte [ecx + str.cw]
mov ecx, eax
sar ecx, 0x10
and ecx, 0xff
movzx ecx, byte [ecx + str.cw]
shl edx, 8
xor edx, ecx
mov ecx, eax
sar ecx, 8
and ecx, 0xff
movzx ecx, byte [ecx + str.cw]
shl edx, 8
and eax, 0xff
movzx eax, byte [eax + str.cw]
xor edx, ecx
shl edx, 8
xor edx, eax
xor dword [esi + 0x424], edx
lea eax, [esi + 0x428]
mov ecx, 3
mov edx, dword [eax - 4]
xor dword [eax], edx
add eax, 4
sub ecx, 1
jne 0x10031c65
mov dword [esp + 0x18], 0
test edi, edi
jle 0x10031cca
lea ecx, [esi + 0x414]
cmp ebx, dword [esp + 0x10]
jge 0x10031cd4
mov eax, ebx
cdq
idiv ebp
mov ebp, dword [ecx]
add ecx, 4
lea ebx, [edx + eax*8]
mov dword [esi + ebx*4 + 8], ebp
mov ebx, dword [esi + 0x3d0]
mov ebp, dword [esp + 0xc]
sub ebx, eax
lea eax, [edx + ebx*8]
mov edx, dword [ecx - 4]
mov ebx, dword [esp + 0x2c]
mov dword [esi + eax*4 + 0x1e8], edx
mov eax, dword [esp + 0x18]
inc eax
inc ebx
cmp eax, edi
mov dword [esp + 0x18], eax
mov dword [esp + 0x2c], ebx
jl 0x10031c84
cmp ebx, dword [esp + 0x10]
jl 0x10031b50
mov eax, 1
cmp dword [esi + 0x3d0], eax
mov dword [esp + 0x2c], eax
jle 0x10031d6b
lea ecx, [esi + 0x208]
mov dword [esp + 0x18], ecx
test ebp, ebp
jle 0x10031d4f
mov edx, ebp
lea esp, [esp]
mov eax, dword [ecx]
mov edi, eax
sar edi, 0x18
and edi, 0xff
mov edi, dword [edi*4 + 0x10126dc0]
mov ebx, eax
sar ebx, 0x10
and ebx, 0xff
xor edi, dword [ebx*4 + 0x101271c0]
mov ebx, eax
sar ebx, 8
and ebx, 0xff
xor edi, dword [ebx*4 + 0x101275c0]
and eax, 0xff
xor edi, dword [eax*4 + 0x101279c0]
add ecx, 4
sub edx, 1
mov dword [ecx - 4], edi
jne 0x10031d00
mov eax, dword [esp + 0x2c]
mov ecx, dword [esp + 0x18]
inc eax
add ecx, 0x20
cmp eax, dword [esi + 0x3d0]
mov dword [esp + 0x2c], eax
mov dword [esp + 0x18], ecx
jl 0x10031cf3
pop ebp
pop ebx
mov byte [esi + 4], 1
pop edi
add esp, 0x1c
ret 4