Function at 0x407e70
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
mov eax, 0x15b0
call fcn.00408890
mov esi, edx
mov dword [esp + 0xc], ecx
mov ebx, dword [esp + 0x15c4]
lea eax, [esp + 0x2c]
push 0x84
push 0
push eax
call fcn.00408aa0
add esp, 0xc
cmp dword [esp + 0x15cc], 0
mov dword [esp + 0x1c], esi
je 0x407f20
test ebx, ebx
jle 0x4086d1
xor eax, eax
cmp ebx, 1
je 0x407ef8
mov ecx, ebx
and ecx, 0xfffffffe
mov eax, dword [esp + 0x1c]
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
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 0x407ee0
test bl, 1
je 0x4086d1
mov ecx, dword [esp + 0x1c]
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 0x4086d1
lea eax, [esi + esi*8]
mov dword [esp + 0x10], eax
mov ebp, eax
shl ebp, 6
test ebx, ebx
jle 0x40801b
cmp ebx, 1
jne 0x40829b
xor edi, edi
xor eax, eax
test bl, 1
je 0x407f6c
mov ecx, dword [esp + 0xc]
add ecx, ebp
add ecx, 0x8192
movzx ecx, word [ecx + eax*2]
test cx, cx
je 0x407f6c
mov word [esp + edi*4 + 0x4b0], cx
mov word [esp + edi*4 + 0x4b2], ax
inc edi
lea eax, [esp + 0x930]
push 0x800
push 0
push eax
call fcn.00408aa0
add esp, 0xc
test edi, edi
sete byte [esp + 0x14]
je 0x408032
mov eax, edi
mov ecx, edi
xor eax, eax
cmp edi, 1
je 0x407fef
mov ecx, edi
and ecx, 0xfffffffe
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx edx, word [esp + eax*4 + 0x4b0]
movzx esi, dl
inc dword [esp + esi*4 + 0x930]
shr edx, 8
inc dword [esp + edx*4 + 0xd30]
movzx edx, word [esp + eax*4 + 0x4b4]
movzx esi, dl
inc dword [esp + esi*4 + 0x930]
shr edx, 8
inc dword [esp + edx*4 + 0xd30]
add eax, 2
cmp ecx, eax
jne 0x407fb0
mov ecx, edi
test cl, 1
je 0x408012
movzx eax, word [esp + eax*4 + 0x4b0]
movzx ecx, al
inc dword [esp + ecx*4 + 0x930]
shr eax, 8
inc dword [esp + eax*4 + 0xd30]
mov eax, dword [esp + 0xd30]
jmp 0x40803b
lea eax, [esp + 0x930]
push 0x800
push 0
push eax
call fcn.00408aa0
add esp, 0xc
xor edi, edi
mov byte [esp + 0x14], 1
xor eax, eax
mov dword [esp + 0x24], ebp
xor ecx, ecx
cmp eax, edi
sete cl
mov eax, 2
sub eax, ecx
mov dword [esp + 0x28], eax
lea eax, [edi - 1]
mov dword [esp + 0x20], eax
mov dword [esp + 4], edi
and edi, 0xfffffffe
mov dword [esp + 8], edi
lea ebx, [esp + 0x1130]
lea eax, [esp + 0x4b0]
xor ecx, ecx
lea edx, [esp + 0x930]
mov dword [esp + 0x18], 0
jmp 0x4080af
mov esi, dword [esp + 0x18]
inc esi
add ecx, 8
add edx, 0x400
mov eax, dword [esp]
mov dword [esp + 0x18], esi
cmp esi, dword [esp + 0x28]
je 0x4081ab
mov dword [esp], ebx
mov ebx, eax
mov ebp, 3
xor eax, eax
nop
nop
nop
nop
nop
mov dword [esp + ebp*4 + 0xa4], eax
add eax, dword [edx + ebp*4 - 0xc]
mov dword [esp + ebp*4 + 0xa8], eax
add eax, dword [edx + ebp*4 - 8]
mov dword [esp + ebp*4 + 0xac], eax
add eax, dword [edx + ebp*4 - 4]
mov dword [esp + ebp*4 + 0xb0], eax
add eax, dword [edx + ebp*4]
add ebp, 4
cmp ebp, 0x103
jne 0x4080c0
cmp byte [esp + 0x14], 0
jne 0x408090
cmp dword [esp + 0x20], 0
je 0x408172
xor ebp, ebp
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx eax, word [ebx + ebp*4]
shr eax, cl
movzx eax, al
mov edi, dword [esp + eax*4 + 0xb0]
mov esi, ebx
lea ebx, [edi + 1]
mov dword [esp + eax*4 + 0xb0], ebx
mov eax, dword [esi + ebp*4]
mov ebx, dword [esp]
mov dword [ebx + edi*4], eax
movzx eax, word [esi + ebp*4 + 4]
shr eax, cl
movzx eax, al
mov edi, dword [esp + eax*4 + 0xb0]
lea ebx, [edi + 1]
mov dword [esp + eax*4 + 0xb0], ebx
mov ebx, esi
mov eax, dword [esi + ebp*4 + 4]
mov esi, dword [esp]
mov dword [esi + edi*4], eax
add ebp, 2
cmp dword [esp + 8], ebp
jne 0x408110
test byte [esp + 4], 1
je 0x408090
jmp 0x40817f
xor ebp, ebp
test byte [esp + 4], 1
je 0x408090
movzx eax, word [ebx + ebp*4]
shr eax, cl
movzx eax, al
mov edi, dword [esp + eax*4 + 0xb0]
mov esi, ebx
lea ebx, [edi + 1]
mov dword [esp + eax*4 + 0xb0], ebx
mov ebx, esi
mov eax, dword [esi + ebp*4]
mov esi, dword [esp]
mov dword [esi + edi*4], eax
jmp 0x408090
cmp dword [esp + 4], 0
mov ebp, dword [esp + 0x10]
je 0x4085e4
cmp dword [esp + 4], 1
jne 0x4081ce
mov eax, dword [esp]
mov word [eax], 1
jmp 0x40849d
mov esi, dword [esp]
movzx eax, word [esi + 4]
movzx ecx, word [esi]
mov edx, ecx
and edx, eax
xor ecx, eax
lea eax, [ecx + edx*2]
mov word [esi], ax
mov ecx, dword [esp + 4]
cmp ecx, 3
jl 0x408305
mov edx, ecx
mov eax, 2
mov ecx, 2
sub ecx, edx
mov dword [esp + 8], ecx
xor esi, esi
mov edx, 1
jmp 0x408233
movzx ebp, word [ecx + esi*4]
add word [ecx + edx*4], bp
mov word [ecx + esi*4], dx
inc esi
mov ebp, dword [esp + 0x10]
mov ecx, dword [esp + 8]
lea edi, [ecx + edx]
inc edi
inc edx
cmp edi, 1
je 0x40831e
mov ecx, dword [esp]
movzx ebx, word [ecx + esi*4]
cmp eax, dword [esp + 4]
jge 0x408249
movzx ebp, word [ecx + eax*4]
cmp bx, bp
jae 0x408270
mov word [ecx + edx*4], bx
mov edi, esi
mov word [ecx + esi*4], dx
and esi, 1
xor edi, 1
lea esi, [edi + esi*2]
cmp eax, dword [esp + 4]
jge 0x408210
jmp 0x40827b
inc eax
mov word [ecx + edx*4], bp
cmp eax, dword [esp + 4]
jge 0x408210
cmp esi, edx
jge 0x408290
movzx ebp, word [ecx + esi*4]
movzx ebx, word [ecx + eax*4]
cmp bp, bx
jb 0x408214
jmp 0x408294
movzx ebx, word [ecx + eax*4]
inc eax
add word [ecx + edx*4], bx
jmp 0x40821d
mov ecx, ebx
and ecx, 0xfffffffe
mov eax, dword [esp + 0xc]
lea edx, [eax + ebp]
add edx, 0x8194
xor edi, edi
xor eax, eax
jmp 0x4082cb
add eax, 2
cmp ecx, eax
je 0x407f41
movzx esi, word [edx + eax*2 - 2]
test si, si
je 0x4082e6
mov word [esp + edi*4 + 0x4b0], si
mov word [esp + edi*4 + 0x4b2], ax
inc edi
movzx esi, word [edx + eax*2]
test si, si
je 0x4082c0
mov word [esp + edi*4 + 0x4b0], si
lea esi, [eax + 1]
mov word [esp + edi*4 + 0x4b2], si
inc edi
jmp 0x4082c0
mov eax, ecx
xor eax, 0x3ffffffd
and ecx, 0x1ffffffd
lea eax, [eax + ecx*2]
mov word [esi + eax*4 + 4], 0
jmp 0x408399
mov edx, dword [esp + 4]
mov eax, edx
xor eax, 0x3ffffffd
mov ecx, edx
and ecx, 0x1ffffffd
lea eax, [eax + ecx*2]
mov ecx, dword [esp]
mov word [ecx + eax*4 + 4], 0
lea ecx, [edx - 3]
mov eax, ecx
test dl, 1
je 0x408366
mov edx, dword [esp + 4]
mov esi, dword [esp]
movzx eax, word [esi + edx*4 - 0xc]
movzx eax, word [esi + eax*4]
inc eax
mov word [esi + edx*4 - 0xc], ax
lea eax, [ecx + ecx]
sub eax, edx
add eax, 2
test ecx, ecx
mov esi, dword [esp]
je 0x408399
nop
nop
nop
movzx ecx, word [esi + eax*4]
movzx ecx, word [esi + ecx*4]
inc ecx
mov word [esi + eax*4], cx
mov ecx, eax
not ecx
lea ecx, [ecx + eax*2]
movzx edx, word [esi + ecx*4]
movzx edx, word [esi + edx*4]
inc edx
mov word [esi + ecx*4], dx
add ecx, ecx
sub ecx, eax
mov eax, ecx
jns 0x408370
mov eax, dword [esp + 4]
lea edx, [eax - 2]
xor ecx, ecx
mov esi, 1
mov eax, dword [esp + 0x20]
jmp 0x4083bc
lea esi, [ebx + ebx]
inc ecx
test ebx, ebx
jle 0x408492
test edx, edx
js 0x4083f0
lea ebx, [edx + 1]
xor ebp, ebp
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov edi, dword [esp]
movzx edi, word [edi + edx*4]
cmp ecx, edi
jne 0x408400
inc ebp
dec edx
cmp ebx, ebp
jne 0x4083d0
mov edx, 0xffffffff
jmp 0x408402
xor ebx, ebx
jmp 0x408406
mov ebx, ebp
mov ebp, dword [esp + 0x10]
mov edi, esi
sub edi, ebx
jle 0x4083b0
mov dword [esp + 8], edi
mov edi, ebx
not edi
add edi, esi
and dword [esp + 8], 3
je 0x40845c
mov dword [esp + 0x14], edi
mov dword [esp + 0x18], ebx
mov edi, dword [esp]
lea ebp, [edi + eax*4]
xor ebx, ebx
mov edi, dword [esp + 8]
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov word [ebp], cx
inc ebx
add ebp, 0xfffffffc
cmp edi, ebx
jne 0x408440
sub esi, ebx
sub eax, ebx
mov ebp, dword [esp + 0x10]
mov ebx, dword [esp + 0x18]
mov edi, dword [esp + 0x14]
cmp edi, 3
mov edi, dword [esp]
jb 0x4083b0
nop
nop
nop
nop
nop
nop
nop
nop
mov word [edi + eax*4], cx
mov word [edi + eax*4 - 4], cx
mov word [edi + eax*4 - 8], cx
mov word [edi + eax*4 - 0xc], cx
add eax, 0xfffffffc
add esi, 0xfffffffc
cmp esi, ebx
jg 0x408470
jmp 0x4083b0
cmp dword [esp + 4], 0
jle 0x4085e4
mov eax, dword [esp + 4]
and eax, 3
xor ecx, ecx
cmp dword [esp + 0x20], 3
mov edi, dword [esp]
jb 0x4084ea
mov edx, dword [esp + 4]
and edx, 0xfffffffc
xor ecx, ecx
nop
nop
nop
nop
nop
nop
nop
movzx esi, word [edi + ecx*4]
inc dword [esp + esi*4 + 0x2c]
movzx esi, word [edi + ecx*4 + 4]
inc dword [esp + esi*4 + 0x2c]
movzx esi, word [edi + ecx*4 + 8]
inc dword [esp + esi*4 + 0x2c]
movzx esi, word [edi + ecx*4 + 0xc]
inc dword [esp + esi*4 + 0x2c]
add ecx, 4
cmp edx, ecx
jne 0x4084c0
test eax, eax
je 0x40850d
mov edx, dword [esp]
lea ecx, [edx + ecx*4]
xor edx, edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx esi, word [ecx + edx*4]
inc dword [esp + esi*4 + 0x2c]
inc edx
cmp eax, edx
jne 0x408500
cmp dword [esp + 4], 2
jl 0x4085e4
mov edx, dword [esp + 0x15c8]
cmp edx, 0x20
jge 0x408590
mov eax, dword [esp + edx*4 + 0x2c]
mov esi, edx
neg edx
mov ecx, esi
and edx, 3
je 0x40854c
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
add eax, dword [esp + ecx*4 + 0x30]
inc ecx
mov dword [esp + esi*4 + 0x2c], eax
dec edx
jne 0x408540
lea edx, [esi - 0x1d]
cmp edx, 3
mov edx, esi
jb 0x408588
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
add eax, dword [esp + ecx*4 + 0x30]
mov dword [esp + edx*4 + 0x2c], eax
add eax, dword [esp + ecx*4 + 0x34]
mov dword [esp + edx*4 + 0x2c], eax
add eax, dword [esp + ecx*4 + 0x38]
mov dword [esp + edx*4 + 0x2c], eax
add eax, dword [esp + ecx*4 + 0x3c]
add ecx, 4
mov dword [esp + edx*4 + 0x2c], eax
cmp ecx, 0x20
jne 0x408560
test edx, edx
jle 0x40882d
mov esi, edx
not edx
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov dword [esp + 8], eax
mov ebx, dword [esp + esi*4 + 0x2c]
mov edi, esi
mov eax, dword [esp + 0x15c8]
xor edi, eax
mov ecx, edx
and ecx, eax
mov eax, dword [esp + 8]
add ecx, ecx
sub ecx, edi
shl ebx, cl
add eax, ebx
lea ecx, [esi - 1]
inc edx
cmp esi, 1
mov esi, ecx
ja 0x4085a0
mov edx, 1
mov ecx, dword [esp + 0x15c8]
shl edx, cl
cmp eax, edx
jne 0x408838
shl ebp, 5
mov esi, dword [esp + 0xc]
lea eax, [esi + ebp]
add eax, 0x8f12
push 0x120
push 0
push eax
call fcn.00408aa0
add esp, 0xc
mov eax, dword [esp + 0x24]
add eax, esi
add eax, 0x8852
push 0x240
push 0
push eax
call fcn.00408aa0
add esp, 0xc
cmp dword [esp + 0x15c8], 0
mov ebx, dword [esp + 0x15c4]
jle 0x4086d1
mov eax, 1
add ebp, dword [esp + 0xc]
jmp 0x40865d
mov edi, dword [esp + 4]
mov dword [esp + 4], edi
lea ecx, [eax + 1]
cmp eax, dword [esp + 0x15c8]
mov eax, ecx
mov ebx, dword [esp + 0x15c4]
je 0x4086d1
mov edx, dword [esp + eax*4 + 0x2c]
test edx, edx
jle 0x408640
test dl, 1
jne 0x408670
mov ecx, edx
jmp 0x40868f
mov esi, dword [esp + 4]
mov ecx, dword [esp]
movzx ecx, word [ecx + esi*4 - 2]
dec esi
mov dword [esp + 4], esi
mov byte [ecx + ebp + 0x8f12], al
mov ecx, edx
not ecx
lea ecx, [ecx + edx*2]
cmp edx, 1
mov edi, dword [esp + 4]
mov ebx, dword [esp]
je 0x408644
nop
nop
nop
nop
nop
movzx edx, word [ebx + edi*4 - 2]
mov byte [edx + ebp + 0x8f12], al
mov edx, ecx
not edx
lea edx, [edx + ecx*2]
movzx esi, word [ebx + edi*4 - 6]
add edi, 0xfffffffe
mov byte [esi + ebp + 0x8f12], al
add edx, edx
sub edx, ecx
mov ecx, edx
test edx, edx
jg 0x4086a0
jmp 0x408644
mov dword [esp + 0x934], 0
mov ecx, dword [esp + 0x15c8]
cmp ecx, 2
jl 0x40874c
lea eax, [ecx - 1]
cmp ecx, 2
jne 0x4086fd
mov edx, 2
xor ecx, ecx
test al, 1
jne 0x40873f
jmp 0x40874c
mov ebx, eax
and ebx, 0xfffffffe
xor ecx, ecx
xor edx, edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
add ecx, dword [esp + edx*4 + 0x30]
add ecx, ecx
mov dword [esp + edx*4 + 0x938], ecx
add ecx, dword [esp + edx*4 + 0x34]
add ecx, ecx
mov dword [esp + edx*4 + 0x93c], ecx
add edx, 2
cmp ebx, edx
jne 0x408710
add edx, 2
mov ebx, dword [esp + 0x15c4]
test al, 1
je 0x40874c
add ecx, dword [esp + edx*4 + 0x28]
add ecx, ecx
mov dword [esp + edx*4 + 0x930], ecx
test ebx, ebx
jle 0x408822
xor eax, eax
mov ecx, dword [esp + 0x1c]
lea esi, [ecx + ecx*8]
mov edx, esi
shl edx, 5
mov ecx, dword [esp + 0xc]
add edx, ecx
shl esi, 6
add esi, ecx
mov dword [esp], esi
jmp 0x40879b
mov ecx, dword [esp]
mov word [ecx + eax*2 + 0x8852], bx
mov ebx, dword [esp + 0x15c4]
inc eax
cmp eax, ebx
je 0x408822
movzx ecx, byte [eax + edx + 0x8f12]
test ecx, ecx
je 0x408792
mov ebp, dword [esp + ecx*4 + 0x930]
lea edi, [ebp + 1]
mov dword [esp + ecx*4 + 0x930], edi
mov edi, ecx
and edi, 3
xor ebx, ebx
cmp cl, 4
jb 0x4087ff
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 0x4087d0
test edi, edi
je 0x408780
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 0x408810
jmp 0x408780
add esp, 0x15b0
pop esi
pop edi
pop ebx
pop ebp
ret
mov ecx, edx
mov edx, 1
shl edx, cl
xor eax, eax
mov ecx, dword [esp + 0x15c8]
dec ecx
jmp 0x408859
dec eax
cmp eax, edx
je 0x4085e4
mov esi, dword [esp + 0x15c8]
dec dword [esp + esi*4 + 0x2c]
mov esi, ecx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
test esi, esi
jle 0x408850
mov ebx, dword [esp + esi*4 + 0x2c]
dec esi
test ebx, ebx
je 0x408870
dec ebx
mov dword [esp + esi*4 + 0x30], ebx
add dword [esp + esi*4 + 0x34], 2
jmp 0x408850