Function at 0x409580
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x134
push ebx
mov ebx, dword [esp + 0x154]
mov eax, dword [ebx]
push ebp
push esi
add eax, 0x44
push edi
push eax
call fcn.00421140
mov edx, dword [esp + 0x168]
mov ebp, eax
add esp, 4
test edx, edx
mov dword [esp + 0x10], ebp
mov edi, ebp
je 0x4095f2
mov eax, dword [edx]
cmp eax, 0x20
jge 0x4095eb
mov esi, dword [edx + 4]
mov ecx, eax
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, 0x20
sub ecx, eax
lea edi, [eax + ebp]
mov eax, ecx
shr ecx, 2
mov esi, 0x48fb4c
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
jmp 0x4095fe
mov edx, dword [edx + 4]
mov esi, edx
jmp 0x4095f7
mov esi, 0x48fb4c
mov ecx, 8
rep movsd dword es:[edi], dword [esi]
mov ecx, dword [esp + 0x154]
mov esi, dword [ecx + 4]
mov eax, dword [esp + 0x15c]
mov edx, eax
lea edi, [ebp + 0x20]
mov ecx, 8
rep movsd dword es:[edi], dword [esi]
mov byte [ebp + 0x40], al
mov ecx, eax
sar ecx, 0x10
mov byte [ebp + 0x42], cl
sar eax, 0x18
mov byte [ebp + 0x43], al
sar edx, 8
mov byte [ebp + 0x41], dl
mov ecx, dword [ebx]
mov esi, dword [ebx + 4]
mov edx, ecx
shr ecx, 2
lea edi, [ebp + 0x44]
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, dword [ebx]
mov esi, dword [esp + 0x168]
push esi
add eax, 0x44
push eax
push ebp
call fcn.00408900
mov eax, dword [esp + 0x158]
add esp, 0xc
cmp eax, 3
jne 0x4096a2
mov edi, 0x32
push esi
push 0x10
push esi
call fcn.00408900
add esp, 0xc
dec edi
jne 0x409670
mov ecx, dword [esp + 0x158]
mov esi, dword [ecx + 4]
mov ecx, 8
lea edi, [esp + 0x14]
mov edx, 0x13
rep movsd dword es:[edi], dword [esi]
mov dword [esp + 0x10], edx
jmp 0x409894
cmp eax, 2
jne 0x409ac9
mov ebx, dword [esp + 0x150]
push esi
lea esi, [esp + 0x38]
call fcn.00408740
mov ecx, dword [esp + 0x15c]
mov eax, dword [ecx + 4]
add esp, 4
xor edi, edi
xor esi, esi
xor edx, edx
add eax, 2
lea ecx, [esi + 1]
and ecx, 0x800000ff
jns 0x4096e5
dec ecx
or ecx, 0xffffff00
inc ecx
movzx esi, cl
movzx ecx, byte [esp + esi + 0x34]
add ecx, edx
and ecx, 0x800000ff
jns 0x4096ff
dec ecx
or ecx, 0xffffff00
inc ecx
mov dl, byte [esp + esi + 0x34]
movzx ebp, cl
mov cl, byte [esp + ebp + 0x34]
mov byte [esp + esi + 0x34], cl
mov byte [esp + ebp + 0x34], dl
movzx ecx, cl
movzx edx, dl
add ecx, edx
and ecx, 0x800000ff
jns 0x40972a
dec ecx
or ecx, 0xffffff00
inc ecx
mov cl, byte [esp + ecx + 0x34]
xor cl, byte [eax - 2]
mov byte [esp + edi + 0x14], cl
lea ecx, [esi + 1]
and ecx, 0x800000ff
jns 0x409748
dec ecx
or ecx, 0xffffff00
inc ecx
movzx esi, cl
movzx ecx, byte [esp + esi + 0x34]
add ecx, ebp
and ecx, 0x800000ff
jns 0x409762
dec ecx
or ecx, 0xffffff00
inc ecx
mov dl, byte [esp + esi + 0x34]
movzx ebp, cl
mov cl, byte [esp + ebp + 0x34]
mov byte [esp + esi + 0x34], cl
mov byte [esp + ebp + 0x34], dl
movzx ecx, cl
movzx edx, dl
add ecx, edx
and ecx, 0x800000ff
jns 0x40978d
dec ecx
or ecx, 0xffffff00
inc ecx
mov cl, byte [esp + ecx + 0x34]
xor cl, byte [eax - 1]
mov byte [esp + edi + 0x15], cl
lea ecx, [esi + 1]
and ecx, 0x800000ff
jns 0x4097ab
dec ecx
or ecx, 0xffffff00
inc ecx
movzx esi, cl
movzx ecx, byte [esp + esi + 0x34]
add ecx, ebp
and ecx, 0x800000ff
jns 0x4097c5
dec ecx
or ecx, 0xffffff00
inc ecx
mov dl, byte [esp + esi + 0x34]
movzx ebp, cl
mov cl, byte [esp + ebp + 0x34]
mov byte [esp + esi + 0x34], cl
mov byte [esp + ebp + 0x34], dl
movzx ecx, cl
movzx edx, dl
add ecx, edx
and ecx, 0x800000ff
jns 0x4097f0
dec ecx
or ecx, 0xffffff00
inc ecx
mov cl, byte [esp + ecx + 0x34]
xor cl, byte [eax]
mov byte [esp + edi + 0x16], cl
lea ecx, [esi + 1]
and ecx, 0x800000ff
jns 0x40980d
dec ecx
or ecx, 0xffffff00
inc ecx
movzx esi, cl
movzx ecx, byte [esp + esi + 0x34]
add ecx, ebp
and ecx, 0x800000ff
jns 0x409827
dec ecx
or ecx, 0xffffff00
inc ecx
mov bl, byte [esp + esi + 0x34]
movzx edx, cl
mov cl, byte [esp + edx + 0x34]
mov byte [esp + esi + 0x34], cl
mov byte [esp + edx + 0x34], bl
movzx ecx, cl
movzx ebx, bl
add ecx, ebx
and ecx, 0x800000ff
jns 0x409852
dec ecx
or ecx, 0xffffff00
inc ecx
mov bl, byte [eax + 1]
mov cl, byte [esp + ecx + 0x34]
xor cl, bl
mov byte [esp + edi + 0x17], cl
add edi, 4
add eax, 4
cmp edi, 0x20
jl 0x4096d2
mov ebp, dword [esp + 0x10]
xor edx, edx
mov ecx, 8
mov edi, 0x48fb4c
lea esi, [esp + 0x14]
repe cmpsd dword [esi], dword es:[edi]
mov eax, edx
sete al
mov esi, eax
jmp 0x409acb
mov edx, dword [esp + 0x10]
mov edi, dword [esp + 0x150]
xor eax, eax
test edi, edi
jle 0x4098c4
mov ecx, dword [esp + 0x168]
lea esi, [esp + 0x134]
sub ecx, esi
lea esi, [esp + eax + 0x134]
mov bl, byte [ecx + esi]
xor bl, dl
inc eax
cmp eax, edi
mov byte [esi], bl
jl 0x4098b1
lea edx, [esp + 0x134]
push edx
lea esi, [esp + 0x38]
mov ebx, edi
call fcn.00408740
add esp, 4
xor esi, esi
xor ecx, ecx
xor edx, edx
lea eax, [ecx + 1]
and eax, 0x800000ff
jns 0x4098f1
dec eax
or eax, 0xffffff00
inc eax
movzx ecx, al
movzx eax, byte [esp + ecx + 0x34]
add eax, edx
and eax, 0x800000ff
jns 0x409909
dec eax
or eax, 0xffffff00
inc eax
mov dl, byte [esp + ecx + 0x34]
movzx edi, al
mov al, byte [esp + edi + 0x34]
mov byte [esp + ecx + 0x34], al
mov byte [esp + edi + 0x34], dl
movzx eax, al
movzx edx, dl
add eax, edx
and eax, 0x800000ff
jns 0x409932
dec eax
or eax, 0xffffff00
inc eax
mov al, byte [esp + eax + 0x34]
mov bl, byte [esp + esi + 0x14]
xor bl, al
lea eax, [ecx + 1]
and eax, 0x800000ff
mov byte [esp + esi + 0x14], bl
jns 0x409951
dec eax
or eax, 0xffffff00
inc eax
movzx ecx, al
movzx eax, byte [esp + ecx + 0x34]
add eax, edi
and eax, 0x800000ff
jns 0x409969
dec eax
or eax, 0xffffff00
inc eax
mov dl, byte [esp + ecx + 0x34]
movzx edi, al
mov al, byte [esp + edi + 0x34]
mov byte [esp + ecx + 0x34], al
mov byte [esp + edi + 0x34], dl
movzx eax, al
movzx edx, dl
add eax, edx
and eax, 0x800000ff
jns 0x409992
dec eax
or eax, 0xffffff00
inc eax
mov al, byte [esp + eax + 0x34]
mov bl, byte [esp + esi + 0x15]
xor bl, al
lea eax, [ecx + 1]
and eax, 0x800000ff
mov byte [esp + esi + 0x15], bl
jns 0x4099b1
dec eax
or eax, 0xffffff00
inc eax
movzx ecx, al
movzx eax, byte [esp + ecx + 0x34]
add eax, edi
and eax, 0x800000ff
jns 0x4099c9
dec eax
or eax, 0xffffff00
inc eax
mov dl, byte [esp + ecx + 0x34]
movzx edi, al
mov al, byte [esp + edi + 0x34]
mov byte [esp + ecx + 0x34], al
mov byte [esp + edi + 0x34], dl
movzx eax, al
movzx edx, dl
add eax, edx
and eax, 0x800000ff
jns 0x4099f2
dec eax
or eax, 0xffffff00
inc eax
mov al, byte [esp + eax + 0x34]
mov bl, byte [esp + esi + 0x16]
xor bl, al
lea eax, [ecx + 1]
and eax, 0x800000ff
mov byte [esp + esi + 0x16], bl
jns 0x409a11
dec eax
or eax, 0xffffff00
inc eax
movzx ecx, al
movzx eax, byte [esp + ecx + 0x34]
add eax, edi
and eax, 0x800000ff
jns 0x409a29
dec eax
or eax, 0xffffff00
inc eax
mov bl, byte [esp + ecx + 0x34]
movzx edx, al
mov al, byte [esp + edx + 0x34]
mov byte [esp + ecx + 0x34], al
movzx eax, al
movzx edi, bl
add eax, edi
and eax, 0x800000ff
mov byte [esp + edx + 0x34], bl
jns 0x409a52
dec eax
or eax, 0xffffff00
inc eax
mov bl, byte [esp + esi + 0x17]
mov al, byte [esp + eax + 0x34]
xor bl, al
mov byte [esp + esi + 0x17], bl
add esi, 4
cmp esi, 0x20
jl 0x4098e0
dec dword [esp + 0x10]
jns 0x409890
mov eax, dword [esp + 0x160]
mov ecx, 8
mov esi, 0x48fb4c
mov edi, ebp
rep movsd dword es:[edi], dword [esi]
mov ecx, dword [eax]
mov esi, dword [eax + 4]
mov edx, ecx
shr ecx, 2
lea edi, [ebp + 0x20]
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, dword [eax]
push ebp
add eax, 0x20
push eax
push ebp
call fcn.00408900
add esp, 0xc
xor edx, edx
mov ecx, 4
mov edi, ebp
lea esi, [esp + 0x14]
repe cmpsd dword [esi], dword es:[edi]
mov eax, edx
sete al
mov esi, eax
jmp 0x409acb
xor esi, esi
push ebp
call fcn.004211d0
add esp, 4
pop edi
mov eax, esi
pop esi
pop ebp
pop ebx
add esp, 0x134
ret