Function at 0x408d70
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x180
mov ecx, 6
xor eax, eax
push ebx
mov bx, word [esp + 0x190]
push ebp
push esi
push edi
mov edi, dword [esp + 0x198]
rep stosd dword es:[edi], eax
movsx eax, bx
sub eax, 0
je 0x408db7
sub eax, 2
je 0x408db0
mov ecx, dword [esp + 0x1a0]
xor eax, eax
cmp dword [ecx], 0
setne al
jmp 0x408dbc
mov eax, 2
jmp 0x408dbc
mov eax, 3
lea edx, [esp + 0x10]
push 2
push edx
push eax
call fcn.00409030
add esp, 0xc
cmp bx, 1
jne 0x408f8d
mov esi, dword [esp + 0x194]
push 0x18
push eax
mov eax, dword [esi + 4]
push eax
call fcn.00409030
mov ecx, dword [esi + 8]
add esp, 0xc
sub ecx, 0x12
push 7
push eax
push ecx
call fcn.00409030
mov edx, dword [esi + 0x2c]
add esp, 0xc
push 2
push eax
push edx
call fcn.00409030
add esp, 0xc
push 7
push eax
mov eax, dword [esi + 0xc]
sub eax, 0x12
push eax
call fcn.00409030
mov ecx, dword [esi + 0x64]
add esp, 0xc
push 2
push eax
push ecx
call fcn.00409030
add esp, 0xc
lea edi, [esi + 0x18]
mov ebp, 4
mov ecx, dword [edi - 4]
lea edx, [ecx + ecx*2]
mov ecx, dword [edi]
lea ecx, [ecx + edx*8]
mov edx, dword [esp + 0x1a0]
cmp dword [edx], 0
jne 0x408e55
mov edx, dword [edi + 8]
shl edx, 0xb
add ecx, edx
push 0xc
push eax
push ecx
call fcn.00409030
add esp, 0xc
add edi, 0x1c
dec ebp
jne 0x408e36
lea ecx, [esi + 0x1c]
mov edx, 4
mov di, word [ecx]
add ecx, 0x1c
mov word [eax], di
add eax, 2
dec edx
jne 0x408e6f
mov ecx, dword [esp + 0x1a0]
cmp dword [ecx], 0
jne 0x408f53
mov word [eax], 0
mov ecx, dword [esi + 0x28]
add eax, 2
push 0xd
push eax
mov eax, dword [esi + 0x44]
sar ecx, 0x10
sar eax, 0xe
lea edx, [ecx + ecx*8]
mov ecx, dword [esi + 0x60]
add eax, edx
sar ecx, 0x10
lea eax, [eax + eax*4]
lea eax, [ecx + eax*2]
lea edx, [eax + eax*8]
mov eax, dword [esi + 0x7c]
sar eax, 0xe
add edx, eax
push edx
call fcn.00409030
mov ecx, dword [esi + 0x28]
add esp, 0xc
and ecx, 0xffff
push 0x10
push eax
push ecx
call fcn.00409030
mov edx, dword [esi + 0x44]
add esp, 0xc
and edx, 0x3fff
push 0xe
push eax
push edx
call fcn.00409030
add esp, 0xc
push 0x10
push eax
mov eax, dword [esi + 0x60]
and eax, 0xffff
push eax
call fcn.00409030
mov ecx, dword [esi + 0x7c]
add esp, 0xc
and ecx, 0x3fff
push 0xe
push eax
push ecx
call fcn.00409030
mov edx, dword [esi + 0x24]
add esp, 0xc
push 6
push eax
push edx
call fcn.00409030
add esp, 0xc
push 5
push eax
mov eax, dword [esi + 0x40]
push eax
call fcn.00409030
mov ecx, dword [esi + 0x5c]
add esp, 0xc
push 6
push eax
push ecx
call fcn.00409030
mov edx, dword [esi + 0x78]
add esp, 0xc
push 5
push eax
push edx
jmp 0x408fb0
lea edi, [esi + 0x28]
mov ebp, 4
push 0xc
push eax
mov eax, dword [edi]
push eax
call fcn.00409030
add esp, 0xc
add edi, 0x1c
dec ebp
jne 0x408f5b
add esi, 0x24
mov edi, 4
mov ecx, dword [esi]
push 4
push eax
push ecx
call fcn.00409030
add esp, 0xc
add esi, 0x1c
dec edi
jne 0x408f77
jmp 0x408fb8
cmp bx, 2
jne 0x408fb8
mov esi, dword [esp + 0x194]
push 0x18
push eax
mov edx, dword [esi + 4]
push edx
call fcn.00409030
add esp, 0xc
push 6
push eax
mov eax, dword [esi + 0x18]
push eax
call fcn.00409030
add esp, 0xc
cmp bx, 1
jne 0x408fd6
mov ecx, dword [esp + 0x1a0]
mov ebp, dword [ecx]
neg ebp
sbb ebp, ebp
and ebp, 0xffffffe0
add ebp, 0xc0
jmp 0x408fe7
sub bx, 2
neg bx
sbb ebx, ebx
and ebx, 0xffffffe2
add ebx, 0x20
mov ebp, ebx
xor edx, edx
test ebp, ebp
jle 0x409018
lea edi, [esp + 0x10]
mov ecx, dword [esp + 0x198]
mov eax, edx
sar eax, 3
add edi, 2
lea esi, [eax + ecx]
mov al, byte [edi - 2]
mov ecx, edx
mov bl, byte [esi]
and ecx, 7
shl al, cl
xor bl, al
inc edx
cmp edx, ebp
mov byte [esi], bl
jl 0x408ff1
mov eax, ebp
pop edi
cdq
and edx, 7
pop esi
add eax, edx
pop ebp
sar eax, 3
pop ebx
add esp, 0x180
ret