Function at 0x409000
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
mov eax, 0x15b0
call fcn.00409a20
mov edi, edx
mov dword [esp + 0x10], ecx
mov ebx, dword [esp + 0x15c8]
mov esi, dword [esp + 0x15c4]
lea eax, [esp + 0x2c]
push 0x84
push 0
push eax
call fcn.00409ad0
add esp, 0xc
cmp dword [esp + 0x15cc], 0
mov dword [esp + 0x18], edi
je 0x4090ce
test esi, esi
mov ecx, esi
jle 0x409806
xor eax, eax
cmp ecx, 1
je 0x409098
mov ecx, dword [esp + 0x15c4]
and ecx, 0x7ffffffe
mov eax, dword [esp + 0x18]
lea eax, [eax + eax*8]
shl eax, 5
mov edx, dword [esp + 0x10]
add edx, eax
add edx, 0x8f13
xor eax, eax
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 0x409080
mov ecx, dword [esp + 0x15c4]
test cl, 1
je 0x409806
mov ecx, dword [esp + 0x18]
lea ecx, [ecx + ecx*8]
shl ecx, 5
add ecx, dword [esp + 0x10]
movzx eax, byte [eax + ecx + 0x8f12]
mov ecx, dword [esp + 0x15c4]
inc dword [esp + eax*4 + 0x2c]
jmp 0x409806
lea eax, [edi + edi*8]
mov dword [esp + 0x14], eax
mov ebp, eax
shl ebp, 6
test esi, esi
jle 0x4091c9
cmp esi, 1
jne 0x4093e9
xor eax, eax
xor ebx, ebx
mov ecx, dword [esp + 0x15c4]
test cl, 1
je 0x409121
mov ecx, dword [esp + 0x10]
add ecx, ebp
add ecx, 0x8192
movzx ecx, word [ecx + eax*2]
test cx, cx
je 0x409121
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.00409ad0
add esp, 0xc
test ebx, ebx
sete byte [esp + 7]
je 0x4091e0
xor eax, eax
cmp ebx, 1
je 0x40919f
mov ecx, ebx
and ecx, 0xfffffffe
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
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 0x409160
test bl, 1
je 0x4091c0
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 0x4091e9
lea eax, [esp + 0x530]
push 0x800
push 0
push eax
call fcn.00409ad0
add esp, 0xc
xor ebx, ebx
mov byte [esp + 7], 1
xor eax, eax
mov dword [esp + 0x24], ebp
xor ecx, ecx
cmp eax, ebx
setne cl
inc ecx
mov dword [esp + 0x28], ecx
lea eax, [ebx - 1]
mov dword [esp + 0x1c], eax
mov dword [esp], ebx
mov edx, ebx
and edx, 0xfffffffe
lea eax, [esp + 0xb0]
mov dword [esp + 0xc], eax
lea eax, [esp + 0x1130]
xor ecx, ecx
xor esi, esi
mov dword [esp + 8], edx
jmp 0x409244
mov esi, dword [esp + 0x20]
inc esi
add ecx, 8
mov eax, edi
cmp esi, dword [esp + 0x28]
je 0x40932e
mov edi, dword [esp + 0xc]
mov dword [esp + 0xc], eax
mov dword [esp + 0x20], esi
mov eax, esi
shl eax, 0xa
add eax, esp
add eax, 0x530
xor ebp, ebp
xor edx, edx
mov dword [esp + edx*4 + 0xd30], ebp
mov ebx, edx
add ebp, dword [eax + edx*4]
xor edx, 1
and ebx, 1
lea ebx, [edx + ebx*2]
mov edx, ebx
cmp ebx, 0x100
jb 0x409260
cmp byte [esp + 7], 0
jne 0x409230
cmp dword [esp + 0x1c], 0
je 0x4092f9
xor eax, eax
mov esi, dword [esp + 0xc]
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx edx, word [edi + eax*4]
shr edx, cl
movzx edx, dl
mov ebx, dword [esp + edx*4 + 0xd30]
lea ebp, [ebx + 1]
mov dword [esp + edx*4 + 0xd30], ebp
mov edx, dword [edi + eax*4]
mov dword [esi + ebx*4], edx
movzx edx, word [edi + eax*4 + 4]
shr edx, cl
movzx edx, dl
mov ebx, dword [esp + edx*4 + 0xd30]
lea ebp, [ebx + 1]
mov dword [esp + edx*4 + 0xd30], ebp
mov edx, dword [edi + eax*4 + 4]
mov dword [esi + ebx*4], edx
mov edx, dword [esp + 8]
add eax, 2
cmp edx, eax
jne 0x4092a0
test byte [esp], 1
je 0x409230
jmp 0x409305
xor eax, eax
test byte [esp], 1
je 0x409230
movzx edx, word [edi + eax*4]
shr edx, cl
movzx edx, dl
mov ebx, dword [esp + edx*4 + 0xd30]
lea ebp, [ebx + 1]
mov dword [esp + edx*4 + 0xd30], ebp
mov eax, dword [edi + eax*4]
mov esi, dword [esp + 0xc]
mov dword [esi + ebx*4], eax
jmp 0x409230
cmp dword [esp], 0
mov ebx, dword [esp + 0x15c8]
mov ebp, dword [esp + 0x14]
mov esi, dword [esp + 0xc]
je 0x4096f2
mov edx, dword [esp]
cmp edx, 1
jne 0x409359
mov word [esi], 1
jmp 0x4095d3
movzx eax, word [esi + 4]
add word [esi], ax
cmp edx, 3
jl 0x409455
mov eax, 2
mov ecx, 2
sub ecx, edx
xor edx, edx
mov edi, 1
jmp 0x40939b
movzx ebx, word [esi + eax*4]
inc eax
add word [esi + edi*4], bx
mov ebp, dword [esp + 0x14]
lea ebx, [ecx + edi]
inc ebx
inc edi
cmp ebx, 1
je 0x409464
movzx ebx, word [esi + edx*4]
cmp eax, dword [esp]
jge 0x4093ad
movzx ebp, word [esi + eax*4]
cmp bx, bp
jae 0x4093d0
mov word [esi + edi*4], bx
mov word [esi + edx*4], di
inc edx
cmp eax, dword [esp]
jge 0x4093da
cmp edx, edi
jge 0x409380
movzx ebp, word [esi + edx*4]
movzx ebx, word [esi + eax*4]
cmp bp, bx
jae 0x409384
jmp 0x4093de
inc eax
mov word [esi + edi*4], bp
cmp eax, dword [esp]
jl 0x4093bb
movzx ebp, word [esi + edx*4]
add word [esi + edi*4], bp
mov word [esi + edx*4], di
inc edx
jmp 0x409389
mov ecx, esi
and ecx, 0x7ffffffe
mov eax, dword [esp + 0x10]
lea edx, [eax + ebp]
add edx, 0x8194
xor eax, eax
xor ebx, ebx
jmp 0x40941b
add eax, 2
cmp ecx, eax
je 0x4090ef
movzx esi, word [edx + eax*2 - 2]
test si, si
je 0x409436
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 0x409410
mov word [esp + ebx*4 + 0xb0], si
lea esi, [eax + 1]
mov word [esp + ebx*4 + 0xb2], si
inc ebx
jmp 0x409410
lea ecx, [edx - 2]
mov word [esi + edx*4 - 8], 0
jmp 0x4094e1
mov ebx, dword [esp]
mov word [esi + ebx*4 - 8], 0
lea edx, [ebx - 3]
mov ecx, ebx
and ecx, 3
xor ecx, 2
mov eax, edx
je 0x409491
mov eax, edx
nop
movzx edi, word [esi + eax*4]
movzx edi, word [esi + edi*4]
inc edi
mov word [esi + eax*4], di
dec eax
dec ecx
jne 0x409480
lea ecx, [ebx - 2]
cmp edx, 3
jb 0x4094e1
inc eax
nop
nop
nop
nop
nop
nop
movzx edx, word [esi + eax*4 - 4]
movzx edx, word [esi + edx*4]
inc edx
mov word [esi + eax*4 - 4], dx
movzx edx, word [esi + eax*4 - 8]
movzx edx, word [esi + edx*4]
inc edx
mov word [esi + eax*4 - 8], dx
movzx edx, word [esi + eax*4 - 0xc]
movzx edx, word [esi + edx*4]
inc edx
mov word [esi + eax*4 - 0xc], dx
movzx edx, word [esi + eax*4 - 0x10]
movzx edx, word [esi + edx*4]
inc edx
mov word [esi + eax*4 - 0x10], dx
add eax, 0xfffffffc
jne 0x4094a0
mov ebx, 1
xor eax, eax
mov edx, dword [esp + 0x1c]
jmp 0x4094fc
lea ebx, [edi + edi]
inc eax
test edi, edi
jle 0x4095c2
test ecx, ecx
mov dword [esp + 8], ebx
js 0x409530
lea edi, [ecx + 1]
xor ebx, ebx
nop
nop
nop
nop
nop
nop
nop
mov esi, edi
mov edi, dword [esp + 0xc]
movzx edi, word [edi + ecx*4]
cmp eax, edi
jne 0x409540
inc ebx
dec ecx
mov edi, esi
cmp esi, ebx
jne 0x409510
mov ecx, 0xffffffff
jmp 0x409542
xor edi, edi
sub ebx, edi
jle 0x4094f0
jmp 0x40954e
mov edi, ebx
mov esi, dword [esp + 0xc]
mov ebx, dword [esp + 8]
sub ebx, edi
jle 0x4094f0
and ebx, 3
je 0x40957d
mov dword [esp + 0x20], edi
lea edi, [esi + edx*4]
xor ebp, ebp
nop
nop
nop
nop
mov word [edi], ax
inc ebp
add edi, 0xfffffffc
cmp ebx, ebp
jne 0x409560
mov ebx, dword [esp + 8]
sub ebx, ebp
sub edx, ebp
mov ebp, dword [esp + 0x14]
mov edi, dword [esp + 0x20]
jmp 0x409581
mov ebx, dword [esp + 8]
mov esi, edi
sub edi, dword [esp + 8]
cmp edi, 0xfffffffc
mov edi, esi
mov esi, dword [esp + 0xc]
ja 0x4094f0
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov word [esi + edx*4], ax
mov word [esi + edx*4 - 4], ax
mov word [esi + edx*4 - 8], ax
mov word [esi + edx*4 - 0xc], ax
add edx, 0xfffffffc
add ebx, 0xfffffffc
cmp ebx, edi
jg 0x4095a0
jmp 0x4094f0
cmp dword [esp], 0
mov ebx, dword [esp + 0x15c8]
jle 0x4096f2
mov eax, dword [esp]
and eax, 3
xor ecx, ecx
cmp dword [esp + 0x1c], 3
jb 0x40961a
mov edx, dword [esp]
and edx, 0xfffffffc
xor ecx, ecx
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 0x4095f0
test eax, eax
je 0x40963d
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 0x409630
cmp dword [esp], 2
jl 0x4096f2
cmp ebx, 0x20
jge 0x4096ac
mov eax, dword [esp + ebx*4 + 0x2c]
mov edx, ebx
neg edx
mov ecx, ebx
and edx, 3
je 0x40966c
nop
nop
nop
nop
nop
add eax, dword [esp + ecx*4 + 0x30]
inc ecx
mov dword [esp + ebx*4 + 0x2c], eax
dec edx
jne 0x409660
lea edx, [ebx - 0x1d]
cmp edx, 3
jb 0x4096a8
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 0x409680
test ebx, ebx
jle 0x4096e2
lea edx, [ebx + 1]
xor ecx, ecx
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov edi, dword [esp + edx*4 + 0x28]
shl edi, cl
add eax, edi
dec edx
inc ecx
cmp edx, 1
ja 0x4096c0
mov edx, 1
mov ecx, ebx
shl edx, cl
cmp eax, edx
jne 0x40994d
jmp 0x4096f2
mov edx, 1
mov ecx, ebx
shl edx, cl
xor eax, eax
jmp 0x40994d
shl ebp, 5
mov edi, dword [esp + 0x10]
lea eax, [edi + ebp]
add eax, 0x8f12
push 0x120
push 0
push eax
call fcn.00409ad0
add esp, 0xc
mov eax, dword [esp + 0x24]
add eax, edi
add eax, 0x8852
push 0x240
push 0
push eax
call fcn.00409ad0
add esp, 0xc
test ebx, ebx
jle 0x4097ff
add esi, 0xfffffffe
mov eax, 1
add ebp, dword [esp + 0x10]
jmp 0x409763
mov edi, dword [esp]
mov dword [esp], edi
lea ecx, [eax + 1]
cmp eax, ebx
mov eax, ecx
je 0x4097ff
mov ecx, dword [esp + eax*4 + 0x2c]
test ecx, ecx
jle 0x409750
mov edx, ecx
and edx, 3
je 0x4097b0
mov dword [esp + 8], ecx
mov ecx, dword [esp]
lea ebx, [esi + ecx*4]
xor edi, edi
nop
nop
mov ecx, ebp
movzx ebp, word [ebx]
mov byte [ebp + ecx + 0x8f12], al
mov ebp, ecx
inc edi
add ebx, 0xfffffffc
cmp edx, edi
jne 0x409780
sub dword [esp], edi
mov ecx, dword [esp + 8]
mov edx, ecx
sub edx, edi
mov ebx, dword [esp + 0x15c8]
jmp 0x4097b2
mov edx, ecx
cmp ecx, 4
mov edi, dword [esp]
jb 0x409753
dec edx
nop
nop
nop
nop
nop
movzx ecx, word [esi + edi*4]
mov byte [ecx + ebp + 0x8f12], al
movzx ecx, word [esi + edi*4 - 4]
mov byte [ecx + ebp + 0x8f12], al
movzx ecx, word [esi + edi*4 - 8]
mov byte [ecx + ebp + 0x8f12], al
movzx ecx, word [esi + edi*4 - 0xc]
add edi, 0xfffffffc
mov byte [ecx + ebp + 0x8f12], al
add edx, 0xfffffffc
cmp edx, 0xfffffffe
jb 0x4097c0
jmp 0x409753
mov ecx, dword [esp + 0x15c4]
mov dword [esp + 0x534], 0
cmp ebx, 2
jl 0x40986d
lea ecx, [ebx - 1]
cmp ebx, 2
jne 0x409827
xor eax, eax
mov edx, 2
jmp 0x409854
mov ebx, ecx
and ebx, 0xfffffffe
xor eax, eax
xor edx, edx
add eax, dword [esp + edx*4 + 0x30]
add eax, eax
mov dword [esp + edx*4 + 0x538], eax
add eax, dword [esp + edx*4 + 0x34]
add eax, eax
mov dword [esp + edx*4 + 0x53c], eax
add edx, 2
cmp ebx, edx
jne 0x409830
add edx, 2
test cl, 1
mov ecx, dword [esp + 0x15c4]
je 0x40986d
add eax, dword [esp + edx*4 + 0x28]
add eax, eax
mov dword [esp + edx*4 + 0x530], eax
test ecx, ecx
jle 0x409942
xor eax, eax
mov edx, dword [esp + 0x18]
lea edi, [edx + edx*8]
mov edx, edi
shl edx, 5
mov esi, dword [esp + 0x10]
add edx, esi
shl edi, 6
add edi, esi
mov dword [esp + 8], edi
jmp 0x4098bc
mov ecx, dword [esp + 8]
mov word [ecx + eax*2 + 0x8852], di
mov ecx, dword [esp + 0x15c4]
inc eax
cmp eax, ecx
je 0x409942
movzx ebx, byte [eax + edx + 0x8f12]
test ebx, ebx
je 0x4098b3
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 0x40991f
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 0x4098f0
and ebx, 3
je 0x4098a0
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 0x409930
jmp 0x4098a0
add esp, 0x15b0
pop esi
pop edi
pop ebx
pop ebp
ret
dec dword [esp + ebx*4 + 0x2c]
mov ecx, ebx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
cmp ecx, 2
jl 0x40998d
mov edi, dword [esp + ecx*4 + 0x28]
dec ecx
test edi, edi
je 0x409960
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
dec eax
cmp eax, edx
jne 0x40994d
jmp 0x4096f2