Function at 0x407e30
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
mov eax, 0x15ac
call fcn.004087e0
mov esi, edx
mov edi, ecx
mov ebx, dword [esp + 0x15c0]
lea eax, [esp + 0x28]
push 0x84
push 0
push eax
call fcn.004089a0
add esp, 0xc
cmp dword [esp + 0x15c8], 0
mov dword [esp + 0x1c], esi
je 0x407ede
test ebx, ebx
jle 0x408650
xor eax, eax
cmp ebx, 1
je 0x407eb8
mov ecx, ebx
and ecx, 0xfffffffe
mov eax, dword [esp + 0x1c]
lea eax, [eax + eax*8]
shl eax, 5
lea edx, [eax + edi]
add edx, 0x8f13
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx esi, byte [edx + eax - 1]
inc dword [esp + esi*4 + 0x28]
movzx esi, byte [edx + eax]
inc dword [esp + esi*4 + 0x28]
add eax, 2
cmp ecx, eax
jne 0x407ea0
test bl, 1
je 0x408650
mov ecx, dword [esp + 0x1c]
lea ecx, [ecx + ecx*8]
shl ecx, 5
add ecx, edi
movzx eax, byte [eax + ecx + 0x8f12]
inc dword [esp + eax*4 + 0x28]
jmp 0x408650
lea eax, [esi + esi*8]
mov dword [esp + 0x18], eax
shl eax, 6
test ebx, ebx
mov dword [esp + 0x14], edi
mov dword [esp + 0x20], eax
jle 0x407fd9
cmp ebx, 1
jne 0x408487
xor eax, eax
xor ebp, ebp
test bl, 1
mov ebx, ebp
mov edx, dword [esp + 0x14]
je 0x407f36
mov ecx, dword [esp + 0x20]
add ecx, edx
add ecx, 0x8192
movzx ecx, word [ecx + eax*2]
test cx, cx
je 0x407f36
mov word [esp + ebx*4 + 0xac], cx
mov word [esp + ebx*4 + 0xae], ax
inc ebx
lea eax, [esp + 0x52c]
push 0x800
push 0
push eax
call fcn.004089a0
add esp, 0xc
test ebx, ebx
sete byte [esp + 0xc]
je 0x407ff0
xor eax, eax
cmp ebx, 1
je 0x407faf
mov ecx, ebx
and ecx, 0xfffffffe
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
movzx edx, word [esp + eax*4 + 0xac]
movzx esi, dl
inc dword [esp + esi*4 + 0x52c]
shr edx, 8
inc dword [esp + edx*4 + 0x92c]
movzx edx, word [esp + eax*4 + 0xb0]
movzx esi, dl
inc dword [esp + esi*4 + 0x52c]
shr edx, 8
inc dword [esp + edx*4 + 0x92c]
add eax, 2
cmp ecx, eax
jne 0x407f70
test bl, 1
je 0x407fd0
movzx eax, word [esp + eax*4 + 0xac]
movzx ecx, al
inc dword [esp + ecx*4 + 0x52c]
shr eax, 8
inc dword [esp + eax*4 + 0x92c]
mov eax, dword [esp + 0x92c]
jmp 0x407ff9
lea eax, [esp + 0x52c]
push 0x800
push 0
push eax
call fcn.004089a0
add esp, 0xc
xor ebx, ebx
mov byte [esp + 0xc], 1
xor eax, eax
xor ecx, ecx
cmp eax, ebx
sete cl
mov eax, 2
sub eax, ecx
mov dword [esp + 0x24], eax
lea eax, [esp + 0xac]
mov dword [esp + 8], eax
lea eax, [esp + 0x112c]
xor ecx, ecx
lea esi, [esp + 0x52c]
xor edx, edx
mov dword [esp], ebx
jmp 0x40804e
mov edx, dword [esp + 4]
inc edx
add ecx, 8
mov esi, dword [esp + 0x10]
add esi, 0x400
mov eax, ebp
cmp edx, dword [esp + 0x24]
je 0x408101
mov dword [esp + 4], edx
mov ebp, dword [esp + 8]
mov dword [esp + 8], eax
mov edx, 3
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov dword [esp + edx*4 + 0xd20], eax
add eax, dword [esi + edx*4 - 0xc]
mov dword [esp + edx*4 + 0xd24], eax
add eax, dword [esi + edx*4 - 8]
mov dword [esp + edx*4 + 0xd28], eax
add eax, dword [esi + edx*4 - 4]
mov dword [esp + edx*4 + 0xd2c], eax
add eax, dword [esi + edx*4]
add edx, 4
cmp edx, 0x103
jne 0x408070
mov dword [esp + 0x10], esi
cmp byte [esp + 0xc], 0
mov edi, dword [esp + 8]
jne 0x408030
xor edx, edx
nop
nop
nop
nop
nop
movzx eax, word [ebp + edx*4]
shr eax, cl
movzx eax, al
mov esi, ebp
mov ebp, edi
mov edi, dword [esp + eax*4 + 0xd2c]
lea ebx, [edi + 1]
mov dword [esp + eax*4 + 0xd2c], ebx
mov ebx, dword [esp]
mov eax, dword [esi + edx*4]
mov dword [ebp + edi*4], eax
mov edi, ebp
mov ebp, esi
mov eax, edx
and eax, 1
xor edx, 1
lea edx, [edx + eax*2]
cmp edx, ebx
jb 0x4080c0
jmp 0x408030
test ebx, ebx
mov ebx, dword [esp + 8]
je 0x4084f5
mov ecx, dword [esp]
cmp ecx, 1
jne 0x40811f
mov word [ebx], 1
jmp 0x40835c
movzx eax, word [ebx + 4]
add word [ebx], ax
cmp ecx, 3
jl 0x4081bb
mov eax, 2
mov edi, 2
sub edi, dword [esp]
mov edx, 1
xor esi, esi
jmp 0x408167
movzx ecx, word [ebx + esi*4]
add word [ebx + edx*4], cx
mov word [ebx + esi*4], dx
inc esi
lea ecx, [edi + edx]
inc ecx
inc edx
cmp ecx, 1
je 0x4081bb
movzx ecx, word [ebx + esi*4]
cmp eax, dword [esp]
jge 0x408179
movzx ebp, word [ebx + eax*4]
cmp cx, bp
jae 0x408190
mov word [ebx + edx*4], cx
mov word [ebx + esi*4], dx
inc esi
cmp eax, dword [esp]
jge 0x408150
jmp 0x40819a
inc eax
mov word [ebx + edx*4], bp
cmp eax, dword [esp]
jge 0x408150
cmp esi, edx
jge 0x4081b0
movzx ecx, word [ebx + esi*4]
movzx ebp, word [ebx + eax*4]
cmp cx, bp
jb 0x408154
jmp 0x4081b4
movzx ebp, word [ebx + eax*4]
inc eax
add word [ebx + edx*4], bp
jmp 0x40815d
mov ecx, dword [esp]
mov word [ebx + ecx*4 - 8], 0
mov eax, ecx
or eax, 0xfffffffc
and ecx, 0xfffffffc
add ecx, eax
inc ecx
js 0x408251
mov eax, dword [esp]
lea edx, [eax + 2]
mov eax, ecx
and edx, 3
je 0x408201
mov eax, ecx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx esi, word [ebx + eax*4]
movzx esi, word [ebx + esi*4]
inc esi
mov word [ebx + eax*4], si
dec eax
dec edx
jne 0x4081f0
cmp ecx, 3
jb 0x408251
inc eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx ecx, word [ebx + eax*4 - 4]
movzx ecx, word [ebx + ecx*4]
inc ecx
mov word [ebx + eax*4 - 4], cx
movzx ecx, word [ebx + eax*4 - 8]
movzx ecx, word [ebx + ecx*4]
inc ecx
mov word [ebx + eax*4 - 8], cx
movzx ecx, word [ebx + eax*4 - 0xc]
movzx ecx, word [ebx + ecx*4]
inc ecx
mov word [ebx + eax*4 - 0xc], cx
movzx ecx, word [ebx + eax*4 - 0x10]
movzx ecx, word [ebx + ecx*4]
inc ecx
mov word [ebx + eax*4 - 0x10], cx
add eax, 0xfffffffc
jne 0x408210
mov edx, dword [esp]
lea eax, [edx - 1]
mov ecx, edx
and ecx, 0xfffffffd
or edx, 0xfffffffd
add ecx, edx
inc ecx
mov esi, 1
mov dword [esp + 4], 0
jmp 0x408295
mov edx, dword [esp + 4]
mov esi, ebp
add esi, ebp
inc edx
mov dword [esp + 4], edx
test ebp, ebp
jle 0x408352
test ecx, ecx
js 0x4082d0
lea edx, [ecx + 1]
mov dword [esp + 0x10], edx
xor ebp, ebp
mov edi, dword [esp + 4]
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx edx, word [ebx + ecx*4]
cmp edi, edx
jne 0x4082d2
inc ebp
add ecx, 0xffffffff
jb 0x4082b0
mov ecx, 0xffffffff
mov ebp, dword [esp + 0x10]
jmp 0x4082d2
xor ebp, ebp
mov edi, esi
sub edi, ebp
jle 0x408280
mov ebx, edi
mov edi, ebp
not edi
add edi, esi
and ebx, 3
je 0x408317
mov dword [esp + 0xc], edi
mov dword [esp + 0x10], ebp
mov edx, dword [esp + 8]
lea edx, [edx + eax*4]
xor ebp, ebp
mov edi, dword [esp + 4]
nop
nop
nop
nop
nop
nop
mov word [edx], di
inc ebp
add edx, 0xfffffffc
cmp ebx, ebp
jne 0x408300
sub esi, ebp
sub eax, ebp
mov ebp, dword [esp + 0x10]
mov edi, dword [esp + 0xc]
mov ebx, dword [esp + 8]
cmp edi, 3
mov edx, dword [esp + 4]
jb 0x408284
nop
nop
nop
nop
nop
nop
nop
nop
mov word [ebx + eax*4], dx
mov word [ebx + eax*4 - 4], dx
mov word [ebx + eax*4 - 8], dx
mov word [ebx + eax*4 - 0xc], dx
add eax, 0xfffffffc
add esi, 0xfffffffc
cmp esi, ebp
jg 0x408330
jmp 0x408284
cmp dword [esp], 0
jle 0x4084f5
mov eax, dword [esp]
lea edx, [eax - 1]
and eax, 3
xor ecx, ecx
cmp edx, 3
jb 0x4083aa
mov edx, dword [esp]
and edx, 0xfffffffc
xor ecx, ecx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx esi, word [ebx + ecx*4]
inc dword [esp + esi*4 + 0x28]
movzx esi, word [ebx + ecx*4 + 4]
inc dword [esp + esi*4 + 0x28]
movzx esi, word [ebx + ecx*4 + 8]
inc dword [esp + esi*4 + 0x28]
movzx esi, word [ebx + ecx*4 + 0xc]
inc dword [esp + esi*4 + 0x28]
add ecx, 4
cmp edx, ecx
jne 0x408380
test eax, eax
je 0x4083cd
lea ecx, [ebx + ecx*4]
xor edx, edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx esi, word [ecx + edx*4]
inc dword [esp + esi*4 + 0x28]
inc edx
cmp eax, edx
jne 0x4083c0
cmp dword [esp], 2
jl 0x4084f5
mov edx, dword [esp + 0x15c4]
cmp edx, 0x20
jge 0x408450
mov eax, dword [esp + edx*4 + 0x28]
mov esi, edx
neg edx
mov ecx, esi
and edx, 3
je 0x40840c
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
add eax, dword [esp + ecx*4 + 0x2c]
inc ecx
mov dword [esp + esi*4 + 0x28], eax
dec edx
jne 0x408400
lea edx, [esi - 0x1d]
cmp edx, 3
mov edx, esi
jb 0x408448
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
add eax, dword [esp + ecx*4 + 0x2c]
mov dword [esp + edx*4 + 0x28], eax
add eax, dword [esp + ecx*4 + 0x30]
mov dword [esp + edx*4 + 0x28], eax
add eax, dword [esp + ecx*4 + 0x34]
mov dword [esp + edx*4 + 0x28], eax
add eax, dword [esp + ecx*4 + 0x38]
add ecx, 4
mov dword [esp + edx*4 + 0x28], eax
cmp ecx, 0x20
jne 0x408420
test edx, edx
jle 0x4084e5
inc edx
xor ecx, ecx
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov esi, dword [esp + edx*4 + 0x24]
shl esi, cl
add eax, esi
dec edx
inc ecx
cmp edx, 1
ja 0x408460
mov edx, 1
mov ecx, dword [esp + 0x15c4]
shl edx, cl
cmp eax, edx
jne 0x40879d
jmp 0x4084f5
mov ecx, ebx
and ecx, 0xfffffffe
lea edx, [eax + edi]
add edx, 0x8194
xor eax, eax
xor ebp, ebp
jmp 0x4084ab
add eax, 2
cmp ecx, eax
je 0x407f05
movzx esi, word [edx + eax*2 - 2]
test si, si
je 0x4084c6
mov word [esp + ebp*4 + 0xac], si
mov word [esp + ebp*4 + 0xae], ax
inc ebp
movzx esi, word [edx + eax*2]
test si, si
je 0x4084a0
mov word [esp + ebp*4 + 0xac], si
lea esi, [eax + 1]
mov word [esp + ebp*4 + 0xae], si
inc ebp
jmp 0x4084a0
mov ecx, edx
mov edx, 1
shl edx, cl
xor eax, eax
jmp 0x40879d
mov edi, dword [esp + 0x18]
shl edi, 5
mov ebp, dword [esp + 0x14]
mov esi, edi
lea eax, [edi + ebp]
add eax, 0x8f12
push 0x120
push 0
push eax
call fcn.004089a0
add esp, 0xc
mov eax, dword [esp + 0x20]
add eax, ebp
add eax, 0x8852
push 0x240
push 0
push eax
call fcn.004089a0
add esp, 0xc
cmp dword [esp + 0x15c4], 0
jle 0x408645
add ebx, 0xfffffffe
mov eax, 1
mov dword [esp + 8], ebx
mov dword [esp + 0x18], esi
jmp 0x408586
mov edi, ebx
mov ebx, dword [esp]
mov ebp, esi
mov esi, ebp
mov dword [esp], ebx
mov ecx, eax
and ecx, 1
xor eax, 1
lea eax, [eax + ecx*2]
cmp eax, dword [esp + 0x15c4]
mov ebx, edi
jg 0x408645
mov ecx, dword [esp + eax*4 + 0x28]
test ecx, ecx
jle 0x408560
mov edx, ecx
and edx, 3
je 0x4085e0
mov dword [esp + 4], ecx
mov ecx, dword [esp]
lea ebp, [ebx + ecx*4]
xor esi, esi
mov ecx, dword [esp + 0x14]
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx edi, word [ebp]
mov ebx, dword [esp + 0x18]
add ebx, ecx
mov byte [edi + ebx + 0x8f12], al
inc esi
add ebp, 0xfffffffc
cmp edx, esi
jne 0x4085b0
mov ecx, dword [esp + 4]
mov edx, ecx
sub edx, esi
sub dword [esp], esi
mov esi, dword [esp + 0x18]
jmp 0x4085e2
mov edx, ecx
cmp ecx, 4
mov ebx, dword [esp]
mov edi, dword [esp + 8]
mov ebp, esi
jb 0x408567
dec edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx ecx, word [edi + ebx*4]
mov esi, dword [esp + 0x14]
add esi, ebp
mov byte [ecx + esi + 0x8f12], al
movzx ecx, word [edi + ebx*4 - 4]
mov byte [ecx + esi + 0x8f12], al
movzx ecx, word [edi + ebx*4 - 8]
mov byte [ecx + esi + 0x8f12], al
movzx ecx, word [edi + ebx*4 - 0xc]
mov byte [ecx + esi + 0x8f12], al
add ebx, 0xfffffffc
add edx, 0xfffffffc
cmp edx, 0xfffffffe
jb 0x408600
jmp 0x408567
mov ebx, dword [esp + 0x15c0]
mov edi, dword [esp + 0x14]
mov dword [esp + 0x530], 0
mov eax, dword [esp + 0x15c4]
cmp eax, 2
jl 0x4086cd
lea ecx, [eax - 1]
cmp eax, 2
jne 0x40867d
xor eax, eax
mov edx, 2
test cl, 1
jne 0x4086c0
jmp 0x4086cd
mov ebx, ecx
and ebx, 0xfffffffe
xor eax, eax
xor edx, edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
add eax, dword [esp + edx*4 + 0x2c]
add eax, eax
mov dword [esp + edx*4 + 0x534], eax
add eax, dword [esp + edx*4 + 0x30]
add eax, eax
mov dword [esp + edx*4 + 0x538], eax
add edx, 2
cmp ebx, edx
jne 0x408690
add edx, 2
mov ebx, dword [esp + 0x15c0]
test cl, 1
je 0x4086cd
add eax, dword [esp + edx*4 + 0x24]
add eax, eax
mov dword [esp + edx*4 + 0x52c], eax
test ebx, ebx
jle 0x408792
xor eax, eax
mov ecx, dword [esp + 0x1c]
lea ecx, [ecx + ecx*8]
mov edx, ecx
shl edx, 5
add edx, edi
shl ecx, 6
add ecx, edi
mov dword [esp], ecx
jmp 0x40870b
mov ecx, dword [esp]
mov word [ecx + eax*2 + 0x8852], bx
mov ebx, dword [esp + 0x15c0]
inc eax
cmp eax, ebx
je 0x408792
movzx ecx, byte [eax + edx + 0x8f12]
test ecx, ecx
je 0x408702
mov ebp, dword [esp + ecx*4 + 0x52c]
lea edi, [ebp + 1]
mov dword [esp + ecx*4 + 0x52c], edi
mov edi, ecx
and edi, 3
xor ebx, ebx
cmp cl, 4
jb 0x40876f
and ecx, 0xfffffffc
xor ebx, ebx
nop
nop
nop
nop
nop
nop
nop
mov esi, ebp
and esi, 1
shl esi, 2
lea esi, [esi + ebx*8]
mov ebx, ebp
and ebx, 2
or ebx, esi
mov esi, ebp
shr esi, 2
and esi, 1
or esi, ebx
mov ebx, ebp
shr ebx, 3
and ebx, 1
lea ebx, [ebx + esi*2]
shr ebp, 4
add ecx, 0xfffffffc
jne 0x408740
test edi, edi
je 0x4086f0
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov ecx, ebp
and ecx, 1
lea ebx, [ecx + ebx*2]
shr ebp, 1
dec edi
jne 0x408780
jmp 0x4086f0
add esp, 0x15ac
pop esi
pop edi
pop ebx
pop ebp
ret
mov ecx, dword [esp + 0x15c4]
dec dword [esp + ecx*4 + 0x28]
nop
nop
nop
nop
nop
nop
nop
nop
cmp ecx, 2
jl 0x4087c8
mov esi, dword [esp + ecx*4 + 0x24]
dec ecx
test esi, esi
je 0x4087b0
dec esi
mov dword [esp + ecx*4 + 0x28], esi
add dword [esp + ecx*4 + 0x2c], 2
dec eax
cmp eax, edx
jne 0x40879d
jmp 0x4084f5