Function at 0x4082d0
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x34
mov ebp, dword [esp + 0x48]
mov dword [esp + 0x28], edx
mov dword [esp + 0x2c], ecx
add dword [ecx + 0x38], ebp
mov eax, dword [ecx + 0x3c]
test eax, eax
je 0x408314
mov esi, 8
mov edi, ebp
mov dword [esp], 0
mov dword [esp + 0x10], eax
sub esi, eax
cmp esi, ebp
cmovb edi, esi
cmp edi, 3
jbe 0x40834e
mov eax, dword [edx]
mov ebx, 4
jmp 0x408352
mov esi, dword [ecx + 0x10]
mov eax, dword [ecx + 0x2c]
mov edi, dword [ecx + 0x18]
mov dword [esp + 8], esi
mov esi, edx
mov edx, dword [ecx + 0x14]
mov dword [esp], eax
mov eax, dword [ecx + 0x28]
mov dword [esp + 0x14], edx
mov edx, esi
mov esi, dword [ecx + 0x20]
mov dword [esp + 0x24], eax
mov eax, dword [ecx + 0x24]
mov dword [esp + 0x20], esi
mov esi, dword [ecx + 0x1c]
mov dword [esp + 0x30], eax
xor ecx, ecx
jmp 0x4084f4
xor ebx, ebx
xor eax, eax
mov ecx, ebx
mov dword [esp + 4], esi
or ecx, 1
cmp ecx, edi
jae 0x408384
movzx esi, word [edx + ebx]
lea ecx, [ebx*8]
xor ebp, ebp
xor edx, edx
shld ebp, esi, cl
shl esi, cl
test cl, 0x20
cmovne ebp, esi
cmovne esi, edx
or ebx, 2
or dword [esp], ebp
or eax, esi
cmp ebx, edi
jae 0x4083ba
mov ecx, dword [esp + 0x28]
xor edi, edi
xor esi, esi
movzx edx, byte [ecx + ebx]
shl ebx, 3
mov ecx, ebx
shld edi, edx, cl
shl edx, cl
test bl, 0x20
cmovne edi, edx
cmovne edx, esi
mov esi, dword [esp]
or eax, edx
mov edx, dword [esp + 4]
or esi, edi
mov edi, esi
mov esi, dword [esp + 0x10]
jmp 0x4083c5
mov edx, dword [esp + 4]
mov esi, dword [esp + 0x10]
mov edi, dword [esp]
mov ebp, dword [esp + 0x2c]
lea ecx, [esi*8]
xor ebx, ebx
shld edi, eax, cl
shl eax, cl
test cl, 0x20
mov ecx, dword [esp + 0x48]
cmovne edi, eax
cmove ebx, eax
or edi, dword [ebp + 0x34]
or ebx, dword [ebp + 0x30]
cmp edx, ecx
mov dword [ebp + 0x30], ebx
mov dword [ebp + 0x34], edi
jbe 0x4083fd
add esi, ecx
mov ecx, esi
jmp 0x4086e8
mov eax, dword [ebp + 0x2c]
mov ecx, dword [ebp + 0x28]
mov esi, dword [ebp + 0x20]
mov edx, dword [ebp + 0x10]
mov dword [esp + 0x24], ebx
mov dword [esp], edi
xor eax, edi
xor ecx, ebx
add edx, esi
mov edi, dword [ebp + 0x1c]
mov dword [esp + 0x14], edx
mov dword [esp + 0x1c], eax
mov eax, dword [ebp + 0x24]
mov edx, dword [ebp + 0x14]
mov ebx, dword [esp + 0x14]
adc edx, eax
mov dword [esp + 8], edx
mov edx, esi
shld edx, eax, 0xd
shld eax, esi, 0xd
mov esi, dword [ebp + 0x18]
xor eax, dword [esp + 8]
xor edx, ebx
add esi, ecx
mov dword [esp + 0x20], eax
mov eax, dword [esp + 0x1c]
mov dword [esp + 0x18], esi
mov esi, ecx
adc edi, eax
shld esi, eax, 0x10
shrd ecx, eax, 0x10
mov eax, dword [esp + 8]
xor esi, dword [esp + 0x18]
xor ecx, edi
mov dword [esp + 0xc], edi
add eax, esi
mov edi, esi
adc ebx, ecx
shld edi, ecx, 0x15
shrd esi, ecx, 0xb
mov dword [esp + 8], eax
mov ecx, edx
xor esi, ebx
xor edi, eax
mov dword [esp + 0x14], ebx
add dword [esp + 0x18], edx
mov ebx, dword [esp + 0x20]
mov dword [ebp + 0x28], edi
mov dword [ebp + 0x2c], esi
adc dword [esp + 0xc], ebx
shrd edx, ebx, 0xf
shld ecx, ebx, 0x11
mov ebx, dword [esp + 0x14]
mov eax, edx
mov edx, dword [esp + 8]
xor ebx, dword [esp]
mov dword [esp], esi
mov esi, dword [esp + 0x18]
xor edx, dword [esp + 0x24]
mov dword [esp + 0x24], edi
mov edi, dword [esp + 0xc]
xor ecx, esi
mov dword [esp + 0x14], ebx
xor eax, edi
mov dword [esp + 0x20], ecx
mov dword [ebp + 0x20], ecx
mov ecx, dword [esp + 4]
mov dword [esp + 8], edx
mov dword [ebp + 0x24], eax
mov dword [ebp + 0x1c], esi
mov dword [ebp + 0x18], edi
mov dword [ebp + 0x10], edx
mov dword [ebp + 0x14], ebx
mov edx, dword [esp + 0x28]
mov ebp, dword [esp + 0x48]
mov dword [esp + 0x30], eax
sub ebp, ecx
mov dword [esp + 0x1c], ebp
mov eax, dword [esp + 0x1c]
mov ebp, dword [esp + 0x1c]
and eax, 0xfffffff8
and ebp, 7
cmp ecx, eax
mov dword [esp + 0x10], ebp
jae 0x40864f
mov dword [esp + 0xc], edi
mov ebp, ecx
mov dword [esp + 0x18], esi
mov ecx, dword [esp + 8]
mov edx, dword [esp + 0x14]
mov esi, dword [esp]
mov ebx, dword [esp + 0x30]
mov edi, dword [esp + 0x20]
mov dword [esp + 0x1c], eax
nop word cs:[eax + eax]
nop
mov eax, dword [esp + 0x28]
mov dword [esp], esi
mov esi, dword [esp + 0x24]
mov dword [esp + 4], ebp
mov eax, dword [eax + ebp + 4]
mov dword [esp + 8], eax
mov eax, dword [esp]
xor eax, dword [esp + 8]
mov dword [esp], eax
mov eax, dword [esp + 0x28]
mov eax, dword [eax + ebp]
mov ebp, dword [esp + 0x18]
xor esi, eax
add ecx, edi
mov dword [esp + 0x14], eax
mov eax, edi
adc edx, ebx
shld eax, ebx, 0xd
shld ebx, edi, 0xd
mov edi, dword [esp + 0xc]
xor eax, ecx
xor ebx, edx
mov dword [esp + 0x20], eax
mov eax, dword [esp]
add edi, esi
adc ebp, eax
mov dword [esp + 0xc], ebp
mov ebp, esi
shrd esi, eax, 0x10
shld ebp, eax, 0x10
xor esi, dword [esp + 0xc]
xor ebp, edi
add edx, ebp
mov eax, edx
mov dword [esp], edx
mov edx, ebp
adc ecx, esi
shld edx, esi, 0x15
shrd ebp, esi, 0xb
xor edx, eax
mov eax, dword [esp + 0x20]
mov esi, ebp
mov ebp, dword [esp + 0x1c]
mov dword [esp + 0x24], edx
mov edx, dword [esp + 0xc]
xor esi, ecx
add edi, eax
adc edx, ebx
mov dword [esp + 0x18], edi
mov edi, eax
mov dword [esp + 0xc], edx
mov edx, ecx
mov ecx, dword [esp]
shld edi, ebx, 0x11
shld ebx, eax, 0x11
mov eax, ebp
mov ebp, dword [esp + 4]
xor edx, dword [esp + 8]
xor ebx, dword [esp + 0xc]
xor edi, dword [esp + 0x18]
xor ecx, dword [esp + 0x14]
add ebp, 8
cmp ebp, eax
jb 0x408540
mov dword [esp + 4], ebp
mov ebp, ecx
mov ecx, dword [esp + 0x2c]
mov eax, dword [esp + 0x24]
mov dword [ecx + 0x2c], esi
mov dword [ecx + 0x28], eax
mov dword [ecx + 0x14], edx
mov esi, dword [esp + 0xc]
mov edx, dword [esp + 0x18]
mov dword [ecx + 0x10], ebp
mov dword [ecx + 0x20], edi
mov dword [ecx + 0x24], ebx
mov dword [ecx + 0x1c], edx
mov dword [ecx + 0x18], esi
mov ecx, dword [esp + 0x10]
mov edx, dword [esp + 0x28]
xor eax, eax
cmp ecx, 3
ja 0x40865e
xor ebx, ebx
xor edi, edi
jmp 0x40866a
mov dword [esp + 4], ecx
mov ecx, dword [esp + 0x10]
xor eax, eax
cmp ecx, 3
jbe 0x408649
mov ecx, dword [esp + 4]
mov ebx, 4
mov edi, dword [edx + ecx]
mov ebp, dword [esp + 0x10]
mov ecx, ebx
or ecx, 1
cmp ecx, ebp
jae 0x4086ab
mov ecx, dword [esp + 4]
xor ebp, ebp
add ecx, ebx
movzx esi, word [edx + ecx]
lea ecx, [ebx*8]
xor edx, edx
shld ebp, esi, cl
shl esi, cl
test cl, 0x20
mov ecx, dword [esp + 0x10]
cmovne ebp, esi
cmovne esi, edx
or ebx, 2
or eax, ebp
or edi, esi
cmp ebx, ecx
jb 0x4086b1
jmp 0x4086de
mov ecx, ebp
cmp ebx, ecx
jae 0x4086de
mov edx, dword [esp + 4]
mov ecx, dword [esp + 0x28]
xor ebp, ebp
add edx, ebx
shl ebx, 3
movzx esi, byte [ecx + edx]
mov ecx, ebx
xor edx, edx
shld ebp, esi, cl
shl esi, cl
mov ecx, dword [esp + 0x10]
test bl, 0x20
cmovne ebp, esi
cmovne esi, edx
or eax, ebp
or edi, esi
mov ebp, dword [esp + 0x2c]
mov dword [ebp + 0x30], edi
mov dword [ebp + 0x34], eax
mov dword [ebp + 0x3c], ecx
add esp, 0x34
pop esi
pop edi
pop ebx
pop ebp
ret