Function at 0x317b60
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
mov eax, 0x15ac
call fcn.00318500
mov ebx, edx
mov dword [esp + 0xc], ecx
mov esi, dword [esp + 0x15c0]
lea eax, [esp + 0x28]
push 0x84
push 0
push eax
call fcn.003186a0
add esp, 0xc
cmp dword [esp + 0x15c8], 0
mov dword [esp + 0x14], ebx
je 0x317c27
test esi, esi
mov ebx, dword [esp + 0x15c4]
jle 0x318104
xor eax, eax
cmp esi, 1
je 0x317bf8
mov ecx, dword [esp + 0x15c0]
and ecx, 0x7ffffffe
mov eax, dword [esp + 0x14]
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
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 0x317be0
mov ecx, dword [esp + 0x15c0]
test cl, 1
je 0x318104
mov ecx, dword [esp + 0x14]
lea ecx, [ecx + ecx*8]
shl ecx, 5
add ecx, dword [esp + 0xc]
movzx eax, byte [eax + ecx + 0x8f12]
inc dword [esp + eax*4 + 0x28]
jmp 0x318104
lea eax, [ebx + ebx*8]
mov dword [esp + 0x1c], eax
shl eax, 6
mov dword [esp + 0x10], eax
test esi, esi
jle 0x317cef
cmp esi, 1
jne 0x317d18
xor eax, eax
xor ebp, ebp
mov ebx, dword [esp + 0x15c4]
mov ecx, dword [esp + 0x15c0]
test cl, 1
je 0x317c87
mov ecx, dword [esp + 0x10]
mov edx, dword [esp + 0xc]
add ecx, edx
add ecx, 0x8192
movzx ecx, word [ecx + eax*2]
test cx, cx
je 0x317c87
mov word [esp + ebp*4 + 0x4ac], cx
mov word [esp + ebp*4 + 0x4ae], ax
inc ebp
lea eax, [esp + 0x92c]
push 0x800
push 0
push eax
call fcn.003186a0
add esp, 0xc
test ebp, ebp
sete byte [esp + 3]
je 0x317d85
xor eax, eax
nop
nop
nop
movzx ecx, word [esp + eax*4 + 0x4ac]
movzx edx, cl
mov esi, dword [esp + edx*4 + 0x92c]
mov edi, esi
and edi, 1
xor esi, 1
lea esi, [esi + edi*2]
mov dword [esp + edx*4 + 0x92c], esi
shr ecx, 8
inc dword [esp + ecx*4 + 0xd2c]
inc eax
cmp ebp, eax
jne 0x317cb0
mov eax, dword [esp + 0xd2c]
jmp 0x317d8e
lea eax, [esp + 0x92c]
push 0x800
push 0
push eax
call fcn.003186a0
add esp, 0xc
xor ebp, ebp
mov byte [esp + 3], 1
xor eax, eax
mov ebx, dword [esp + 0x15c4]
jmp 0x317d8e
mov ecx, esi
and ecx, 0x7ffffffe
mov eax, dword [esp + 0x10]
mov edx, dword [esp + 0xc]
add edx, eax
add edx, 0x8194
xor eax, eax
xor ebp, ebp
mov ebx, dword [esp + 0x15c4]
jmp 0x317d4b
add eax, 2
cmp ecx, eax
je 0x317c51
movzx esi, word [edx + eax*2 - 2]
test si, si
je 0x317d66
mov word [esp + ebp*4 + 0x4ac], si
mov word [esp + ebp*4 + 0x4ae], ax
inc ebp
movzx esi, word [edx + eax*2]
test si, si
je 0x317d40
mov word [esp + ebp*4 + 0x4ac], si
lea esi, [eax + 1]
mov word [esp + ebp*4 + 0x4ae], si
inc ebp
jmp 0x317d40
xor ebp, ebp
mov byte [esp + 3], 1
xor eax, eax
xor ecx, ecx
cmp eax, ebp
setne cl
inc ecx
mov dword [esp + 0x20], ecx
mov dword [esp + 4], ebp
and ebp, 0xfffffffe
mov dword [esp + 0x24], ebp
lea edi, [esp + 0x4ac]
lea eax, [esp + 0x112c]
xor ecx, ecx
lea esi, [esp + 0x92c]
xor edx, edx
jmp 0x317ddc
inc eax
add ecx, 8
add esi, 0x400
mov edx, eax
mov eax, ebp
cmp edx, dword [esp + 0x20]
mov edi, dword [esp + 8]
je 0x317ee9
mov dword [esp + 0x18], edx
mov ebp, edi
mov dword [esp + 8], eax
mov edx, 3
xor eax, eax
nop
nop
nop
mov dword [esp + edx*4 + 0xa0], eax
add eax, dword [esi + edx*4 - 0xc]
mov dword [esp + edx*4 + 0xa4], eax
add eax, dword [esi + edx*4 - 8]
mov dword [esp + edx*4 + 0xa8], eax
add eax, dword [esi + edx*4 - 4]
mov dword [esp + edx*4 + 0xac], eax
add eax, dword [esi + edx*4]
add edx, 4
cmp edx, 0x103
jne 0x317df0
cmp byte [esp + 3], 0
mov eax, dword [esp + 0x18]
jne 0x317dc0
xor edx, edx
cmp dword [esp + 4], 1
je 0x317e9a
xor edx, edx
nop
nop
nop
nop
movzx eax, word [ebp + edx*4]
shr eax, cl
movzx eax, al
mov edi, ebp
mov ebp, dword [esp + eax*4 + 0xac]
lea ebx, [ebp + 1]
mov dword [esp + eax*4 + 0xac], ebx
mov eax, dword [edi + edx*4]
mov ebx, dword [esp + 8]
mov dword [ebx + ebp*4], eax
movzx eax, word [edi + edx*4 + 4]
shr eax, cl
movzx eax, al
mov ebx, dword [esp + eax*4 + 0xac]
lea ebp, [ebx + 1]
mov dword [esp + eax*4 + 0xac], ebp
mov ebp, edi
mov eax, dword [edi + edx*4 + 4]
mov edi, dword [esp + 8]
mov dword [edi + ebx*4], eax
mov edi, dword [esp + 0x24]
add edx, 2
cmp edi, edx
jne 0x317e40
test byte [esp + 4], 1
mov ebx, dword [esp + 0x15c4]
mov eax, dword [esp + 0x18]
je 0x317dc0
movzx eax, word [ebp + edx*4]
shr eax, cl
movzx eax, al
mov ebx, dword [esp + eax*4 + 0xac]
mov edi, ebp
lea ebp, [ebx + 1]
mov dword [esp + eax*4 + 0xac], ebp
mov ebp, edi
mov eax, dword [edi + edx*4]
mov edx, dword [esp + 8]
mov dword [edx + ebx*4], eax
mov eax, dword [esp + 0x18]
mov ebx, dword [esp + 0x15c4]
jmp 0x317dc0
mov esi, dword [esp + 4]
push esi
push edi
call fcn.00318270
add esp, 8
test esi, esi
jle 0x318022
mov edx, dword [esp + 4]
mov eax, edx
and eax, 3
xor ecx, ecx
cmp edx, 4
mov ebp, dword [esp + 8]
jb 0x317f4b
mov edx, dword [esp + 4]
and edx, 0x7ffffffc
xor ecx, ecx
nop
movzx esi, word [ebp + ecx*4]
inc dword [esp + esi*4 + 0x28]
movzx esi, word [ebp + ecx*4 + 4]
inc dword [esp + esi*4 + 0x28]
movzx esi, word [ebp + ecx*4 + 8]
inc dword [esp + esi*4 + 0x28]
movzx esi, word [ebp + ecx*4 + 0xc]
inc dword [esp + esi*4 + 0x28]
add ecx, 4
cmp edx, ecx
jne 0x317f20
test eax, eax
je 0x317f6d
mov edx, dword [esp + 8]
lea ecx, [edx + ecx*4]
xor edx, edx
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 0x317f60
cmp dword [esp + 4], 1
je 0x318022
cmp ebx, 0x20
jge 0x317fdc
mov eax, dword [esp + ebx*4 + 0x28]
mov edx, ebx
neg edx
mov ecx, ebx
and edx, 3
je 0x317f9c
nop
nop
nop
nop
add eax, dword [esp + ecx*4 + 0x2c]
inc ecx
mov dword [esp + ebx*4 + 0x28], eax
dec edx
jne 0x317f90
lea edx, [ebx - 0x1d]
cmp edx, 3
jb 0x317fd8
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
add eax, dword [esp + ecx*4 + 0x2c]
mov dword [esp + ebx*4 + 0x28], eax
add eax, dword [esp + ecx*4 + 0x30]
mov dword [esp + ebx*4 + 0x28], eax
add eax, dword [esp + ecx*4 + 0x34]
mov dword [esp + ebx*4 + 0x28], eax
add eax, dword [esp + ecx*4 + 0x38]
add ecx, 4
mov dword [esp + ebx*4 + 0x28], eax
cmp ecx, 0x20
jne 0x317fb0
test ebx, ebx
jle 0x318012
lea edx, [ebx + 1]
xor ecx, ecx
xor eax, eax
nop
nop
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 0x317ff0
mov edx, 1
mov ecx, ebx
shl edx, cl
cmp eax, edx
jne 0x31822d
jmp 0x318022
mov edx, 1
mov ecx, ebx
shl edx, cl
xor eax, eax
jmp 0x31822d
mov esi, dword [esp + 0x1c]
shl esi, 5
mov edi, dword [esp + 0xc]
lea eax, [edi + esi]
add eax, 0x8f12
push 0x120
push 0
push eax
call fcn.003186a0
add esp, 0xc
mov eax, dword [esp + 0x10]
add eax, edi
add eax, 0x8852
push 0x240
push 0
push eax
call fcn.003186a0
add esp, 0xc
test ebx, ebx
jle 0x318104
mov eax, 1
add esi, dword [esp + 0xc]
mov edi, dword [esp + 8]
jmp 0x318091
mov ebp, dword [esp + 4]
mov dword [esp + 4], ebp
lea ecx, [eax + 1]
cmp eax, ebx
mov eax, ecx
je 0x318104
mov edx, dword [esp + eax*4 + 0x28]
test edx, edx
jle 0x318080
test dl, 1
jne 0x3180b0
mov ecx, edx
jmp 0x3180d0
mov ebp, dword [esp + 4]
mov ecx, dword [esp + 8]
movzx ecx, word [ecx + ebp*4 - 2]
dec ebp
mov dword [esp + 4], ebp
mov byte [ecx + esi + 0x8f12], al
mov ecx, edx
not ecx
lea ecx, [ecx + edx*2]
cmp edx, 1
mov ebp, dword [esp + 4]
je 0x318084
nop
nop
nop
nop
nop
nop
nop
movzx edx, word [edi + ebp*4 - 2]
mov byte [edx + esi + 0x8f12], al
movzx edx, word [edi + ebp*4 - 6]
add ebp, 0xfffffffe
mov byte [edx + esi + 0x8f12], al
add ecx, 0xfffffffe
test ecx, ecx
jg 0x3180e0
jmp 0x318084
mov dword [esp + 0x930], 0
cmp ebx, 2
jl 0x318145
xor ecx, ecx
mov eax, 2
nop
nop
nop
nop
nop
mov edx, dword [esp + eax*4 + 0x24]
mov esi, edx
and esi, ecx
xor edx, ecx
add edx, edx
lea ecx, [edx + esi*4]
mov dword [esp + eax*4 + 0x92c], ecx
mov edx, eax
xor edx, 1
and eax, 1
lea eax, [edx + eax*2]
cmp eax, ebx
jle 0x318120
mov ecx, dword [esp + 0x15c0]
test ecx, ecx
jle 0x318222
xor eax, eax
mov edx, dword [esp + 0x14]
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 + 8], edi
jmp 0x31819c
mov ecx, dword [esp + 8]
mov word [ecx + eax*2 + 0x8852], di
mov ecx, dword [esp + 0x15c0]
inc eax
cmp eax, ecx
je 0x318222
movzx ebx, byte [eax + edx + 0x8f12]
test ebx, ebx
je 0x318193
mov ecx, dword [esp + ebx*4 + 0x92c]
lea edi, [ecx + 1]
mov dword [esp + ebx*4 + 0x92c], edi
xor edi, edi
cmp bl, 4
jb 0x3181ff
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 0x3181d0
and ebx, 3
je 0x318180
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 0x318210
jmp 0x318180
add esp, 0x15ac
pop esi
pop edi
pop ebx
pop ebp
ret
dec dword [esp + ebx*4 + 0x28]
mov ecx, ebx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
cmp ecx, 2
jl 0x318258
mov esi, dword [esp + ecx*4 + 0x24]
dec ecx
test esi, esi
je 0x318240
dec esi
mov dword [esp + ecx*4 + 0x28], esi
add dword [esp + ecx*4 + 0x2c], 2
dec eax
cmp eax, edx
jne 0x31822d
jmp 0x318022