Function at 0x404194
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 0x4041b7
mov ax, word [ebp + 0xc]
cmp word [ebp - 0x64], ax
jne 0x4041e1
xor eax, eax
mov ecx, dword [ebp + 0x1c]
mov edi, dword [ebp + 0x20]
mov dword [ecx], eax
mov dword [edi], eax
jmp 0x4045e2
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 0x404200
inc cx
cmp cx, 0x10
jbe 0x4041ed
movzx esi, cx
cmp word [ebp - 0x10], cx
mov dword [ebp - 0x14], esi
jae 0x40420f
mov dword [ebp - 0x10], esi
mov dx, 0x10
movzx eax, dx
cmp word [ebp + eax*2 - 0x64], 0
jne 0x404222
dec dx
jne 0x404213
movzx eax, dx
cmp dx, word [ebp - 0x10]
mov dword [ebp - 0x20], eax
jae 0x404231
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x10]
mov dword [edi], eax
mov eax, 1
shl eax, cl
cmp dx, cx
mov dword [ebp - 0x24], eax
jbe 0x404261
movzx eax, cx
movzx ebx, word [ebp + eax*2 - 0x64]
sub dword [ebp - 0x24], ebx
js 0x40427d
inc cx
mov eax, dword [ebp - 0x24]
add eax, eax
cmp dx, cx
mov dword [ebp - 0x24], eax
ja 0x404245
mov eax, dword [ebp - 0x20]
lea ecx, [ebp + eax*2 - 0x64]
mov ax, word [ecx]
movzx edi, ax
sub dword [ebp - 0x24], edi
jns 0x404287
mov eax, 2
jmp 0x4045e2
mov eax, 2
jmp 0x4045e2
add ax, word [ebp - 0x24]
xor edi, edi
dec dx
mov word [ecx], ax
lea eax, [ebp - 0x62]
mov word [ebp - 0x86], di
lea ecx, [ebp - 0x84]
je 0x4042b4
add di, word [eax]
add eax, 2
mov word [ecx], di
add ecx, 2
dec dx
jne 0x4042a4
xor dx, dx
mov ecx, dword [ebp + 8]
mov ax, word [ecx]
add ecx, 2
test ax, ax
je 0x4042e2
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 dx, word [ebp + 0xc]
jb 0x4042ba
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 0x4045a8
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 0x404599
mov eax, dword [ebp - 0x10]
add eax, ebx
cmp eax, dword [ebp - 0x14]
jge 0x404489
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 0x40439d
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 0x4043ea
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 0x4043ea
add si, si
add ecx, 2
mov ax, word [ecx]
cmp si, ax
jbe 0x4043ea
sub si, ax
inc word [ebp - 0xa]
cmp dx, word [ebp - 0xa]
ja 0x4043cf
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 0x4045bb
mov cx, word [ebp - 4]
lea edx, [eax + 6]
inc cx
mov esi, dword [ebp + 0x1c]
add word [0x40800e], 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 0x40447b
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 0x40437e
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 0x4044a7
mov byte [ebp - 0x1c], 0x63
jmp 0x4044f0
mov eax, dword [ebp - 0x30]
mov si, word [eax]
cmp word [ebp + 0x10], si
jbe 0x4044c8
mov byte [ebp - 0xc], 0x10
cmp si, 0x100
adc byte [ebp - 0xc], 0xff
mov al, byte [ebp - 0xc]
mov byte [ebp - 0x1c], al
jmp 0x4044e8
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 0x404530
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 0x40450e
mov ax, 1
mov cl, byte [ebp - 0x14]
dec cl
shl ax, cl
test word [ebp - 2], ax
je 0x40454f
xor word [ebp - 2], ax
shr ax, 1
test word [ebp - 2], ax
jne 0x404542
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 0x404338
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 0x404578
jmp 0x404338
inc dword [ebp - 0x14]
mov eax, dword [ebp - 0x14]
cmp dword [ebp - 0x20], eax
jge 0x404327
cmp dword [ebp - 0x24], 0
je 0x4045e0
cmp dword [ebp - 0x20], 1
je 0x4045e0
mov eax, 1
jmp 0x4045e2
cmp dword [ebp - 0x28], 0
je 0x4045cf
push dword [ebp - 0xc8]
call fcn.004045e9
add esp, 4
push str.not_enough_memory
call fcn.004011e2
mov eax, 3
jmp 0x4045e2
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret