Function at 0x402ed5
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 0x402ef8
mov ax, word [ebp + 0xc]
cmp word [ebp - 0x64], ax
jne 0x402f22
xor eax, eax
mov ecx, dword [ebp + 0x1c]
mov edi, dword [ebp + 0x20]
mov dword [ecx], eax
mov dword [edi], eax
jmp 0x403323
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 0x402f41
inc cx
cmp cx, 0x10
jbe 0x402f2e
movzx esi, cx
cmp word [ebp - 0x10], cx
mov dword [ebp - 0x14], esi
jae 0x402f50
mov dword [ebp - 0x10], esi
mov dx, 0x10
movzx eax, dx
cmp word [ebp + eax*2 - 0x64], 0
jne 0x402f63
dec dx
jne 0x402f54
movzx eax, dx
cmp word [ebp - 0x10], dx
mov dword [ebp - 0x20], eax
jbe 0x402f72
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 0x402fa2
movzx eax, cx
movzx ebx, word [ebp + eax*2 - 0x64]
sub dword [ebp - 0x24], ebx
js 0x402fbe
inc cx
mov eax, dword [ebp - 0x24]
add eax, eax
cmp cx, dx
mov dword [ebp - 0x24], eax
jb 0x402f86
mov eax, dword [ebp - 0x20]
lea ecx, [ebp + eax*2 - 0x64]
mov ax, word [ecx]
movzx edi, ax
sub dword [ebp - 0x24], edi
jns 0x402fc8
mov eax, 2
jmp 0x403323
mov eax, 2
jmp 0x403323
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 0x402ff5
add ax, word [ecx]
add ecx, 2
mov word [edi], ax
add edi, 2
dec dx
jne 0x402fe5
xor dx, dx
mov ecx, dword [ebp + 8]
mov ax, word [ecx]
add ecx, 2
test ax, ax
je 0x403023
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 0x402ffb
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 0x4032e9
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 0x4032da
mov eax, dword [ebp - 0x10]
add eax, ebx
cmp eax, dword [ebp - 0x14]
jge 0x4031ca
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 0x4030de
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 0x40312b
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 0x40312b
add si, si
add ecx, 2
mov ax, word [ecx]
cmp si, ax
jbe 0x40312b
sub si, ax
inc word [ebp - 0xa]
cmp dx, word [ebp - 0xa]
ja 0x403110
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 0x4032fc
mov cx, word [ebp - 4]
lea edx, [eax + 6]
inc cx
mov esi, dword [ebp + 0x1c]
add word [0x406e3e], 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 0x4031bc
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 0x4030bf
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 0x4031e8
mov byte [ebp - 0x1c], 0x63
jmp 0x403231
mov eax, dword [ebp - 0x30]
mov si, word [eax]
cmp word [ebp + 0x10], si
jbe 0x403209
mov byte [ebp - 0xc], 0x10
cmp si, 0x100
adc byte [ebp - 0xc], 0xff
mov al, byte [ebp - 0xc]
mov byte [ebp - 0x1c], al
jmp 0x403229
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 0x403271
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 0x40324f
mov ax, 1
mov cl, byte [ebp - 0x14]
dec cl
shl ax, cl
test word [ebp - 2], ax
je 0x403290
xor word [ebp - 2], ax
shr ax, 1
test word [ebp - 2], ax
jne 0x403283
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 0x403079
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 0x4032b9
jmp 0x403079
inc dword [ebp - 0x14]
mov eax, dword [ebp - 0x14]
cmp eax, dword [ebp - 0x20]
jle 0x403068
cmp dword [ebp - 0x24], 0
je 0x403321
cmp dword [ebp - 0x20], 1
je 0x403321
mov eax, 1
jmp 0x403323
cmp dword [ebp - 0x28], 0
je 0x403310
push dword [ebp - 0xc8]
call fcn.0040332a
add esp, 4
push str.not_enough_memory
call fcn.00401139
mov eax, 3
jmp 0x403323
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret