Function at 0x422180
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x38
mov dword [esp + 0x14], 0
mov dword [esp + 0x18], 0xe2fdfcff
mov word [esp + 0x1c], 0
mov dword [esp], 0
mov eax, dword [esp]
cmp eax, 5
ja 0x4221de
nop
nop
nop
mov eax, dword [esp]
mov ecx, dword [esp]
movzx ecx, byte [esp + ecx + 0x18]
add eax, 0x9c510d4d
xor eax, ecx
mov dword [esp + 8], eax
mov eax, dword [esp + 8]
add al, 0x4d
mov ecx, dword [esp]
mov byte [esp + ecx + 0x18], al
inc dword [esp]
mov eax, dword [esp]
cmp eax, 6
jb 0x4221b0
mov eax, dword [esp + 0x18]
mov ecx, dword [0x44ce14]
test ecx, ecx
je 0x422234
xor edx, edx
mov esi, dword [0x44ce18]
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
cmp dword [esi + edx*8], 0xcecd21fd
je 0x422210
inc edx
cmp ecx, edx
jne 0x422200
jmp 0x422234
mov ecx, dword [esi + edx*8 + 4]
cmp ecx, eax
je 0x422234
lea eax, [esp + 0x14]
push eax
push 0
push 0
push 5
push 4
push dword [0x44ce1c]
push ecx
call fcn.0043ea00
add esp, 0x1c
cmp eax, 0xc0000004
jne 0x4222d0
push dword [esp + 0x14]
call fcn.0043cc80
add esp, 4
mov ebp, eax
mov ecx, dword [esp + 0x14]
mov dword [esp + 0x18], 0xe2fdfcff
mov word [esp + 0x1c], 0
mov dword [esp], 0
mov eax, dword [esp]
cmp eax, 5
ja 0x42229e
nop
mov eax, dword [esp]
mov edx, dword [esp]
movzx edx, byte [esp + edx + 0x18]
add eax, 0x9c510d4d
xor eax, edx
mov dword [esp + 8], eax
mov eax, dword [esp + 8]
add al, 0x4d
mov edx, dword [esp]
mov byte [esp + edx + 0x18], al
inc dword [esp]
mov eax, dword [esp]
cmp eax, 6
jb 0x422270
mov eax, dword [esp + 0x18]
mov edx, dword [0x44ce14]
test edx, edx
je 0x4222f6
xor esi, esi
mov edi, dword [0x44ce18]
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
cmp dword [edi + esi*8], 0xcecd21fd
je 0x4222d7
inc esi
cmp edx, esi
jne 0x4222c0
jmp 0x4222f6
xor ebx, ebx
jmp 0x4225bd
mov edx, dword [edi + esi*8 + 4]
cmp edx, eax
je 0x4222f6
push 0
push ecx
push ebp
push 5
push 4
push dword [0x44ce1c]
push edx
call fcn.0043ea00
add esp, 0x1c
xor ebx, ebx
test eax, eax
js 0x4225b4
mov edi, dword [ebp]
mov eax, edi
mov ecx, ebp
nop
nop
nop
nop
nop
nop
nop
nop
nop
lea edx, [ecx + eax]
mov eax, dword [ecx + eax]
dec ebx
mov ecx, edx
test eax, eax
jne 0x422310
lea eax, [ebx - 1]
and eax, 0x104
neg ebx
mov ecx, ebx
and ecx, 0xfffffefb
imul ecx, eax
mov eax, ebx
and eax, 0x104
or ebx, 0x104
imul ebx, eax
add ebx, ecx
mov dword [esp + 0x10], ebp
jns 0x422351
mov ebx, 0xffffffff
jmp 0x422353
add ebx, ebx
push ebx
call fcn.004096b0
add esp, 4
mov ebp, eax
mov dword [esp + 4], eax
mov eax, dword [esp + 0x10]
jmp 0x422382
mov esi, ebp
add eax, edi
lea ebp, [esi + 2]
mov word [esi], 0xa
mov edi, dword [eax]
test edi, edi
je 0x4223b3
mov ecx, dword [eax + edi + 0x3c]
movzx edx, word [ecx]
test dx, dx
je 0x422370
add ecx, 2
mov esi, ebp
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov word [esi], dx
add esi, 2
movzx edx, word [ecx]
add ecx, 2
test dx, dx
jne 0x4223a0
jmp 0x422372
xor ebx, ebx
mov eax, dword [esp + 4]
cmp ebp, eax
je 0x4225a7
mov word [ebp], 0
movzx ecx, word [eax]
test cx, cx
je 0x422414
xor ebx, ebx
mov eax, dword [esp + 4]
jmp 0x4223ee
add ebx, edx
movzx ecx, word [eax + 2]
add eax, 2
test cx, cx
je 0x422414
cmp eax, ebp
jae 0x422414
movzx edi, cx
cmp edi, 0x800
mov ecx, 3
sbb ecx, 0
mov edx, 1
cmp edi, 0x80
jb 0x4223e0
mov edx, ecx
jmp 0x4223e0
lea eax, [ebx + 1]
mov dword [esp + 0x2c], eax
push eax
call fcn.004096b0
add esp, 4
mov edx, eax
mov dword [esp + 0xc], eax
test ebx, ebx
jle 0x422515
mov edx, dword [esp + 0xc]
cmp dword [esp + 4], ebp
jae 0x422515
mov edx, dword [esp + 0xc]
lea eax, [edx + ebx]
mov dword [esp + 0x34], eax
add dword [esp + 0x2c], edx
mov ebp, dword [esp + 4]
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx ecx, word [ebp]
test cx, cx
je 0x422515
cmp cx, 0x7f
ja 0x422480
mov byte [edx], cl
mov edi, 1
jmp 0x422500
mov eax, edx
not eax
add eax, dword [esp + 0x2c]
movzx edi, cx
cmp eax, 2
jb 0x4224c0
cmp edi, 0x7ff
ja 0x4224c0
mov eax, ecx
shr eax, 6
add al, 0xc0
mov byte [edx], al
and cl, 0x3f
or cl, 0x80
mov byte [edx + 1], cl
mov edi, 2
jmp 0x422500
mov dword [esp + 0x30], edi
xor edi, edi
cmp eax, 3
jb 0x422500
mov edi, dword [esp + 0x30]
mov eax, edi
shr eax, 0xc
or al, 0xe0
mov byte [edx], al
mov eax, edi
shr eax, 6
and al, 0x3f
or al, 0x80
mov byte [edx + 1], al
and cl, 0x3f
or cl, 0x80
mov byte [edx + 2], cl
mov edi, 3
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
add edx, edi
cmp edx, dword [esp + 0x34]
jae 0x422515
lea eax, [ebp + 2]
cmp ebp, esi
mov ebp, eax
jb 0x422460
mov byte [edx], 0
mov dword [esp + 0x18], 0xa4afad8c
mov dword [esp + 0x1c], 0xaab7b6a7
mov dword [esp + 0x20], 0xb9ba61b9
mov word [esp + 0x24], 0x33bc
mov dword [esp + 0x26], 0
mov dword [esp], 0
mov eax, dword [esp]
cmp eax, 0x11
ja 0x42257e
nop
nop
mov eax, dword [esp]
mov ecx, dword [esp]
movzx ecx, byte [esp + ecx + 0x18]
add eax, 0xebed2501
xor eax, ecx
mov dword [esp + 8], eax
mov eax, dword [esp + 8]
add al, 0xc3
mov ecx, dword [esp]
mov byte [esp + ecx + 0x18], al
inc dword [esp]
mov eax, dword [esp]
cmp eax, 0x12
jb 0x422550
lea eax, [esp + 0x18]
mov ecx, dword [esp + 0x4c]
push ebx
mov esi, dword [esp + 0x10]
push esi
push eax
call fcn.0040a060
mov ebx, eax
push esi
call fcn.004096c0
add esp, 4
mov ebp, dword [esp + 0x10]
mov eax, dword [esp + 4]
jmp 0x4225ab
mov ebp, dword [esp + 0x10]
push eax
call fcn.004096c0
add esp, 4
push ebp
call fcn.0043cd00
add esp, 4
mov eax, ebx
add esp, 0x38
pop esi
pop edi
pop ebx
pop ebp
ret