Function at 0x4122c0
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x5c0
cmp dword [esp + 0x5c8], 0x100
push ebx
push esi
push edi
push ebp
jbe 0x4122ea
mov edx, dword [esp + 0x5d4]
mov eax, dword [edx + 0x400]
mov dword [esp + 0x30], eax
jmp 0x4122f9
mov dword [esp + 0x30], 0x10
mov edx, dword [esp + 0x5d4]
lea edi, [esp + 0x44]
xor eax, eax
mov ecx, 0x11
rep stosd dword es:[edi], eax
mov eax, edx
mov ecx, dword [esp + 0x5d8]
mov esi, dword [eax]
add eax, 4
inc dword [esp + esi*4 + 0x44]
dec ecx
jne 0x41230f
mov eax, dword [esp + 0x5d8]
cmp dword [esp + 0x44], eax
jne 0x41234f
mov ecx, dword [esp + 0x5e8]
mov esi, dword [esp + 0x5ec]
xor eax, eax
pop ebp
pop edi
mov dword [ecx], 0
mov dword [esi], 0
pop esi
pop ebx
add esp, 0x5c0
ret
mov ecx, 1
lea eax, [esp + 0x48]
cmp dword [eax], 0
jne 0x41236c
add eax, 4
inc ecx
lea esi, [esp + 0x84]
cmp eax, esi
jbe 0x412358
mov esi, dword [esp + 0x5ec]
mov dword [esp + 0x14], ecx
mov edi, ecx
cmp dword [esi], ecx
jae 0x41237f
mov dword [esi], edi
mov ebx, 0x10
lea eax, [esp + 0x84]
cmp dword [eax], 0
jne 0x41239c
sub eax, 4
dec ebx
lea esi, [esp + 0x44]
cmp eax, esi
jne 0x41238b
mov esi, dword [esp + 0x5ec]
mov dword [esp + 0x28], ebx
cmp dword [esi], ebx
jbe 0x4123ad
mov dword [esi], ebx
mov eax, 1
shl eax, cl
mov dword [esp + 0x20], eax
cmp ecx, ebx
jae 0x4123da
lea eax, [esp + ecx*4 + 0x44]
mov esi, dword [eax]
sub dword [esp + 0x20], esi
js 0x4123f6
add eax, 4
inc ecx
mov esi, dword [esp + 0x20]
add esi, esi
cmp ecx, ebx
mov dword [esp + 0x20], esi
jb 0x4123c0
lea ecx, [esp + ebx*4 + 0x44]
mov eax, dword [ecx]
sub dword [esp + 0x20], eax
jns 0x412406
mov eax, 2
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x5c0
ret
mov eax, 2
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x5c0
ret
add eax, dword [esp + 0x20]
lea esi, [esp + 0xd4]
mov dword [ecx], eax
xor eax, eax
lea ecx, [esp + 0x48]
dec ebx
mov dword [esp + 0xd0], eax
je 0x412430
add eax, dword [ecx]
add ecx, 4
mov dword [esi], eax
add esi, 4
dec ebx
jne 0x412423
xor esi, esi
mov eax, dword [edx]
add edx, 4
test eax, eax
je 0x41244e
lea ecx, [esp + eax*4 + 0xcc]
mov eax, dword [ecx]
inc eax
mov dword [ecx], eax
mov dword [esp + eax*4 + 0x14c], esi
inc esi
cmp dword [esp + 0x5d8], esi
ja 0x412432
xor esi, esi
xor ebp, ebp
lea eax, [esp + 0x150]
mov dword [esp + 0xcc], esi
mov dword [esp + 0x34], eax
mov dword [esp + 0x88], esi
xor edx, edx
mov dword [esp + 0x10], esi
mov dword [esp + 0x110], esi
cmp edi, dword [esp + 0x28]
mov dword [esp + 0x24], 0xffffffff
jg 0x412740
mov eax, dword [esp + 0x14]
lea ecx, [esp + eax*4 + 0x44]
mov dword [esp + 0x3c], ecx
mov eax, dword [ecx]
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x2c]
dec dword [esp + 0x2c]
test eax, eax
je 0x41272e
mov edi, dword [esp + 0x24]
shl edi, 2
mov eax, dword [esp + edi + 0x8c]
add eax, dword [esp + 0x10]
cmp eax, dword [esp + 0x14]
jge 0x41260a
mov eax, dword [esp + 0x2c]
inc eax
mov dword [esp + 0x38], eax
mov eax, dword [esp + edi + 0x8c]
add edi, 4
mov edx, dword [esp + 0x28]
mov esi, dword [esp + 0x5ec]
add dword [esp + 0x10], eax
inc dword [esp + 0x24]
sub edx, dword [esp + 0x10]
mov eax, dword [esi]
cmp edx, eax
jbe 0x412504
mov edx, eax
mov ebx, dword [esp + 0x14]
mov esi, 1
sub ebx, dword [esp + 0x10]
mov cl, bl
shl esi, cl
cmp dword [esp + 0x38], esi
jae 0x41253e
mov eax, dword [esp + 0x2c]
mov ecx, dword [esp + 0x3c]
inc eax
inc ebx
sub esi, eax
cmp edx, ebx
jbe 0x41253e
mov eax, dword [ecx + 4]
add esi, esi
add ecx, 4
cmp eax, esi
jae 0x41253e
sub esi, eax
inc ebx
cmp edx, ebx
ja 0x41252b
mov eax, dword [esp + 0x10]
lea ecx, [ebx + eax]
cmp ecx, dword [esp + 0x30]
jbe 0x412557
cmp dword [esp + 0x30], eax
jbe 0x412557
mov ebx, dword [esp + 0x30]
sub ebx, eax
mov esi, 1
mov cl, bl
shl esi, cl
mov dword [esp + edi + 0x8c], ebx
lea eax, [esi + esi*2 + 3]
add eax, eax
push eax
call fcn.00425ab0
add esp, 4
test eax, eax
je 0x41276e
lea edx, [eax + 6]
mov ecx, dword [esp + 0x5e8]
add eax, 2
mov dword [esp + edi + 0x110], edx
mov dword [ecx], edx
mov dword [esp + 0x5e8], eax
mov dword [eax], 0
test edi, edi
je 0x4125f5
add bl, 0x10
mov cl, byte [esp + 0x10]
mov dword [esp + edi + 0xcc], ebp
mov byte [esp + 0x18], bl
mov al, byte [esp + edi + 0x88]
mov ebx, 1
mov byte [esp + 0x19], al
mov dword [esp + 0x1a], edx
shl ebx, cl
lea eax, [esp + 0x18]
dec ebx
and ebx, ebp
sub cl, byte [esp + edi + 0x88]
shr ebx, cl
mov ecx, dword [eax]
lea ebx, [ebx + ebx*2]
mov ax, word [eax + 4]
add ebx, ebx
add ebx, dword [esp + edi + 0x10c]
mov dword [ebx], ecx
mov word [ebx + 4], ax
mov eax, dword [esp + edi + 0x8c]
add eax, dword [esp + 0x10]
cmp eax, dword [esp + 0x14]
jl 0x4124db
mov cl, byte [esp + 0x14]
mov eax, dword [esp + 0x5d8]
sub cl, byte [esp + 0x10]
lea ebx, [esp + eax*4 + 0x150]
mov byte [esp + 0x19], cl
cmp ebx, dword [esp + 0x34]
ja 0x412631
mov byte [esp + 0x18], 0x64
jmp 0x41267c
mov eax, dword [esp + 0x34]
mov edi, dword [eax]
cmp dword [esp + 0x5dc], edi
jbe 0x412650
mov al, 0x10
cmp edi, 0x100
adc al, 0xff
mov byte [esp + 0x18], al
jmp 0x412672
sub edi, dword [esp + 0x5dc]
mov eax, dword [esp + 0x5e4]
add edi, edi
mov ebx, dword [esp + 0x5e0]
mov al, byte [edi + eax]
mov di, word [edi + ebx]
mov byte [esp + 0x18], al
add dword [esp + 0x34], 4
mov word [esp + 0x1a], di
mov eax, 1
mov edi, ebp
shl eax, cl
mov cl, byte [esp + 0x10]
mov dword [esp + 0x40], eax
shr edi, cl
cmp esi, edi
jbe 0x4126c2
lea eax, [edi + edi*2]
mov ebx, dword [esp + 0x40]
lea ecx, [edx + eax*2]
lea eax, [ebx + ebx*2]
add eax, eax
mov dword [esp + 0x38], eax
lea eax, [esp + 0x18]
add edi, dword [esp + 0x40]
mov ebx, dword [eax]
mov ax, word [eax + 4]
mov dword [ecx], ebx
mov word [ecx + 4], ax
add ecx, dword [esp + 0x38]
cmp esi, edi
ja 0x4126a6
mov eax, 1
mov cl, byte [esp + 0x14]
dec cl
shl eax, cl
test ebp, eax
je 0x4126dc
xor ebp, eax
shr eax, 1
test ebp, eax
jne 0x4126d3
xor ebp, eax
mov edi, dword [esp + 0x24]
shl edi, 2
mov eax, 1
mov cl, byte [esp + 0x10]
shl eax, cl
dec eax
and eax, ebp
cmp eax, dword [esp + edi + 0xcc]
je 0x4124a6
mov eax, dword [esp + edi + 0x88]
sub edi, 4
dec dword [esp + 0x24]
sub dword [esp + 0x10], eax
mov eax, 1
mov cl, byte [esp + 0x10]
shl eax, cl
dec eax
and eax, ebp
cmp eax, dword [esp + edi + 0xcc]
jne 0x412700
jmp 0x4124a6
inc dword [esp + 0x14]
mov eax, dword [esp + 0x14]
cmp eax, dword [esp + 0x28]
jle 0x412494
mov eax, dword [esp + 0x8c]
mov esi, dword [esp + 0x5ec]
cmp dword [esp + 0x20], 0
mov dword [esi], eax
je 0x412795
cmp dword [esp + 0x28], 1
je 0x412795
mov eax, 1
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x5c0
ret
cmp dword [esp + 0x24], 0
je 0x412785
mov eax, dword [esp + 0x110]
push eax
call fcn.00412290
add esp, 4
mov eax, 3
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x5c0
ret
xor eax, eax
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x5c0
ret