Function at 0x4037a4
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
push ebx
cmp dword [ebp + 0xc], 0
jne 0x4037d7
push 0
push 0
push 0
push 0
push 0
push 0
push 0
mov dword [ebp - 4], str.Empty_key
lea eax, [ebp - 4]
push eax
push 0x403e38
call fcn.0042058c
add esp, 0x24
cmp dword [ebp + 0x14], 0x10
je 0x40380f
cmp dword [ebp + 0x14], 0x18
je 0x40380f
cmp dword [ebp + 0x14], 0x20
je 0x40380f
push 0
push 0
push 0
push 0
push 0
push 0
push 0
mov dword [ebp - 8], 0x424c96
lea edx, [ebp - 8]
push edx
push 0x403e38
call fcn.0042058c
add esp, 0x24
cmp dword [ebp + 0x18], 0x10
je 0x403847
cmp dword [ebp + 0x18], 0x18
je 0x403847
cmp dword [ebp + 0x18], 0x20
je 0x403847
push 0
push 0
push 0
push 0
push 0
push 0
push 0
mov dword [ebp - 0xc], str.Incorrect_block_length
lea ecx, [ebp - 0xc]
push ecx
push 0x403e38
call fcn.0042058c
add esp, 0x24
mov eax, dword [ebp + 0x14]
mov edx, dword [ebp + 8]
mov dword [edx + 0x3c8], eax
mov ecx, dword [ebp + 0x18]
mov eax, dword [ebp + 8]
mov dword [eax + 0x3cc], ecx
mov edx, dword [ebp + 8]
push dword [edx + 0x3cc]
push dword [ebp + 0x10]
mov ecx, dword [ebp + 8]
add ecx, 0x3d4
push ecx
call fcn.00416c20
add esp, 0xc
mov eax, dword [ebp + 8]
push dword [eax + 0x3cc]
push dword [ebp + 0x10]
mov edx, dword [ebp + 8]
add edx, 0x3f4
push edx
call fcn.00416c20
add esp, 0xc
mov ecx, dword [ebp + 8]
mov eax, dword [ecx + 0x3c8]
sub eax, 0x10
je 0x4038b0
sub eax, 8
je 0x4038e2
jmp 0x403901
mov edx, dword [ebp + 8]
cmp dword [edx + 0x3cc], 0x10
jne 0x4038c3
mov ecx, 0xa
jmp 0x4038d7
mov ecx, 0xc
mov eax, dword [ebp + 8]
cmp dword [eax + 0x3cc], 0x18
je 0x4038d7
add ecx, 2
mov edx, dword [ebp + 8]
mov dword [edx + 0x3d0], ecx
jmp 0x40390e
mov eax, 0xc
mov edx, dword [ebp + 8]
cmp dword [edx + 0x3cc], 0x20
jne 0x4038f6
add eax, 2
mov ecx, dword [ebp + 8]
mov dword [ecx + 0x3d0], eax
jmp 0x40390e
mov eax, dword [ebp + 8]
mov dword [eax + 0x3d0], 0xe
mov edx, dword [ebp + 8]
mov ecx, dword [edx + 0x3cc]
test ecx, ecx
jns 0x40391e
add ecx, 3
sar ecx, 2
mov dword [ebp - 0x10], ecx
xor eax, eax
mov dword [ebp - 0x14], eax
jmp 0x40395b
xor edx, edx
mov dword [ebp - 0x18], edx
mov ecx, dword [ebp - 0x18]
cmp ecx, dword [ebp - 0x10]
jge 0x403958
mov eax, dword [ebp - 0x14]
shl eax, 5
mov edx, dword [ebp + 8]
lea ecx, [edx + eax]
mov eax, dword [ebp - 0x18]
xor edx, edx
mov dword [ecx + eax*4 + 8], edx
inc dword [ebp - 0x18]
mov ecx, dword [ebp - 0x18]
cmp ecx, dword [ebp - 0x10]
jl 0x403938
inc dword [ebp - 0x14]
mov eax, dword [ebp - 0x14]
mov edx, dword [ebp + 8]
cmp eax, dword [edx + 0x3d0]
jle 0x40392b
xor ecx, ecx
mov dword [ebp - 0x14], ecx
jmp 0x4039a3
xor eax, eax
mov dword [ebp - 0x18], eax
mov edx, dword [ebp - 0x18]
cmp edx, dword [ebp - 0x10]
jge 0x4039a0
mov ecx, dword [ebp - 0x14]
shl ecx, 5
mov eax, dword [ebp + 8]
lea edx, [eax + ecx]
mov ecx, dword [ebp - 0x18]
xor eax, eax
mov dword [edx + ecx*4 + 0x1e8], eax
inc dword [ebp - 0x18]
mov edx, dword [ebp - 0x18]
cmp edx, dword [ebp - 0x10]
jl 0x40397d
inc dword [ebp - 0x14]
mov ecx, dword [ebp - 0x14]
mov eax, dword [ebp + 8]
cmp ecx, dword [eax + 0x3d0]
jle 0x403970
mov edx, dword [ebp + 8]
mov ecx, dword [edx + 0x3d0]
inc ecx
imul ecx, dword [ebp - 0x10]
mov dword [ebp - 0x1c], ecx
mov eax, dword [ebp + 8]
mov edx, dword [eax + 0x3c8]
test edx, edx
jns 0x4039d2
add edx, 3
sar edx, 2
mov dword [ebp - 0x20], edx
mov ecx, dword [ebp + 8]
add ecx, 0x414
mov dword [ebp - 0x24], ecx
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x28], eax
xor edx, edx
mov dword [ebp - 0x14], edx
mov ecx, dword [ebp - 0x14]
cmp ecx, dword [ebp - 0x20]
jge 0x403a4b
mov eax, dword [ebp - 0x28]
xor edx, edx
mov dl, byte [eax]
shl edx, 0x18
mov ecx, dword [ebp - 0x24]
mov dword [ecx], edx
inc dword [ebp - 0x28]
mov eax, dword [ebp - 0x28]
xor edx, edx
mov dl, byte [eax]
shl edx, 0x10
mov ecx, dword [ebp - 0x24]
or dword [ecx], edx
inc dword [ebp - 0x28]
mov eax, dword [ebp - 0x28]
xor edx, edx
mov dl, byte [eax]
shl edx, 8
mov ecx, dword [ebp - 0x24]
or dword [ecx], edx
inc dword [ebp - 0x28]
mov eax, dword [ebp - 0x28]
xor edx, edx
mov dl, byte [eax]
mov ecx, dword [ebp - 0x24]
or dword [ecx], edx
inc dword [ebp - 0x28]
add dword [ebp - 0x24], 4
inc dword [ebp - 0x14]
mov eax, dword [ebp - 0x14]
cmp eax, dword [ebp - 0x20]
jl 0x4039f7
xor edx, edx
mov dword [ebp - 0x2c], edx
xor ecx, ecx
mov dword [ebp - 0x18], ecx
jmp 0x403abf
mov eax, dword [ebp - 0x2c]
cdq
idiv dword [ebp - 0x10]
mov ecx, edx
mov eax, dword [ebp - 0x2c]
cdq
idiv dword [ebp - 0x10]
shl eax, 5
mov edx, dword [ebp + 8]
lea eax, [edx + eax]
mov edx, dword [ebp - 0x18]
mov ebx, dword [ebp + 8]
mov edx, dword [ebx + edx*4 + 0x414]
mov dword [eax + ecx*4 + 8], edx
mov eax, dword [ebp - 0x2c]
cdq
idiv dword [ebp - 0x10]
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0x3d0]
sub edx, eax
shl edx, 5
mov eax, dword [ebp + 8]
lea ecx, [eax + edx]
push ecx
mov eax, dword [ebp - 0x2c]
cdq
idiv dword [ebp - 0x10]
pop ecx
mov eax, dword [ebp - 0x18]
mov ebx, dword [ebp + 8]
mov eax, dword [ebx + eax*4 + 0x414]
mov dword [ecx + edx*4 + 0x1e8], eax
inc dword [ebp - 0x18]
inc dword [ebp - 0x2c]
mov edx, dword [ebp - 0x18]
cmp edx, dword [ebp - 0x20]
jge 0x403acf
mov ecx, dword [ebp - 0x2c]
cmp ecx, dword [ebp - 0x1c]
jl 0x403a57
xor eax, eax
mov dword [ebp - 0x34], eax
mov edx, dword [ebp - 0x2c]
cmp edx, dword [ebp - 0x1c]
jge 0x403d71
mov ecx, dword [ebp - 0x20]
mov eax, dword [ebp + 8]
mov edx, dword [eax + ecx*4 + 0x410]
mov dword [ebp - 0x30], edx
mov ecx, dword [ebp - 0x30]
sar ecx, 0x10
and ecx, 0xff
movsx eax, byte [ecx + str.cw]
and eax, 0xff
shl eax, 0x18
mov edx, dword [ebp - 0x30]
sar edx, 8
and edx, 0xff
movsx ecx, byte [edx + str.cw]
and ecx, 0xff
shl ecx, 0x10
xor eax, ecx
mov edx, dword [ebp - 0x30]
and edx, 0xff
movsx ecx, byte [edx + str.cw]
and ecx, 0xff
shl ecx, 8
xor eax, ecx
mov edx, dword [ebp - 0x30]
sar edx, 0x18
and edx, 0xff
movsx ecx, byte [edx + str.cw]
and ecx, 0xff
xor eax, ecx
mov edx, dword [ebp - 0x34]
movsx ecx, byte [edx + 0x427ec4]
and ecx, 0xff
shl ecx, 0x18
xor eax, ecx
mov edx, dword [ebp + 8]
xor dword [edx + 0x414], eax
inc dword [ebp - 0x34]
cmp dword [ebp - 0x20], 8
je 0x403bcb
mov dword [ebp - 0x14], 1
xor eax, eax
mov dword [ebp - 0x18], eax
mov ecx, dword [ebp - 0x14]
cmp ecx, dword [ebp - 0x20]
jge 0x403ce6
mov eax, dword [ebp - 0x14]
mov edx, dword [ebp + 8]
mov ecx, dword [ebp - 0x18]
mov ebx, dword [ebp + 8]
mov ecx, dword [ebx + ecx*4 + 0x414]
xor dword [edx + eax*4 + 0x414], ecx
inc dword [ebp - 0x18]
inc dword [ebp - 0x14]
mov eax, dword [ebp - 0x14]
cmp eax, dword [ebp - 0x20]
jl 0x403b9e
jmp 0x403ce6
mov dword [ebp - 0x14], 1
xor edx, edx
mov dword [ebp - 0x18], edx
jmp 0x403bf9
mov eax, dword [ebp - 0x14]
mov edx, dword [ebp + 8]
mov ecx, dword [ebp - 0x18]
mov ebx, dword [ebp + 8]
mov ecx, dword [ebx + ecx*4 + 0x414]
xor dword [edx + eax*4 + 0x414], ecx
inc dword [ebp - 0x18]
inc dword [ebp - 0x14]
mov eax, dword [ebp - 0x20]
sar eax, 1
jns 0x403c03
adc eax, 0
cmp eax, dword [ebp - 0x14]
jg 0x403bd9
mov edx, dword [ebp - 0x20]
sar edx, 1
jns 0x403c12
adc edx, 0
mov eax, dword [ebp + 8]
mov edx, dword [eax + edx*4 + 0x410]
mov dword [ebp - 0x30], edx
mov ecx, dword [ebp - 0x30]
and ecx, 0xff
movsx eax, byte [ecx + str.cw]
and eax, 0xff
mov edx, dword [ebp - 0x30]
sar edx, 8
and edx, 0xff
movsx ecx, byte [edx + str.cw]
and ecx, 0xff
shl ecx, 8
xor eax, ecx
mov edx, dword [ebp - 0x30]
sar edx, 0x10
and edx, 0xff
movsx ecx, byte [edx + str.cw]
and ecx, 0xff
shl ecx, 0x10
xor eax, ecx
mov edx, dword [ebp - 0x30]
sar edx, 0x18
and edx, 0xff
movsx ecx, byte [edx + str.cw]
and ecx, 0xff
shl ecx, 0x18
xor eax, ecx
mov edx, dword [ebp - 0x20]
sar edx, 1
jns 0x403c98
adc edx, 0
mov ecx, dword [ebp + 8]
xor dword [ecx + edx*4 + 0x414], eax
mov eax, dword [ebp - 0x20]
sar eax, 1
jns 0x403cac
adc eax, 0
mov dword [ebp - 0x18], eax
mov eax, dword [ebp - 0x18]
inc eax
mov dword [ebp - 0x14], eax
mov edx, dword [ebp - 0x14]
cmp edx, dword [ebp - 0x20]
jge 0x403ce6
mov ecx, dword [ebp - 0x14]
mov eax, dword [ebp + 8]
mov edx, dword [ebp - 0x18]
mov ebx, dword [ebp + 8]
mov edx, dword [ebx + edx*4 + 0x414]
xor dword [eax + ecx*4 + 0x414], edx
inc dword [ebp - 0x18]
inc dword [ebp - 0x14]
mov eax, dword [ebp - 0x14]
cmp eax, dword [ebp - 0x20]
jl 0x403cbe
xor ecx, ecx
mov dword [ebp - 0x18], ecx
jmp 0x403d55
mov eax, dword [ebp - 0x2c]
cdq
idiv dword [ebp - 0x10]
mov ecx, edx
mov eax, dword [ebp - 0x2c]
cdq
idiv dword [ebp - 0x10]
shl eax, 5
mov edx, dword [ebp + 8]
lea eax, [edx + eax]
mov edx, dword [ebp - 0x18]
mov ebx, dword [ebp + 8]
mov edx, dword [ebx + edx*4 + 0x414]
mov dword [eax + ecx*4 + 8], edx
mov eax, dword [ebp - 0x2c]
cdq
idiv dword [ebp - 0x10]
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0x3d0]
sub edx, eax
shl edx, 5
mov eax, dword [ebp + 8]
lea ecx, [eax + edx]
push ecx
mov eax, dword [ebp - 0x2c]
cdq
idiv dword [ebp - 0x10]
pop ecx
mov eax, dword [ebp - 0x18]
mov ebx, dword [ebp + 8]
mov eax, dword [ebx + eax*4 + 0x414]
mov dword [ecx + edx*4 + 0x1e8], eax
inc dword [ebp - 0x18]
inc dword [ebp - 0x2c]
mov edx, dword [ebp - 0x18]
cmp edx, dword [ebp - 0x20]
jge 0x403d65
mov ecx, dword [ebp - 0x2c]
cmp ecx, dword [ebp - 0x1c]
jl 0x403ced
mov eax, dword [ebp - 0x2c]
cmp eax, dword [ebp - 0x1c]
jl 0x403ae0
mov dword [ebp - 0x38], 1
jmp 0x403e18
xor edx, edx
mov dword [ebp - 0x18], edx
mov ecx, dword [ebp - 0x18]
cmp ecx, dword [ebp - 0x10]
jge 0x403e15
mov eax, dword [ebp - 0x38]
shl eax, 5
mov edx, dword [ebp + 8]
lea ecx, [edx + eax]
mov eax, dword [ebp - 0x18]
mov edx, dword [ecx + eax*4 + 0x1e8]
mov dword [ebp - 0x30], edx
mov ecx, dword [ebp - 0x30]
sar ecx, 0x18
and ecx, 0xff
mov eax, dword [ecx*4 + 0x426ec4]
mov edx, dword [ebp - 0x30]
sar edx, 0x10
and edx, 0xff
xor eax, dword [edx*4 + 0x4272c4]
mov ecx, dword [ebp - 0x30]
sar ecx, 8
and ecx, 0xff
xor eax, dword [ecx*4 + 0x4276c4]
mov edx, dword [ebp - 0x30]
and edx, 0xff
xor eax, dword [edx*4 + 0x427ac4]
mov ecx, dword [ebp - 0x38]
shl ecx, 5
mov edx, dword [ebp + 8]
lea ecx, [edx + ecx]
mov edx, dword [ebp - 0x18]
mov dword [ecx + edx*4 + 0x1e8], eax
inc dword [ebp - 0x18]
mov eax, dword [ebp - 0x18]
cmp eax, dword [ebp - 0x10]
jl 0x403d8e
inc dword [ebp - 0x38]
mov ecx, dword [ebp - 0x38]
mov eax, dword [ebp + 8]
cmp ecx, dword [eax + 0x3d0]
jl 0x403d7d
mov edx, dword [ebp + 8]
mov byte [edx + 4], 1
pop ebx
mov esp, ebp
pop ebp
ret