Function at 0x403582
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x308
push ebx
lea eax, [ebp - 0x64]
push esi
push edi
push 0x22
push 0
push eax
call fcn.00401056
mov cx, word [ebp + 0xc]
add esp, 0xc
mov eax, dword [ebp + 8]
movzx edx, word [eax]
inc word [ebp + edx*2 - 0x64]
add eax, 2
dec cx
jne 0x4035a5
mov ax, word [ebp + 0xc]
cmp word [ebp - 0x64], ax
jne 0x4035cf
xor eax, eax
mov ecx, dword [ebp + 0x1c]
mov edi, dword [ebp + 0x20]
mov dword [ecx], eax
mov dword [edi], eax
jmp 0x4039d0
mov cx, 1
mov edi, dword [ebp + 0x20]
mov eax, dword [edi]
mov dword [ebp - 0x10], eax
movzx eax, cx
cmp word [ebp + eax*2 - 0x64], 0
jne 0x4035ee
inc cx
cmp cx, 0x10
jbe 0x4035db
movzx esi, cx
cmp word [ebp - 0x10], cx
mov dword [ebp - 0x14], esi
jae 0x4035fd
mov dword [ebp - 0x10], esi
mov dx, 0x10
movzx eax, dx
cmp word [ebp + eax*2 - 0x64], 0
jne 0x403610
dec dx
jne 0x403601
movzx eax, dx
cmp word [ebp - 0x10], dx
mov dword [ebp - 0x20], eax
jbe 0x40361f
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x10]
mov dword [edi], eax
mov eax, 1
shl eax, cl
cmp cx, dx
mov dword [ebp - 0x24], eax
jae 0x40364f
movzx eax, cx
movzx ebx, word [ebp + eax*2 - 0x64]
sub dword [ebp - 0x24], ebx
js 0x40366b
inc cx
mov eax, dword [ebp - 0x24]
add eax, eax
cmp cx, dx
mov dword [ebp - 0x24], eax
jb 0x403633
mov eax, dword [ebp - 0x20]
lea ecx, [ebp + eax*2 - 0x64]
mov ax, word [ecx]
movzx edi, ax
sub dword [ebp - 0x24], edi
jns 0x403675
mov eax, 2
jmp 0x4039d0
mov eax, 2
jmp 0x4039d0
add ax, word [ebp - 0x24]
lea edi, [ebp - 0x84]
mov word [ecx], ax
xor eax, eax
dec dx
lea ecx, [ebp - 0x62]
mov word [ebp - 0x86], ax
je 0x4036a2
add ax, word [ecx]
add ecx, 2
mov word [edi], ax
add edi, 2
dec dx
jne 0x403692
xor dx, dx
mov ecx, dword [ebp + 8]
mov ax, word [ecx]
add ecx, 2
test ax, ax
je 0x4036d0
movzx eax, ax
lea edi, [ebp + eax*2 - 0x88]
mov ax, word [edi]
movzx ebx, ax
inc ax
mov word [ebp + ebx*2 - 0x308], dx
mov word [edi], ax
inc dx
cmp word [ebp + 0xc], dx
ja 0x4036a8
lea eax, [ebp - 0x308]
mov ebx, dword [ebp - 0x10]
neg ebx
mov dword [ebp - 0x28], 0xffffffff
xor edx, edx
mov dword [ebp - 0x30], eax
mov word [ebp - 2], 0
mov dword [ebp - 0xc8], 0
mov word [ebp - 4], dx
cmp dword [ebp - 0x20], esi
mov word [ebp - 0x88], 0
jl 0x403996
mov eax, dword [ebp - 0x14]
lea ecx, [ebp + eax*2 - 0x64]
mov ax, word [ecx]
mov dword [ebp - 0x38], ecx
mov word [ebp - 6], ax
mov ax, word [ebp - 6]
dec word [ebp - 6]
test ax, ax
je 0x403987
mov eax, dword [ebp - 0x10]
add eax, ebx
cmp eax, dword [ebp - 0x14]
jge 0x403877
mov eax, dword [ebp - 0x28]
lea ecx, [ebp + eax*4 - 0xc8]
lea edx, [ebp + eax*2 - 0x88]
mov dword [ebp - 0x2c], ecx
mov dword [ebp - 0x34], edx
movzx eax, word [ebp - 6]
mov cx, word [ebp - 0x20]
inc eax
mov word [ebp - 0x40], cx
mov dword [ebp - 0x3c], eax
add dword [ebp - 0x2c], 4
mov dx, word [ebp - 0x40]
add ebx, dword [ebp - 0x10]
sub dx, bx
inc dword [ebp - 0x28]
add dword [ebp - 0x34], 2
cmp dx, word [ebp - 0x10]
jbe 0x40378b
mov dx, word [ebp - 0x10]
mov ax, word [ebp - 0x14]
sub ax, bx
mov si, 1
mov cl, al
shl si, cl
mov word [ebp - 0xa], ax
movzx eax, si
cmp eax, dword [ebp - 0x3c]
jle 0x4037d8
mov ax, word [ebp - 6]
mov ecx, dword [ebp - 0x38]
inc ax
sub si, ax
inc word [ebp - 0xa]
cmp dx, word [ebp - 0xa]
jbe 0x4037d8
add si, si
add ecx, 2
mov ax, word [ecx]
cmp si, ax
jbe 0x4037d8
sub si, ax
inc word [ebp - 0xa]
cmp dx, word [ebp - 0xa]
ja 0x4037bd
mov ax, 1
mov cl, byte [ebp - 0xa]
shl ax, cl
mov word [ebp - 4], ax
movzx eax, ax
inc eax
imul eax, eax, 6
push eax
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
test eax, eax
je 0x4039a9
mov cx, word [ebp - 4]
lea edx, [eax + 6]
inc cx
mov esi, dword [ebp + 0x1c]
add word [0x406ebe], cx
add eax, 2
mov ecx, dword [ebp - 0x2c]
mov dword [esi], edx
mov dword [ebp + 0x1c], eax
mov dword [eax], 0
lea eax, [ebp - 0x88]
mov dword [ecx], edx
cmp dword [ebp - 0x34], eax
je 0x403869
mov ax, word [ebp - 2]
mov ecx, dword [ebp - 0x34]
mov word [ecx], ax
mov dword [ebp - 0x1a], edx
mov cl, byte [ebp - 0x10]
mov al, byte [ebp - 0xa]
add al, 0x10
lea esi, [ebp - 0x1c]
mov byte [ebp - 0x1b], cl
mov byte [ebp - 0x1c], al
mov ax, word [ebp - 2]
mov cx, bx
sub cl, byte [ebp - 0x10]
shr ax, cl
movzx edi, ax
mov eax, dword [ebp - 0x2c]
imul edi, edi, 6
add edi, dword [eax - 4]
movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
mov eax, dword [ebp - 0x10]
add eax, ebx
cmp eax, dword [ebp - 0x14]
jl 0x40376c
movzx eax, word [ebp + 0xc]
mov cl, byte [ebp - 0x14]
lea esi, [ebp + eax*2 - 0x308]
sub cl, bl
cmp esi, dword [ebp - 0x30]
mov byte [ebp - 0x1b], cl
ja 0x403895
mov byte [ebp - 0x1c], 0x63
jmp 0x4038de
mov eax, dword [ebp - 0x30]
mov si, word [eax]
cmp word [ebp + 0x10], si
jbe 0x4038b6
mov byte [ebp - 0xc], 0x10
cmp si, 0x100
adc byte [ebp - 0xc], 0xff
mov al, byte [ebp - 0xc]
mov byte [ebp - 0x1c], al
jmp 0x4038d6
movzx eax, si
movzx esi, word [ebp + 0x10]
sub eax, esi
mov edi, dword [ebp + 0x18]
lea esi, [eax*2]
mov al, byte [esi + edi]
mov edi, dword [ebp + 0x14]
mov si, word [esi + edi]
mov byte [ebp - 0x1c], al
add dword [ebp - 0x30], 2
mov word [ebp - 0x1a], si
mov ax, 1
shl ax, cl
mov word [ebp - 0x2a], ax
mov cl, bl
mov ax, word [ebp - 2]
shr ax, cl
mov word [ebp - 0xa], ax
cmp word [ebp - 4], ax
jbe 0x40391e
movzx eax, word [ebp - 0xa]
imul eax, eax, 6
lea esi, [ebp - 0x1c]
lea edi, [eax + edx]
movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
mov cx, word [ebp - 0x2a]
add word [ebp - 0xa], cx
mov si, word [ebp - 0xa]
cmp word [ebp - 4], si
ja 0x4038fc
mov ax, 1
mov cl, byte [ebp - 0x14]
dec cl
shl ax, cl
test word [ebp - 2], ax
je 0x40393d
xor word [ebp - 2], ax
shr ax, 1
test word [ebp - 2], ax
jne 0x403930
xor word [ebp - 2], ax
mov edi, 1
mov eax, dword [ebp - 0x28]
mov cl, bl
shl edi, cl
lea eax, [ebp + eax*2 - 0x88]
dec edi
movzx esi, word [ebp - 2]
movzx ecx, word [eax]
and edi, esi
cmp edi, ecx
je 0x403726
sub eax, 2
sub ebx, dword [ebp - 0x10]
mov edi, 1
mov cl, bl
shl edi, cl
dec edi
dec dword [ebp - 0x28]
movzx ecx, word [eax]
and edi, esi
cmp edi, ecx
jne 0x403966
jmp 0x403726
inc dword [ebp - 0x14]
mov eax, dword [ebp - 0x14]
cmp eax, dword [ebp - 0x20]
jle 0x403715
cmp dword [ebp - 0x24], 0
je 0x4039ce
cmp dword [ebp - 0x20], 1
je 0x4039ce
mov eax, 1
jmp 0x4039d0
cmp dword [ebp - 0x28], 0
je 0x4039bd
push dword [ebp - 0xc8]
call fcn.004039d7
add esp, 4
push str.not_enough_memory
call fcn.00401139
mov eax, 3
jmp 0x4039d0
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret