Function at 0x410020
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x48
push ebx
mov ebx, dword [esp + 0x54]
push ebp
mov ebp, dword [esp + 0x5c]
push esi
mov esi, eax
mov eax, dword [ebp]
or ecx, 0xffffffff
push edi
mov edi, dword [esp + 0x5c]
mov dword [esp + 0x18], eax
cmp eax, ecx
jne 0x410056
cmp dword [ebp + 8], ecx
jne 0x410056
cmp dword [ebp + 0xc], ecx
jne 0x410056
cmp dword [ebp + 4], ecx
je 0x410893
lea eax, [esp + 0x68]
mov ecx, edi
call fcn.0040f920
cmp eax, 3
je 0x410893
mov eax, dword [esp + 0x18]
cmp dword [esp + 0x68], eax
jge 0x410078
mov dword [esp + 0x68], eax
mov eax, dword [ebp + 4]
cmp dword [esp + 0x6c], eax
mov dword [esp + 0x64], eax
jge 0x410089
mov dword [esp + 0x6c], eax
mov eax, dword [ebp + 8]
mov edx, dword [esp + 0x70]
cmp edx, eax
mov dword [esp + 0x28], eax
jle 0x41009e
mov edx, eax
mov dword [esp + 0x70], edx
mov ebp, dword [ebp + 0xc]
mov ecx, dword [esp + 0x74]
cmp ecx, ebp
mov dword [esp + 0x14], ebp
jle 0x4100b3
mov ecx, ebp
mov dword [esp + 0x74], ecx
cmp dword [esp + 0x68], edx
jge 0x410893
cmp dword [esp + 0x6c], ecx
jge 0x410893
sub eax, dword [esp + 0x18]
mov ecx, dword [ebx + 8]
mov ebp, dword [ebx + 0xc]
cdq
sub eax, edx
mov dword [esp + 0x38], ecx
sar eax, 1
shr ecx, 1
mov dword [esp + 0x34], ebp
cmp ecx, eax
jbe 0x4100e6
mov ecx, eax
mov eax, dword [esp + 0x14]
sub eax, dword [esp + 0x64]
cdq
sub eax, edx
mov edx, ebp
sar eax, 1
shr edx, 1
cmp edx, eax
jbe 0x4100fd
mov edx, eax
mov eax, dword [esp + 0x18]
lea ebp, [eax + ecx]
mov dword [esp + 0x20], ebp
mov ebp, dword [esp + 0x28]
sub ebp, ecx
mov ecx, dword [esp + 0x64]
add ecx, edx
mov dword [esp + 0x24], ecx
mov ecx, dword [esp + 0x14]
sub ecx, edx
mov edx, dword [esp + 0x64]
mov dword [ebx + 0x1c], edx
mov edx, dword [esp + 0x68]
cmp eax, edx
mov dword [esp + 0x60], ecx
mov dword [esp + 0x1c], ebp
mov dword [ebx + 0x18], eax
mov ecx, eax
jge 0x41013c
mov ecx, edx
mov eax, dword [esp + 0x6c]
mov edx, dword [esp + 0x64]
cmp edx, eax
mov dword [esp + 0x4c], eax
jl 0x410150
mov dword [esp + 0x4c], edx
mov edx, dword [esp + 0x70]
mov eax, dword [esp + 0x20]
cmp eax, edx
mov dword [esp + 0x50], edx
jg 0x410164
mov dword [esp + 0x50], eax
mov eax, dword [esp + 0x24]
mov edx, dword [esp + 0x74]
cmp eax, edx
jg 0x410172
mov edx, eax
sub esp, 0x10
mov eax, esp
mov dword [eax], ecx
mov ecx, dword [esp + 0x5c]
mov dword [eax + 4], ecx
mov ecx, dword [esp + 0x60]
push ebx
push esi
mov dword [eax + 8], ecx
push edi
mov dword [eax + 0xc], edx
call fcn.0040fe20
mov eax, dword [esp + 0x28]
sub eax, dword [esp + 0x38]
mov edx, dword [esp + 0x64]
mov dword [esp + 0x38], eax
mov dword [ebx + 0x18], eax
mov eax, dword [esp + 0x68]
cmp ebp, eax
mov dword [ebx + 0x1c], edx
mov ecx, ebp
jge 0x4101b4
mov ecx, eax
mov eax, dword [esp + 0x6c]
cmp edx, eax
mov dword [esp + 0x4c], eax
jl 0x4101c4
mov dword [esp + 0x4c], edx
mov eax, dword [esp + 0x70]
mov edx, dword [esp + 0x28]
cmp edx, eax
mov dword [esp + 0x50], eax
jg 0x4101d8
mov dword [esp + 0x50], edx
mov eax, dword [esp + 0x74]
mov edx, dword [esp + 0x24]
cmp edx, eax
jle 0x4101e6
mov edx, eax
sub esp, 0x10
mov eax, esp
mov dword [eax], ecx
mov ecx, dword [esp + 0x5c]
mov dword [eax + 4], ecx
mov ecx, dword [esp + 0x60]
push ebx
push esi
mov dword [eax + 8], ecx
push edi
mov dword [eax + 0xc], edx
call fcn.0040fe20
mov eax, dword [esp + 0x14]
sub eax, dword [esp + 0x34]
mov ecx, dword [esp + 0x18]
mov dword [esp + 0x34], eax
mov dword [ebx + 0x1c], eax
mov eax, dword [esp + 0x68]
cmp ecx, eax
mov dword [ebx + 0x18], ecx
jge 0x410226
mov ecx, eax
mov eax, dword [esp + 0x6c]
mov edx, dword [esp + 0x60]
cmp edx, eax
mov dword [esp + 0x4c], eax
jl 0x41023a
mov dword [esp + 0x4c], edx
mov eax, dword [esp + 0x70]
mov edx, dword [esp + 0x20]
cmp edx, eax
mov dword [esp + 0x50], eax
jg 0x41024e
mov dword [esp + 0x50], edx
mov eax, dword [esp + 0x74]
mov edx, dword [esp + 0x14]
cmp edx, eax
jle 0x41025c
mov edx, eax
sub esp, 0x10
mov eax, esp
mov dword [eax], ecx
mov ecx, dword [esp + 0x5c]
mov dword [eax + 4], ecx
mov ecx, dword [esp + 0x60]
push ebx
push esi
mov dword [eax + 8], ecx
push edi
mov dword [eax + 0xc], edx
call fcn.0040fe20
mov eax, dword [esp + 0x34]
mov edx, dword [esp + 0x38]
mov dword [ebx + 0x1c], eax
mov eax, dword [esp + 0x68]
cmp ebp, eax
mov dword [ebx + 0x18], edx
mov ecx, ebp
jge 0x410296
mov ecx, eax
mov eax, dword [esp + 0x6c]
mov edx, dword [esp + 0x60]
cmp edx, eax
mov dword [esp + 0x4c], eax
jl 0x4102aa
mov dword [esp + 0x4c], edx
mov eax, dword [esp + 0x70]
mov edx, dword [esp + 0x28]
cmp edx, eax
mov dword [esp + 0x50], eax
jg 0x4102be
mov dword [esp + 0x50], edx
mov eax, dword [esp + 0x74]
mov edx, dword [esp + 0x14]
cmp edx, eax
jle 0x4102cc
mov edx, eax
sub esp, 0x10
mov eax, esp
mov dword [eax], ecx
mov ecx, dword [esp + 0x5c]
mov dword [eax + 4], ecx
mov ecx, dword [esp + 0x60]
push ebx
push esi
mov dword [eax + 8], ecx
push edi
mov dword [eax + 0xc], edx
call fcn.0040fe20
mov eax, dword [ebx + 8]
mov ecx, dword [esp + 0x20]
shr eax, 1
mov dword [esp + 0x30], eax
mov eax, dword [ebx + 0xc]
shr eax, 1
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x68]
cmp ecx, eax
mov dword [esp + 0x48], ecx
jge 0x410314
mov ecx, eax
mov dword [esp + 0x48], ecx
mov edx, dword [esp + 0x6c]
mov eax, dword [esp + 0x64]
cmp eax, edx
mov dword [esp + 0x4c], edx
jl 0x410328
mov dword [esp + 0x4c], eax
mov eax, dword [esp + 0x70]
cmp ebp, eax
mov dword [esp + 0x50], eax
jg 0x410338
mov dword [esp + 0x50], ebp
mov eax, dword [esp + 0x74]
mov edx, dword [esp + 0x24]
cmp edx, eax
jle 0x410346
mov edx, eax
cmp ecx, dword [esp + 0x50]
mov dword [esp + 0x54], edx
jge 0x41043e
mov eax, dword [esp + 0x4c]
cmp eax, edx
jge 0x41043e
mov dword [esp + 0x34], eax
sub eax, dword [esp + 0x64]
mov dword [esp + 0x64], eax
jmp 0x410374
mov ecx, dword [esp + 0x48]
mov edx, dword [ebx + 4]
imul edx, dword [esp + 0x64]
add edx, dword [esp + 0x30]
mov eax, dword [ebx + 0x10]
mov eax, dword [eax + edx*4]
mov ebp, eax
shr ebp, 0x18
imul ebp, esi
shr ebp, 8
mov edx, 0xff
sub edx, ebp
mov ebp, eax
shr eax, 8
and eax, 0xff00ff
and ebp, 0xff00ff
imul eax, esi
imul ebp, esi
and eax, 0xff00ff00
mov dword [esp + 0x38], ecx
mov dword [esp + 0x3c], ebp
mov dword [esp + 0x40], eax
jmp 0x4103c5
mov ebp, dword [esp + 0x3c]
mov eax, dword [edi + 4]
imul eax, dword [esp + 0x34]
add eax, ecx
mov ecx, dword [edi + 0x10]
lea eax, [ecx + eax*4]
mov dword [esp + 0x44], eax
mov eax, dword [eax]
mov ecx, eax
and eax, 0xff00ff
imul eax, edx
add eax, ebp
shr ecx, 8
mov ebp, ecx
and ebp, 0xffff00ff
and ecx, 0xff00ff
imul ebp, edx
imul ecx, edx
shr eax, 8
xor eax, ebp
and eax, 0xff00ff
xor eax, ecx
add eax, dword [esp + 0x40]
mov ecx, dword [esp + 0x44]
mov dword [ecx], eax
mov ecx, dword [esp + 0x38]
inc ecx
cmp ecx, dword [esp + 0x50]
mov dword [esp + 0x38], ecx
jl 0x4103c1
mov eax, dword [esp + 0x34]
inc dword [esp + 0x64]
inc eax
cmp eax, dword [esp + 0x54]
mov dword [esp + 0x34], eax
jl 0x410370
mov ebp, dword [esp + 0x1c]
mov ecx, dword [esp + 0x20]
mov eax, dword [esp + 0x68]
cmp ecx, eax
mov dword [esp + 0x48], ecx
jge 0x410454
mov ecx, eax
mov dword [esp + 0x48], ecx
mov edx, dword [esp + 0x6c]
mov eax, dword [esp + 0x60]
cmp eax, edx
mov dword [esp + 0x4c], edx
jl 0x410468
mov dword [esp + 0x4c], eax
mov eax, dword [esp + 0x70]
cmp ebp, eax
mov dword [esp + 0x50], eax
jg 0x410478
mov dword [esp + 0x50], ebp
mov edx, dword [esp + 0x14]
mov eax, dword [esp + 0x74]
cmp edx, eax
jle 0x410486
mov edx, eax
cmp ecx, dword [esp + 0x50]
mov dword [esp + 0x54], edx
jge 0x41058e
mov eax, dword [esp + 0x4c]
cmp eax, edx
jge 0x41058e
mov edx, dword [esp + 0x2c]
mov dword [esp + 0x64], eax
sub eax, dword [esp + 0x60]
lea eax, [eax + edx + 1]
mov dword [esp + 0x34], eax
jmp 0x4104c4
mov ecx, dword [esp + 0x48]
mov edx, dword [ebx + 4]
imul edx, dword [esp + 0x34]
add edx, dword [esp + 0x30]
mov eax, dword [ebx + 0x10]
mov eax, dword [eax + edx*4]
mov ebp, eax
shr ebp, 0x18
imul ebp, esi
shr ebp, 8
mov edx, 0xff
sub edx, ebp
mov ebp, eax
shr eax, 8
and eax, 0xff00ff
and ebp, 0xff00ff
imul eax, esi
imul ebp, esi
and eax, 0xff00ff00
mov dword [esp + 0x38], ecx
mov dword [esp + 0x44], ebp
mov dword [esp + 0x40], eax
jmp 0x410515
mov ebp, dword [esp + 0x44]
mov eax, dword [edi + 4]
imul eax, dword [esp + 0x64]
add eax, ecx
mov ecx, dword [edi + 0x10]
lea eax, [ecx + eax*4]
mov dword [esp + 0x3c], eax
mov eax, dword [eax]
mov ecx, eax
and eax, 0xff00ff
imul eax, edx
add eax, ebp
shr ecx, 8
mov ebp, ecx
and ebp, 0xffff00ff
and ecx, 0xff00ff
imul ebp, edx
imul ecx, edx
shr eax, 8
xor eax, ebp
and eax, 0xff00ff
xor eax, ecx
add eax, dword [esp + 0x40]
mov ecx, dword [esp + 0x3c]
mov dword [ecx], eax
mov ecx, dword [esp + 0x38]
inc ecx
cmp ecx, dword [esp + 0x50]
mov dword [esp + 0x38], ecx
jl 0x410511
mov eax, dword [esp + 0x64]
inc dword [esp + 0x34]
inc eax
cmp eax, dword [esp + 0x54]
mov dword [esp + 0x64], eax
jl 0x4104c0
mov ebp, dword [esp + 0x1c]
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x68]
cmp eax, ecx
mov dword [esp + 0x48], eax
jge 0x4105a2
mov dword [esp + 0x48], ecx
mov edx, dword [esp + 0x24]
mov eax, dword [esp + 0x6c]
cmp edx, eax
jge 0x4105b0
mov edx, eax
mov eax, dword [esp + 0x20]
cmp eax, dword [esp + 0x70]
jle 0x4105be
mov eax, dword [esp + 0x70]
mov ecx, dword [esp + 0x60]
cmp ecx, dword [esp + 0x74]
mov dword [esp + 0x50], eax
jle 0x4105d0
mov ecx, dword [esp + 0x74]
cmp dword [esp + 0x48], eax
mov dword [esp + 0x54], ecx
jge 0x4106be
cmp edx, ecx
jge 0x4106be
mov dword [esp + 0x64], edx
lea ebx, [ebx]
mov eax, dword [esp + 0x48]
mov dword [esp + 0x38], eax
jmp 0x410600
mov edx, dword [ebx + 4]
imul edx, dword [esp + 0x2c]
sub edx, dword [esp + 0x18]
mov ecx, dword [ebx + 0x10]
add edx, eax
mov ecx, dword [ecx + edx*4]
mov edx, dword [edi + 4]
imul edx, dword [esp + 0x64]
add edx, eax
mov eax, dword [edi + 0x10]
lea eax, [eax + edx*4]
mov edx, ecx
shr edx, 0x18
imul edx, esi
mov dword [esp + 0x44], eax
mov eax, dword [eax]
shr edx, 8
mov ebp, ecx
mov edi, 0xff
sub edi, edx
mov edx, eax
and eax, 0xff00ff
imul eax, edi
and ebp, 0xff00ff
imul ebp, esi
add eax, ebp
shr edx, 8
mov ebp, edx
shr ecx, 8
and ebp, 0xffff00ff
imul ebp, edi
and ecx, 0xff00ff
and edx, 0xff00ff
imul ecx, esi
imul edx, edi
mov edi, dword [esp + 0x5c]
shr eax, 8
xor eax, ebp
and eax, 0xff00ff
xor eax, edx
and ecx, 0xff00ff00
add eax, ecx
mov ecx, dword [esp + 0x44]
mov dword [ecx], eax
mov eax, dword [esp + 0x38]
inc eax
cmp eax, dword [esp + 0x50]
mov dword [esp + 0x38], eax
jl 0x410600
mov eax, dword [esp + 0x64]
inc eax
cmp eax, dword [esp + 0x54]
mov dword [esp + 0x64], eax
jl 0x4105f0
mov ebp, dword [esp + 0x1c]
mov eax, dword [esp + 0x68]
cmp ebp, eax
mov dword [esp + 0x48], ebp
jge 0x4106ce
mov dword [esp + 0x48], eax
mov edx, dword [esp + 0x24]
cmp edx, dword [esp + 0x6c]
jge 0x4106dc
mov edx, dword [esp + 0x6c]
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x70]
cmp eax, ecx
jle 0x4106ea
mov eax, ecx
mov ecx, dword [esp + 0x74]
cmp dword [esp + 0x60], ecx
mov dword [esp + 0x50], eax
jg 0x4106fc
mov ecx, dword [esp + 0x60]
cmp dword [esp + 0x48], eax
mov dword [esp + 0x54], ecx
jge 0x4107f1
cmp edx, ecx
jge 0x4107f1
mov dword [esp + 0x64], edx
jmp 0x410720
mov eax, dword [esp + 0x48]
mov dword [esp + 0x38], eax
jmp 0x410730
mov edx, dword [ebx + 4]
imul edx, dword [esp + 0x2c]
mov ecx, dword [ebx + 0x10]
sub edx, ebp
add edx, eax
add edx, dword [esp + 0x30]
mov ecx, dword [ecx + edx*4 + 4]
mov edx, dword [edi + 4]
imul edx, dword [esp + 0x64]
add edx, eax
mov eax, dword [edi + 0x10]
lea eax, [eax + edx*4]
mov edx, ecx
shr edx, 0x18
imul edx, esi
mov dword [esp + 0x44], eax
mov eax, dword [eax]
shr edx, 8
mov ebp, ecx
and ebp, 0xff00ff
mov edi, 0xff
imul ebp, esi
sub edi, edx
mov edx, eax
and eax, 0xff00ff
imul eax, edi
add eax, ebp
shr edx, 8
mov ebp, edx
and ebp, 0xffff00ff
shr ecx, 8
imul ebp, edi
and ecx, 0xff00ff
and edx, 0xff00ff
imul ecx, esi
imul edx, edi
mov edi, dword [esp + 0x5c]
shr eax, 8
xor eax, ebp
mov ebp, dword [esp + 0x1c]
and eax, 0xff00ff
xor eax, edx
and ecx, 0xff00ff00
add eax, ecx
mov ecx, dword [esp + 0x44]
mov dword [ecx], eax
mov eax, dword [esp + 0x38]
inc eax
cmp eax, dword [esp + 0x50]
mov dword [esp + 0x38], eax
jl 0x410730
mov eax, dword [esp + 0x64]
inc eax
cmp eax, dword [esp + 0x54]
mov dword [esp + 0x64], eax
jl 0x410720
mov edx, dword [ebx + 4]
imul edx, dword [esp + 0x2c]
add edx, dword [esp + 0x30]
mov eax, dword [ebx + 0x10]
mov eax, dword [eax + edx*4]
mov ecx, eax
mov edx, eax
and ecx, 0xff00ff
shr edx, 8
imul ecx, esi
and edx, 0xffff00ff
shr eax, 8
imul edx, esi
and eax, 0xff00ff
imul eax, esi
shr ecx, 8
xor ecx, edx
mov edx, dword [esp + 0x68]
and ecx, 0xff00ff
xor ecx, eax
mov eax, dword [esp + 0x20]
cmp eax, edx
mov dword [esp + 0x48], eax
jge 0x41084a
mov eax, edx
mov dword [esp + 0x48], eax
mov esi, dword [esp + 0x24]
mov edx, dword [esp + 0x6c]
cmp esi, edx
jge 0x410858
mov esi, edx
mov edx, dword [esp + 0x70]
cmp ebp, edx
mov dword [esp + 0x4c], esi
jle 0x410866
mov ebp, edx
mov ebx, dword [esp + 0x60]
cmp ebx, dword [esp + 0x74]
mov edx, dword [esp + 0x74]
mov dword [esp + 0x50], ebp
jg 0x41087a
mov edx, ebx
cmp eax, ebp
mov dword [esp + 0x54], edx
jge 0x410893
cmp esi, edx
jge 0x410893
push ecx
lea eax, [esp + 0x4c]
push eax
mov ecx, edi
call fcn.004108a0
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x48
ret 0x1c