Function at 0x408770
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
mov eax, 0x15bc
call fcn.00409200
mov esi, edx
mov ebp, ecx
mov ebx, dword [esp + 0x15d0]
lea eax, [esp + 0x38]
push 0x84
push 0
push eax
call fcn.004093e0
add esp, 0xc
cmp dword [esp + 0x15d8], 0
mov dword [esp + 0x2c], esi
je 0x4087f0
test ebx, ebx
jle 0x40906c
xor eax, eax
mov ecx, dword [esp + 0x2c]
lea ecx, [ecx + ecx*8]
shl ecx, 5
add ecx, ebp
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx edx, byte [eax + ecx + 0x8f12]
inc dword [esp + edx*4 + 0x38]
mov edx, eax
and edx, 1
xor eax, 1
lea eax, [eax + edx*2]
cmp eax, ebx
jl 0x4087d0
jmp 0x40906c
lea eax, [esi + esi*8]
mov edi, eax
shl eax, 6
test ebx, ebx
mov dword [esp + 0x14], ebp
mov dword [esp + 0x28], eax
jle 0x4088e9
cmp ebx, 1
jne 0x408b5e
xor ebx, ebx
xor eax, eax
mov ecx, dword [esp + 0x15d0]
test cl, 1
je 0x408847
mov ecx, dword [esp + 0x28]
add ecx, ebp
add ecx, 0x8192
movzx ecx, word [ecx + eax*2]
test cx, cx
je 0x408847
mov word [esp + ebx*4 + 0x4bc], cx
mov word [esp + ebx*4 + 0x4be], ax
inc ebx
lea eax, [esp + 0x93c]
push 0x800
push 0
push eax
call fcn.004093e0
add esp, 0xc
test ebx, ebx
sete byte [esp + 0x10]
je 0x408900
mov ecx, ebx
xor eax, eax
cmp ebx, 1
je 0x4088bf
mov ecx, ebx
and ecx, 0xfffffffe
xor eax, eax
nop
nop
nop
nop
nop
movzx edx, word [esp + eax*4 + 0x4bc]
movzx esi, dl
inc dword [esp + esi*4 + 0x93c]
shr edx, 8
inc dword [esp + edx*4 + 0xd3c]
movzx edx, word [esp + eax*4 + 0x4c0]
movzx esi, dl
inc dword [esp + esi*4 + 0x93c]
shr edx, 8
inc dword [esp + edx*4 + 0xd3c]
add eax, 2
cmp ecx, eax
jne 0x408880
test bl, 1
je 0x4088e0
movzx eax, word [esp + eax*4 + 0x4bc]
movzx ecx, al
inc dword [esp + ecx*4 + 0x93c]
shr eax, 8
inc dword [esp + eax*4 + 0xd3c]
mov eax, dword [esp + 0xd3c]
jmp 0x408909
lea eax, [esp + 0x93c]
push 0x800
push 0
push eax
call fcn.004093e0
add esp, 0xc
xor ebx, ebx
mov byte [esp + 0x10], 1
xor eax, eax
xor ecx, ecx
cmp eax, ebx
sete cl
mov ebp, 2
sub ebp, ecx
lea eax, [ebx - 1]
mov dword [esp + 0x1c], eax
mov dword [esp + 4], ebx
and ebx, 0xfffffffe
mov dword [esp + 0x18], ebx
lea eax, [esp + 0x4bc]
mov dword [esp], eax
lea eax, [esp + 0x113c]
xor ecx, ecx
lea esi, [esp + 0x93c]
xor ebx, ebx
mov dword [esp + 0x24], edi
mov dword [esp + 0x20], ebp
jmp 0x408966
inc ebx
add ecx, 8
add esi, 0x400
mov eax, dword [esp + 8]
cmp ebx, ebp
je 0x408a76
mov edx, dword [esp]
mov dword [esp + 8], edx
mov dword [esp], eax
mov eax, 3
xor edx, edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov dword [esp + eax*4 + 0xb0], edx
add edx, dword [esi + eax*4 - 0xc]
mov dword [esp + eax*4 + 0xb4], edx
add edx, dword [esi + eax*4 - 8]
mov dword [esp + eax*4 + 0xb8], edx
add edx, dword [esi + eax*4 - 4]
mov dword [esp + eax*4 + 0xbc], edx
add edx, dword [esi + eax*4]
add eax, 4
cmp eax, 0x103
jne 0x408980
cmp byte [esp + 0x10], 0
jne 0x408950
mov dword [esp + 0xc], ebx
cmp dword [esp + 0x1c], 0
je 0x408a2b
xor eax, eax
mov ebp, dword [esp]
mov ebx, dword [esp + 8]
movzx edx, word [ebx + eax*4]
shr edx, cl
movzx edx, dl
mov ebx, dword [esp + edx*4 + 0xbc]
lea edi, [ebx + 1]
mov dword [esp + edx*4 + 0xbc], edi
mov edx, dword [esp + 8]
mov edx, dword [edx + eax*4]
mov dword [ebp + ebx*4], edx
mov edx, dword [esp + 8]
movzx edx, word [edx + eax*4 + 4]
shr edx, cl
movzx edx, dl
mov edi, dword [esp + edx*4 + 0xbc]
lea ebx, [edi + 1]
mov dword [esp + edx*4 + 0xbc], ebx
mov ebx, dword [esp + 8]
mov edx, dword [ebx + eax*4 + 4]
mov dword [ebp + edi*4], edx
add eax, 2
cmp dword [esp + 0x18], eax
jne 0x4089d0
jmp 0x408a2d
xor eax, eax
test byte [esp + 4], 1
mov ebp, dword [esp + 0x20]
mov ebx, dword [esp + 0xc]
je 0x408950
mov ebp, dword [esp + 8]
movzx edx, word [ebp + eax*4]
shr edx, cl
movzx edx, dl
mov edi, dword [esp + edx*4 + 0xbc]
lea ebx, [edi + 1]
mov dword [esp + edx*4 + 0xbc], ebx
mov ebx, dword [esp + 0xc]
mov eax, dword [ebp + eax*4]
mov ebp, dword [esp + 0x20]
mov edx, dword [esp]
mov dword [edx + edi*4], eax
jmp 0x408950
cmp dword [esp + 4], 0
mov ebp, dword [esp + 0x14]
je 0x408f47
mov esi, dword [esp + 4]
cmp esi, 1
jne 0x408a9b
mov eax, dword [esp]
mov word [eax], 1
jmp 0x408e05
mov ecx, dword [esp]
movzx eax, word [ecx + 4]
add word [ecx], ax
cmp dword [esp + 0x1c], 2
jl 0x408bc5
mov eax, 2
mov ecx, 2
sub ecx, esi
mov edx, 1
xor esi, esi
jmp 0x408af2
mov edi, dword [esp]
movzx ebp, word [edi + esi*4]
add word [edi + edx*4], bp
mov word [edi + esi*4], dx
inc esi
mov ebp, dword [esp + 0x14]
lea edi, [ecx + edx]
inc edi
inc edx
cmp edi, 1
je 0x408bd6
mov edi, dword [esp]
movzx ebx, word [edi + esi*4]
cmp eax, dword [esp + 4]
jge 0x408b08
movzx ebp, word [edi + eax*4]
cmp bx, bp
jae 0x408b20
mov word [edi + edx*4], bx
mov word [edi + esi*4], dx
inc esi
cmp eax, dword [esp + 4]
jge 0x408ad0
jmp 0x408b2b
inc eax
mov word [edi + edx*4], bp
cmp eax, dword [esp + 4]
jge 0x408ad0
cmp esi, edx
jge 0x408b50
mov edi, dword [esp]
movzx ebp, word [edi + esi*4]
movzx ebx, word [edi + eax*4]
cmp bp, bx
jb 0x408ad7
jmp 0x408b57
mov edi, dword [esp]
movzx ebx, word [edi + eax*4]
inc eax
add word [edi + edx*4], bx
jmp 0x408ae0
mov ecx, ebx
and ecx, 0xfffffffe
lea edx, [eax + ebp]
add edx, 0x8194
xor ebx, ebx
xor eax, eax
jmp 0x408b8b
add eax, 2
cmp ecx, eax
je 0x408815
movzx esi, word [edx + eax*2 - 2]
test si, si
je 0x408ba6
mov word [esp + ebx*4 + 0x4bc], si
mov word [esp + ebx*4 + 0x4be], ax
inc ebx
movzx esi, word [edx + eax*2]
test si, si
je 0x408b80
mov word [esp + ebx*4 + 0x4bc], si
lea esi, [eax + 1]
mov word [esp + ebx*4 + 0x4be], si
inc ebx
jmp 0x408b80
mov eax, ecx
lea edx, [esi - 2]
mov word [ecx + esi*4 - 8], 0
jmp 0x408c75
mov ecx, dword [esp + 4]
lea edx, [ecx - 2]
mov eax, dword [esp]
mov word [eax + ecx*4 - 8], 0
cmp ecx, 3
jl 0x408c75
mov ebx, edx
mov edi, eax
mov eax, ecx
lea edx, [ecx - 3]
lea esi, [ecx + 2]
mov eax, edx
and esi, 3
je 0x408c21
mov eax, edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx ecx, word [edi + eax*4]
movzx ecx, word [edi + ecx*4]
inc ecx
mov word [edi + eax*4], cx
dec eax
dec esi
jne 0x408c10
cmp edx, 3
jae 0x408c2b
mov eax, dword [esp]
jmp 0x408c73
inc eax
mov esi, dword [esp]
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 0x408c30
mov eax, esi
mov edx, ebx
lea ecx, [eax - 0xc]
mov dword [esp + 0x20], ecx
mov edi, 1
xor ecx, ecx
mov esi, dword [esp + 0x1c]
mov dword [esp + 0xc], esi
jmp 0x408c9e
mov esi, ebx
lea edi, [esi + esi]
inc ecx
test esi, esi
jle 0x408dfa
test edx, edx
mov dword [esp + 8], ecx
js 0x408cd0
lea ebx, [edx + 1]
xor esi, esi
nop
nop
nop
nop
nop
movzx ecx, word [eax + edx*4]
cmp dword [esp + 8], ecx
mov ecx, dword [esp + 8]
jne 0x408ce0
inc esi
dec edx
cmp ebx, esi
jne 0x408cb0
mov edx, 0xffffffff
jmp 0x408ce2
xor ebx, ebx
jmp 0x408ce2
mov ebx, esi
mov esi, edi
sub esi, ebx
jle 0x408c90
mov dword [esp + 0x10], ebx
not ebx
add ebx, edi
and esi, 3
mov dword [esp + 0x30], edi
je 0x408d3b
mov dword [esp + 0x18], ebx
mov ebx, dword [esp + 0xc]
add ebx, ebx
xor ebp, ebp
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov word [eax + ebx*2], cx
inc ebp
add ebx, 0xfffffffe
cmp esi, ebp
jne 0x408d10
sub dword [esp + 0xc], ebp
sub dword [esp + 0x30], ebp
mov ebp, dword [esp + 0x14]
mov esi, dword [esp + 0x10]
mov ebx, dword [esp + 0x18]
cmp ebx, 3
jb 0x408c92
jmp 0x408d48
mov esi, dword [esp + 0x10]
cmp ebx, 3
jb 0x408c92
mov dword [esp + 0x34], edx
mov edx, dword [esp + 0xc]
lea ebx, [edx*4 + 0xc]
lea esi, [edx*8 - 6]
mov dword [esp + 0x18], esi
mov esi, edx
mov edx, dword [esp + 0x30]
nop
nop
nop
nop
nop
nop
nop
nop
mov ebp, esi
mov eax, dword [esp]
mov word [eax + esi*4], cx
lea ecx, [esi + esi]
lea edi, [esi*4]
mov eax, dword [esp + 0x20]
sub eax, edi
mov esi, dword [esp + 8]
mov word [eax + ebx*2 - 0x10], si
lea eax, [edi + edi*2]
mov edi, dword [esp]
sub edi, eax
lea eax, [ecx + ecx*2]
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x18]
mov esi, eax
sub esi, dword [esp + 0xc]
sub ecx, ebx
add ecx, ebp
add esi, ecx
add esi, 0xe
mov ecx, dword [esp + 8]
mov word [edi + ebx*4 - 0x38], cx
mov word [edi + ebx*4 - 0x3c], cx
add edx, 0xfffffffc
add ebx, 0xfffffff0
add eax, 0xffffffe0
mov dword [esp + 0x18], eax
mov eax, dword [esp + 0x10]
cmp edx, eax
jg 0x408d70
mov edi, eax
lea eax, [ebp*2]
add eax, ebp
sub ebx, eax
mov dword [esp + 0xc], ebx
mov ebp, dword [esp + 0x14]
mov eax, dword [esp]
mov edx, dword [esp + 0x34]
mov esi, edi
jmp 0x408c92
cmp dword [esp + 4], 0
jle 0x408f47
mov eax, dword [esp + 4]
and eax, 3
xor ecx, ecx
cmp dword [esp + 0x1c], 3
mov edi, dword [esp]
jb 0x408e5a
mov edx, dword [esp + 4]
and edx, 0xfffffffc
xor ecx, ecx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx esi, word [edi + ecx*4]
inc dword [esp + esi*4 + 0x38]
movzx esi, word [edi + ecx*4 + 4]
inc dword [esp + esi*4 + 0x38]
movzx esi, word [edi + ecx*4 + 8]
inc dword [esp + esi*4 + 0x38]
movzx esi, word [edi + ecx*4 + 0xc]
inc dword [esp + esi*4 + 0x38]
add ecx, 4
cmp edx, ecx
jne 0x408e30
test eax, eax
je 0x408e7d
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 + 0x38]
inc edx
cmp eax, edx
jne 0x408e70
cmp dword [esp + 4], 2
jl 0x408f47
mov edx, dword [esp + 0x15d4]
cmp edx, 0x20
jge 0x408efc
mov eax, dword [esp + edx*4 + 0x38]
mov esi, edx
neg edx
mov ecx, esi
and edx, 3
je 0x408ebc
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
add eax, dword [esp + ecx*4 + 0x3c]
inc ecx
mov dword [esp + esi*4 + 0x38], eax
dec edx
jne 0x408eb0
lea edx, [esi - 0x1d]
cmp edx, 3
mov edx, esi
jb 0x408ef8
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
add eax, dword [esp + ecx*4 + 0x3c]
mov dword [esp + edx*4 + 0x38], eax
add eax, dword [esp + ecx*4 + 0x40]
mov dword [esp + edx*4 + 0x38], eax
add eax, dword [esp + ecx*4 + 0x44]
mov dword [esp + edx*4 + 0x38], eax
add eax, dword [esp + ecx*4 + 0x48]
add ecx, 4
mov dword [esp + edx*4 + 0x38], eax
cmp ecx, 0x20
jne 0x408ed0
test edx, edx
jle 0x408f37
inc edx
xor ecx, ecx
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov esi, dword [esp + edx*4 + 0x34]
shl esi, cl
add eax, esi
dec edx
inc ecx
cmp edx, 1
ja 0x408f10
mov edx, 1
mov ecx, dword [esp + 0x15d4]
shl edx, cl
cmp eax, edx
jne 0x4091bd
jmp 0x408f47
mov ecx, edx
mov edx, 1
shl edx, cl
xor eax, eax
jmp 0x4091bd
mov eax, dword [esp + 0x24]
shl eax, 5
mov dword [esp + 0x24], eax
add eax, ebp
add eax, 0x8f12
push 0x120
push 0
push eax
call fcn.004093e0
add esp, 0xc
mov eax, dword [esp + 0x28]
add eax, ebp
add eax, 0x8852
push 0x240
push 0
push eax
call fcn.004093e0
add esp, 0xc
cmp dword [esp + 0x15d4], 0
jle 0x409065
add dword [esp], 0xfffffffe
mov eax, 1
jmp 0x408fba
mov ebx, dword [esp + 4]
mov dword [esp + 4], ebx
lea ecx, [eax + 1]
cmp eax, dword [esp + 0x15d4]
mov eax, ecx
je 0x409065
mov edi, dword [esp + eax*4 + 0x38]
test edi, edi
jle 0x408fa0
mov edx, edi
and edx, 3
je 0x409010
mov dword [esp + 8], edi
mov ecx, dword [esp + 4]
mov esi, dword [esp]
lea ebx, [esi + ecx*4]
xor esi, esi
mov ecx, dword [esp + 0x24]
nop
nop
nop
movzx edi, word [ebx]
mov ebp, dword [esp + 0x14]
add ebp, ecx
mov byte [edi + ebp + 0x8f12], al
mov ebp, dword [esp + 0x14]
inc esi
add ebx, 0xfffffffc
cmp edx, esi
jne 0x408fe0
sub dword [esp + 4], esi
mov edi, dword [esp + 8]
mov edx, edi
sub edx, esi
jmp 0x409012
mov edx, edi
cmp edi, 4
mov ebx, dword [esp + 4]
mov edi, dword [esp]
jb 0x408fa4
dec edx
nop
movzx ecx, word [edi + ebx*4]
mov esi, dword [esp + 0x24]
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 0x409020
jmp 0x408fa4
mov ebx, dword [esp + 0x15d0]
mov dword [esp + 0x940], 0
mov ecx, dword [esp + 0x15d4]
cmp ecx, 2
jl 0x4090ec
lea eax, [ecx - 1]
cmp ecx, 2
jne 0x409098
mov edx, 2
xor ecx, ecx
test al, 1
jne 0x4090df
jmp 0x4090ec
mov ebx, eax
and ebx, 0xfffffffe
xor ecx, ecx
xor edx, edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
add ecx, dword [esp + edx*4 + 0x3c]
add ecx, ecx
mov dword [esp + edx*4 + 0x944], ecx
add ecx, dword [esp + edx*4 + 0x40]
add ecx, ecx
mov dword [esp + edx*4 + 0x948], ecx
add edx, 2
cmp ebx, edx
jne 0x4090b0
add edx, 2
mov ebx, dword [esp + 0x15d0]
test al, 1
je 0x4090ec
add ecx, dword [esp + edx*4 + 0x34]
add ecx, ecx
mov dword [esp + edx*4 + 0x93c], ecx
test ebx, ebx
jle 0x4091b2
xor eax, eax
mov ecx, dword [esp + 0x2c]
lea ecx, [ecx + ecx*8]
mov edx, ecx
shl edx, 5
add edx, ebp
shl ecx, 6
add ecx, ebp
mov dword [esp + 8], ecx
jmp 0x40912c
mov ecx, dword [esp + 8]
mov word [ecx + eax*2 + 0x8852], bx
mov ebx, dword [esp + 0x15d0]
inc eax
cmp eax, ebx
je 0x4091b2
movzx ecx, byte [eax + edx + 0x8f12]
test ecx, ecx
je 0x409123
mov ebp, dword [esp + ecx*4 + 0x93c]
lea edi, [ebp + 1]
mov dword [esp + ecx*4 + 0x93c], edi
mov edi, ecx
and edi, 3
xor ebx, ebx
cmp cl, 4
jb 0x40918f
and ecx, 0xfffffffc
xor ebx, ebx
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 0x409160
test edi, edi
je 0x409110
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 0x4091a0
jmp 0x409110
add esp, 0x15bc
pop esi
pop edi
pop ebx
pop ebp
ret
mov ecx, dword [esp + 0x15d4]
dec dword [esp + ecx*4 + 0x38]
nop
nop
nop
nop
nop
nop
nop
nop
cmp ecx, 2
jl 0x4091e8
mov esi, dword [esp + ecx*4 + 0x34]
dec ecx
test esi, esi
je 0x4091d0
dec esi
mov dword [esp + ecx*4 + 0x38], esi
add dword [esp + ecx*4 + 0x3c], 2
dec eax
cmp eax, edx
jne 0x4091bd
jmp 0x408f47