Function at 0x407cd0
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
mov eax, 0x15b0
call fcn.004086f0
mov edi, edx
mov dword [esp + 0xc], ecx
mov ebx, dword [esp + 0x15c8]
mov esi, dword [esp + 0x15c4]
lea eax, [esp + 0x2c]
push 0x84
push 0
push eax
call fcn.00408890
add esp, 0xc
cmp dword [esp + 0x15cc], 0
mov dword [esp + 0x10], edi
je 0x407da7
test esi, esi
jle 0x40853f
xor eax, eax
cmp dword [esp + 0x15c4], 1
je 0x407d78
mov ecx, dword [esp + 0x15c4]
and ecx, 0x7ffffffe
mov eax, dword [esp + 0x10]
lea eax, [eax + eax*8]
shl eax, 5
mov edx, dword [esp + 0xc]
add edx, eax
add edx, 0x8f13
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx esi, byte [edx + eax - 1]
inc dword [esp + esi*4 + 0x2c]
movzx esi, byte [edx + eax]
inc dword [esp + esi*4 + 0x2c]
add eax, 2
cmp ecx, eax
jne 0x407d60
mov ecx, dword [esp + 0x15c4]
test cl, 1
je 0x40853f
mov ecx, dword [esp + 0x10]
lea ecx, [ecx + ecx*8]
shl ecx, 5
add ecx, dword [esp + 0xc]
movzx eax, byte [eax + ecx + 0x8f12]
inc dword [esp + eax*4 + 0x2c]
jmp 0x40853f
lea eax, [edi + edi*8]
mov dword [esp + 0x20], eax
mov ebp, eax
shl ebp, 6
test esi, esi
mov dword [esp + 0x1c], ebp
jle 0x407e99
cmp esi, 1
jne 0x408379
xor eax, eax
xor ebx, ebx
mov ecx, dword [esp + 0x15c4]
test cl, 1
je 0x407dfe
mov ecx, dword [esp + 0xc]
add ecx, ebp
add ecx, 0x8192
movzx ecx, word [ecx + eax*2]
test cx, cx
je 0x407dfe
mov word [esp + ebx*4 + 0xb0], cx
mov word [esp + ebx*4 + 0xb2], ax
inc ebx
lea eax, [esp + 0x530]
push 0x800
push 0
push eax
call fcn.00408890
add esp, 0xc
test ebx, ebx
sete byte [esp + 0xb]
je 0x407eb0
xor eax, eax
cmp ebx, 1
je 0x407e6f
mov ecx, ebx
and ecx, 0xfffffffe
xor eax, eax
movzx edx, word [esp + eax*4 + 0xb0]
movzx esi, dl
inc dword [esp + esi*4 + 0x530]
shr edx, 8
inc dword [esp + edx*4 + 0x930]
movzx edx, word [esp + eax*4 + 0xb4]
movzx esi, dl
inc dword [esp + esi*4 + 0x530]
shr edx, 8
inc dword [esp + edx*4 + 0x930]
add eax, 2
cmp ecx, eax
jne 0x407e30
test bl, 1
je 0x407e90
movzx eax, word [esp + eax*4 + 0xb0]
movzx ecx, al
inc dword [esp + ecx*4 + 0x530]
shr eax, 8
inc dword [esp + eax*4 + 0x930]
mov eax, dword [esp + 0x930]
jmp 0x407eb9
lea eax, [esp + 0x530]
push 0x800
push 0
push eax
call fcn.00408890
add esp, 0xc
xor ebx, ebx
mov byte [esp + 0xb], 1
xor eax, eax
xor ecx, ecx
cmp eax, ebx
setne cl
inc ecx
mov dword [esp + 0x28], ecx
lea eax, [ebx - 1]
mov dword [esp + 0x18], eax
mov dword [esp], ebx
and ebx, 0xfffffffe
mov dword [esp + 4], ebx
lea esi, [esp + 0xb0]
lea eax, [esp + 0x1130]
xor ecx, ecx
xor edx, edx
jmp 0x407f04
mov edx, dword [esp + 0x14]
inc edx
add ecx, 8
mov eax, edi
cmp edx, dword [esp + 0x28]
je 0x407ffa
mov edi, esi
mov esi, eax
mov dword [esp + 0x14], edx
mov eax, edx
shl eax, 0xa
lea edx, [esp + eax]
add edx, 0x530
xor ebp, ebp
xor eax, eax
nop
nop
mov dword [esp + eax*4 + 0xd30], ebp
add ebp, dword [edx + eax*4]
mov ebx, eax
and ebx, 1
xor eax, 1
lea eax, [eax + ebx*2]
cmp eax, 0x100
jb 0x407f20
cmp byte [esp + 0xb], 0
jne 0x407ef0
cmp dword [esp + 0x18], 0
je 0x407fbd
xor ebp, ebp
nop
nop
nop
nop
movzx edx, word [edi + ebp*4]
shr edx, cl
mov eax, edx
xor eax, 0x3fffff00
or edx, 0xff
and edx, eax
mov eax, dword [esp + edx*4 + 0xd30]
mov ebx, dword [edi + ebp*4]
mov dword [esi + eax*4], ebx
inc eax
movzx ebx, word [edi + ebp*4 + 4]
shr ebx, cl
mov dword [esp + edx*4 + 0xd30], eax
mov eax, ebx
xor eax, 0x3fffff00
or ebx, 0xff
and ebx, eax
mov eax, dword [esp + ebx*4 + 0xd30]
lea edx, [eax + 1]
mov dword [esp + ebx*4 + 0xd30], edx
mov edx, dword [edi + ebp*4 + 4]
mov dword [esi + eax*4], edx
add ebp, 2
cmp dword [esp + 4], ebp
jne 0x407f50
test byte [esp], 1
je 0x407ef0
jmp 0x407fc9
xor ebp, ebp
test byte [esp], 1
je 0x407ef0
movzx eax, word [edi + ebp*4]
shr eax, cl
mov edx, eax
xor edx, 0x3fffff00
or eax, 0xff
and eax, edx
mov edx, dword [esp + eax*4 + 0xd30]
lea ebx, [edx + 1]
mov dword [esp + eax*4 + 0xd30], ebx
mov eax, dword [edi + ebp*4]
mov dword [esi + edx*4], eax
jmp 0x407ef0
cmp dword [esp], 0
mov ebx, dword [esp + 0x15c8]
je 0x408438
mov ecx, dword [esp]
cmp ecx, 1
jne 0x40801d
mov word [esi], 1
jmp 0x40824c
movzx eax, word [esi + 4]
add word [esi], ax
mov eax, ecx
not eax
and eax, 1
mov ecx, dword [esp + 4]
sub ecx, eax
mov dword [esp + 4], ecx
cmp ecx, 2
jl 0x4080b9
xor eax, eax
mov ecx, 2
mov edi, 1
jmp 0x408060
movzx edx, word [esi + ecx*4]
inc ecx
add word [esi + edi*4], dx
inc edi
cmp dword [esp + 4], edi
je 0x4080b9
movzx edx, word [esi + eax*4]
cmp ecx, dword [esp]
jge 0x408072
movzx ebp, word [esi + ecx*4]
cmp dx, bp
jae 0x4080a0
mov word [esi + edi*4], dx
mov word [esi + eax*4], di
inc eax
cmp ecx, dword [esp]
jge 0x4080aa
cmp eax, edi
jge 0x408050
movzx ebp, word [esi + eax*4]
movzx edx, word [esi + ecx*4]
cmp bp, dx
jae 0x408054
jmp 0x4080ae
mov word [esi + edi*4], bp
inc ecx
cmp ecx, dword [esp]
jl 0x408080
movzx ebp, word [esi + eax*4]
add word [esi + edi*4], bp
mov word [esi + eax*4], di
inc eax
jmp 0x408059
mov eax, dword [esp]
mov word [esi + eax*4 - 8], 0
cmp eax, 3
jl 0x408141
mov edi, dword [esp]
lea ecx, [edi - 3]
and edi, 3
xor edi, 2
mov eax, ecx
je 0x4080f1
mov eax, ecx
nop
nop
nop
nop
nop
nop
movzx edx, word [esi + eax*4]
movzx edx, word [esi + edx*4]
inc edx
mov word [esi + eax*4], dx
dec eax
dec edi
jne 0x4080e0
cmp ecx, 3
jb 0x408141
inc eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx ecx, word [esi + eax*4 - 4]
movzx ecx, word [esi + ecx*4]
inc ecx
mov word [esi + eax*4 - 4], cx
movzx ecx, word [esi + eax*4 - 8]
movzx ecx, word [esi + ecx*4]
inc ecx
mov word [esi + eax*4 - 8], cx
movzx ecx, word [esi + eax*4 - 0xc]
movzx ecx, word [esi + ecx*4]
inc ecx
mov word [esi + eax*4 - 0xc], cx
movzx ecx, word [esi + eax*4 - 0x10]
movzx ecx, word [esi + ecx*4]
inc ecx
mov word [esi + eax*4 - 0x10], cx
add eax, 0xfffffffc
jne 0x408100
mov eax, dword [esp]
add eax, 0xfffffffe
mov ebp, 1
xor ecx, ecx
mov edi, dword [esp + 4]
mov dword [esp + 0x24], esi
jmp 0x40816c
lea ebp, [edx + edx]
inc ecx
test edx, edx
jle 0x408242
test eax, eax
mov dword [esp + 4], ebp
js 0x4081a0
mov ebp, esi
mov esi, edi
lea ebx, [eax + 1]
xor edx, edx
nop
nop
nop
movzx edi, word [ebp + eax*4]
cmp ecx, edi
jne 0x4081b0
inc edx
dec eax
cmp ebx, edx
jne 0x408180
mov eax, 0xffffffff
mov edi, esi
mov esi, ebp
mov edx, ebx
jmp 0x4081b4
xor edx, edx
sub ebp, edx
jle 0x408160
jmp 0x4081c3
mov edi, esi
mov esi, ebp
mov ebx, dword [esp + 0x15c8]
mov ebp, dword [esp + 4]
sub ebp, edx
jle 0x408160
and ebp, 3
je 0x4081ff
mov dword [esp + 0x14], edx
mov edx, esi
mov esi, edi
lea edi, [edx + edi*4]
xor edx, edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov word [edi], cx
inc edx
add edi, 0xfffffffc
cmp ebp, edx
jne 0x4081e0
mov ebp, dword [esp + 4]
sub ebp, edx
mov edi, esi
sub edi, edx
mov esi, dword [esp + 0x24]
mov edx, dword [esp + 0x14]
jmp 0x408203
mov ebp, dword [esp + 4]
mov ebx, edx
sub edx, dword [esp + 4]
cmp edx, 0xfffffffc
mov edx, ebx
mov ebx, dword [esp + 0x15c8]
ja 0x408160
nop
nop
nop
nop
nop
mov word [esi + edi*4], cx
mov word [esi + edi*4 - 4], cx
mov word [esi + edi*4 - 8], cx
mov word [esi + edi*4 - 0xc], cx
add ebp, 0xfffffffc
add edi, 0xfffffffc
cmp ebp, edx
jg 0x408220
jmp 0x408160
cmp dword [esp], 0
jle 0x408438
mov eax, dword [esp]
and eax, 3
xor ecx, ecx
cmp dword [esp + 0x18], 3
jb 0x40829a
mov edx, dword [esp]
and edx, 0xfffffffc
xor ecx, ecx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx edi, word [esi + ecx*4]
inc dword [esp + edi*4 + 0x2c]
movzx edi, word [esi + ecx*4 + 4]
inc dword [esp + edi*4 + 0x2c]
movzx edi, word [esi + ecx*4 + 8]
inc dword [esp + edi*4 + 0x2c]
movzx edi, word [esi + ecx*4 + 0xc]
inc dword [esp + edi*4 + 0x2c]
add ecx, 4
cmp edx, ecx
jne 0x408270
test eax, eax
je 0x4082bd
lea ecx, [esi + ecx*4]
xor edx, edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx edi, word [ecx + edx*4]
inc dword [esp + edi*4 + 0x2c]
inc edx
cmp eax, edx
jne 0x4082b0
cmp dword [esp], 2
jl 0x408438
cmp ebx, 0x1f
jg 0x408330
mov eax, dword [esp + ebx*4 + 0x2c]
mov edx, ebx
neg edx
mov ecx, ebx
and edx, 3
je 0x4082ec
nop
nop
nop
nop
nop
add eax, dword [esp + ecx*4 + 0x30]
inc ecx
mov dword [esp + ebx*4 + 0x2c], eax
dec edx
jne 0x4082e0
lea edx, [ebx - 0x1d]
cmp edx, 3
jb 0x408328
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
add eax, dword [esp + ecx*4 + 0x30]
mov dword [esp + ebx*4 + 0x2c], eax
add eax, dword [esp + ecx*4 + 0x34]
mov dword [esp + ebx*4 + 0x2c], eax
add eax, dword [esp + ecx*4 + 0x38]
mov dword [esp + ebx*4 + 0x2c], eax
add eax, dword [esp + ecx*4 + 0x3c]
add ecx, 4
mov dword [esp + ebx*4 + 0x2c], eax
cmp ecx, 0x20
jne 0x408300
test ebx, ebx
jle 0x4083e5
mov edx, ebx
not edx
xor eax, eax
mov edi, edx
mov ebp, ebx
nop
nop
nop
nop
nop
nop
mov ebx, ebp
and ebx, edx
mov ecx, edi
and ecx, dword [esp + 0x15c8]
sub ecx, ebx
mov ebx, dword [esp + ebp*4 + 0x2c]
shl ebx, cl
add eax, ebx
inc edi
cmp ebp, 1
lea ebp, [ebp - 1]
ja 0x408340
mov edx, 1
mov ebx, dword [esp + 0x15c8]
mov ecx, ebx
shl edx, cl
cmp eax, edx
jne 0x4083f0
jmp 0x408438
mov ecx, esi
and ecx, 0x7ffffffe
mov eax, dword [esp + 0xc]
lea edx, [eax + ebp]
add edx, 0x8194
xor eax, eax
xor ebx, ebx
jmp 0x4083ab
add eax, 2
cmp ecx, eax
je 0x407dcc
movzx esi, word [edx + eax*2 - 2]
test si, si
je 0x4083c6
mov word [esp + ebx*4 + 0xb0], si
mov word [esp + ebx*4 + 0xb2], ax
inc ebx
movzx esi, word [edx + eax*2]
test si, si
je 0x4083a0
mov word [esp + ebx*4 + 0xb0], si
lea esi, [eax + 1]
mov word [esp + ebx*4 + 0xb2], si
inc ebx
jmp 0x4083a0
mov edx, 1
mov ecx, ebx
shl edx, cl
xor eax, eax
dec dword [esp + ebx*4 + 0x2c]
mov ecx, ebx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
cmp ecx, 2
jl 0x40842d
mov edi, dword [esp + ecx*4 + 0x28]
dec ecx
test edi, edi
je 0x408400
dec edi
mov dword [esp + ecx*4 + 0x2c], edi
mov edi, dword [esp + ecx*4 + 0x30]
mov ebx, edi
and ebx, 2
xor edi, 2
lea edi, [edi + ebx*2]
mov ebx, dword [esp + 0x15c8]
mov dword [esp + ecx*4 + 0x30], edi
mov ecx, eax
not ecx
lea eax, [ecx + eax*2]
cmp eax, edx
jne 0x4083f0
mov ebp, dword [esp + 0x20]
shl ebp, 5
mov edi, dword [esp + 0xc]
lea eax, [edi + ebp]
add eax, 0x8f12
push 0x120
push 0
push eax
call fcn.00408890
add esp, 0xc
mov eax, dword [esp + 0x1c]
add eax, edi
add eax, 0x8852
mov edi, ebp
push 0x240
push 0
push eax
call fcn.00408890
add esp, 0xc
test ebx, ebx
jle 0x40853f
add esi, 0xfffffffe
mov eax, 1
add edi, dword [esp + 0xc]
jmp 0x4084a3
mov ebp, dword [esp]
mov dword [esp], ebp
lea ecx, [eax + 1]
cmp eax, ebx
mov eax, ecx
je 0x40853f
mov ebp, dword [esp + eax*4 + 0x2c]
test ebp, ebp
jle 0x408490
mov edx, ebp
and edx, 3
je 0x4084f0
mov dword [esp + 4], ebp
mov ecx, dword [esp]
lea ebp, [esi + ecx*4]
mov ecx, edi
xor edi, edi
movzx ebx, word [ebp]
mov byte [ebx + ecx + 0x8f12], al
inc edi
add ebp, 0xfffffffc
cmp edx, edi
jne 0x4084c0
sub dword [esp], edi
mov ebp, dword [esp + 4]
mov edx, ebp
sub edx, edi
mov ebx, dword [esp + 0x15c8]
mov edi, ecx
jmp 0x4084f2
mov edx, ebp
cmp ebp, 4
mov ebp, dword [esp]
jb 0x408493
dec edx
nop
nop
nop
nop
nop
movzx ecx, word [esi + ebp*4]
mov byte [ecx + edi + 0x8f12], al
movzx ecx, word [esi + ebp*4 - 4]
mov byte [ecx + edi + 0x8f12], al
movzx ecx, word [esi + ebp*4 - 8]
mov byte [ecx + edi + 0x8f12], al
movzx ecx, word [esi + ebp*4 - 0xc]
add ebp, 0xfffffffc
mov byte [ecx + edi + 0x8f12], al
add edx, 0xfffffffc
cmp edx, 0xfffffffe
jb 0x408500
jmp 0x408493
mov dword [esp + 0x534], 0
cmp ebx, 2
jl 0x4085a3
inc ebx
xor eax, eax
cmp ebx, 4
jge 0x40855c
mov ebx, 3
mov ecx, 2
jl 0x408591
mov edx, ebx
and edx, 0x7ffffffe
xor eax, eax
nop
nop
nop
add eax, dword [esp + ecx*4 + 0x28]
add eax, eax
mov dword [esp + ecx*4 + 0x530], eax
add eax, dword [esp + ecx*4 + 0x2c]
add eax, eax
mov dword [esp + ecx*4 + 0x534], eax
add ecx, 2
cmp edx, ecx
jne 0x408570
test bl, 1
je 0x4085a3
add eax, dword [esp + ecx*4 + 0x28]
add eax, eax
mov dword [esp + ecx*4 + 0x530], eax
mov ecx, dword [esp + 0x15c4]
test ecx, ecx
jle 0x408682
xor eax, eax
mov edx, dword [esp + 0x10]
lea edi, [edx + edx*8]
mov edx, edi
shl edx, 5
mov esi, dword [esp + 0xc]
add edx, esi
shl edi, 6
add edi, esi
mov dword [esp + 4], edi
jmp 0x4085fc
mov ecx, dword [esp + 4]
mov word [ecx + eax*2 + 0x8852], di
mov ecx, dword [esp + 0x15c4]
inc eax
cmp eax, ecx
je 0x408682
movzx ebx, byte [eax + edx + 0x8f12]
test ebx, ebx
je 0x4085f3
mov ecx, dword [esp + ebx*4 + 0x530]
lea edi, [ecx + 1]
mov dword [esp + ebx*4 + 0x530], edi
xor edi, edi
cmp bl, 4
jb 0x40865f
mov ebp, ebx
and ebp, 0xfffffffc
xor edi, edi
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov esi, ecx
and esi, 1
shl esi, 2
lea esi, [esi + edi*8]
mov edi, ecx
and edi, 2
or edi, esi
mov esi, ecx
shr esi, 2
and esi, 1
or esi, edi
mov edi, ecx
shr edi, 3
and edi, 1
lea edi, [edi + esi*2]
shr ecx, 4
add ebp, 0xfffffffc
jne 0x408630
and ebx, 3
je 0x4085e0
nop
nop
nop
nop
nop
nop
nop
nop
mov esi, ecx
and esi, 1
lea edi, [esi + edi*2]
shr ecx, 1
dec ebx
jne 0x408670
jmp 0x4085e0
add esp, 0x15b0
pop esi
pop edi
pop ebx
pop ebp
ret