Function at 0x10039540
Capabilities:
Encode data using xor
Encrypt data using rc4 prga

Disassembly:
push ebx
mov ebx, esp
sub esp, 8
and esp, 0xfffffff0
add esp, 4
push ebp
mov ebp, dword [ebx + 4]
mov dword [esp + 4], ebp
mov ebp, esp
sub esp, 0x98
mov eax, dword [0x10055040]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [0x1005775c]
push esi
push edi
mov dword [ebp - 0x34], ecx
lea edi, [ecx + 0x18]
cmp byte [eax + 0x14], 0
je 0x10039ac2
cmp byte [edi], 0
je 0x10039ac2
mov esi, dword [ecx + 0x20]
cmp dword [ecx + 0x1c], esi
je 0x10039ac2
mov eax, dword [ecx + 0x28]
mov edx, dword [ecx + 0x2c]
cmp eax, edx
je 0x10039ac2
sub esi, dword [ecx + 0x1c]
sub edx, eax
mov eax, 0x2aaaaaab
sar esi, 2
imul edx
sar edx, 2
mov eax, edx
shr eax, 0x1f
add eax, edx
cmp esi, eax
jne 0x10039ac2
mov edx, dword [0x10057760]
vmovdqu xmm0, xmmword [ecx + 0x34]
vmovd eax, xmm0
vmovdqa xmmword [ebp - 0x50], xmm0
mov esi, dword [edx + 0x6f4]
mov dword [ebp - 0x20], eax
cmp esi, eax
jle 0x10039615
mov eax, dword [ebp - 0x48]
lea edi, [ecx + 0x18]
add eax, dword [ebp - 0x20]
cmp esi, eax
jge 0x10039615
mov eax, dword [ebp - 0x4c]
cmp dword [edx + 0x6f8], eax
jle 0x10039615
mov eax, dword [ebp - 0x44]
lea edi, [ecx + 0x18]
add eax, dword [ebp - 0x4c]
cmp dword [edx + 0x6f8], eax
jge 0x10039615
mov esi, ecx
mov dword [ebp - 0x24], esi
jmp 0x100396b4
vmovdqu xmm0, xmmword [ecx + 0x44]
vmovd eax, xmm0
mov dword [ebp - 0x20], eax
vmovdqa xmmword [ebp - 0x50], xmm0
cmp esi, eax
jle 0x10039656
mov eax, dword [ebp - 0x48]
lea edi, [ecx + 0x18]
add eax, dword [ebp - 0x20]
cmp esi, eax
jge 0x10039656
mov esi, dword [edx + 0x6f8]
cmp esi, dword [ebp - 0x4c]
jle 0x10039656
mov eax, dword [ebp - 0x44]
lea edi, [ecx + 0x18]
add eax, dword [ebp - 0x4c]
cmp esi, eax
jge 0x10039656
mov esi, ecx
mov dword [ebp - 0x24], esi
jmp 0x100396b4
cmp byte [edx + 1], 0
je 0x100396af
cmp byte [edx + 0x101], 0
jne 0x100396af
lea ecx, [ebp - 0x90]
call fcn.1000a220
lea eax, [ebp - 0x90]
mov ecx, edi
push eax
call fcn.10035cc0
lea ecx, [ebp - 0x90]
call fcn.1000a390
mov ecx, dword [0x100563c0]
push str.ui_buttonclickrelease.wav
mov eax, dword [ecx]
call dword [eax + 0x138]
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.10042b39
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
ret
mov esi, ecx
mov dword [ebp - 0x24], ecx
mov eax, dword [0x10057730]
mov edi, 0x44
vmovss xmm1, dword [0x1004da50]
mov eax, dword [eax + 0x44]
vmovdqu xmm0, xmmword [esi + edi]
vmovdqu xmmword [ebp - 0x50], xmm0
vxorps xmm0, xmm0, xmm0
mov ecx, dword [eax + 0x10]
mov edx, ecx
mov eax, ecx
shr edx, 0x18
shr eax, 0x10
mov dword [ebp - 0x20], eax
mov eax, ecx
shr eax, 8
mov dword [ebp - 0x30], eax
mov eax, 0xff
mov dword [ebp - 0x2c], ecx
mov ecx, edx
sub eax, ecx
mov edi, dword [0x100563c0]
vcvtsi2ss xmm0, xmm0, eax
vmulss xmm0, xmm0, xmm1
vcvttss2si eax, xmm0
sub dl, al
mov ecx, 0xff
movzx esi, dl
mov edx, dword [ebp - 0x20]
movzx eax, dl
sub ecx, eax
shl esi, 8
vxorps xmm0, xmm0, xmm0
vcvtsi2ss xmm0, xmm0, ecx
vmulss xmm0, xmm0, xmm1
vcvttss2si eax, xmm0
sub dl, al
mov ecx, 0xff
movzx eax, dl
mov edx, dword [ebp - 0x30]
or esi, eax
movzx eax, dl
sub ecx, eax
shl esi, 8
vxorps xmm0, xmm0, xmm0
vcvtsi2ss xmm0, xmm0, ecx
mov ecx, dword [ebp - 0x2c]
vmulss xmm0, xmm0, xmm1
vcvttss2si eax, xmm0
sub dl, al
movzx eax, dl
mov edx, 0xff
or esi, eax
movzx eax, cl
sub edx, eax
shl esi, 8
vxorps xmm0, xmm0, xmm0
vcvtsi2ss xmm0, xmm0, edx
vmulss xmm0, xmm0, xmm1
vcvttss2si eax, xmm0
sub cl, al
movzx eax, cl
mov ecx, edi
or esi, eax
mov eax, dword [edi]
push esi
call dword [eax + 0x28]
vmovdqu xmm0, xmmword [ebp - 0x50]
mov ecx, dword [0x100563c0]
vpextrd esi, xmm0, 1
vpextrd eax, xmm0, 3
add eax, esi
mov edi, dword [ecx]
push eax
vmovd edx, xmm0
vpextrd eax, xmm0, 2
add eax, edx
push eax
push esi
push edx
call dword [edi + 0x30]
mov eax, dword [0x10057730]
mov eax, dword [eax + 0x44]
vmovss xmm1, dword [0x1004da58]
mov edi, dword [0x100563c0]
mov ecx, dword [eax + 0x10]
mov eax, ecx
shr eax, 0x10
mov edx, ecx
mov dword [ebp - 0x20], eax
mov eax, ecx
shr eax, 8
mov dword [ebp - 0x30], eax
mov eax, dword [ebp - 0x24]
mov dword [ebp - 0x2c], ecx
mov ecx, 0x44
shr edx, 0x18
vmovdqu xmm0, xmmword [eax + ecx]
vmovdqu xmmword [ebp - 0x50], xmm0
mov eax, edx
mov ecx, 0xff
sub ecx, eax
vxorps xmm0, xmm0, xmm0
vcvtsi2ss xmm0, xmm0, ecx
vmulss xmm0, xmm0, xmm1
vcvttss2si eax, xmm0
sub dl, al
mov ecx, 0xff
movzx esi, dl
mov edx, dword [ebp - 0x20]
movzx eax, dl
sub ecx, eax
shl esi, 8
vxorps xmm0, xmm0, xmm0
vcvtsi2ss xmm0, xmm0, ecx
vmulss xmm0, xmm0, xmm1
vcvttss2si eax, xmm0
sub dl, al
mov ecx, 0xff
movzx eax, dl
mov edx, dword [ebp - 0x30]
or esi, eax
movzx eax, dl
sub ecx, eax
shl esi, 8
vxorps xmm0, xmm0, xmm0
vcvtsi2ss xmm0, xmm0, ecx
mov ecx, dword [ebp - 0x2c]
vmulss xmm0, xmm0, xmm1
vcvttss2si eax, xmm0
sub dl, al
movzx eax, dl
mov edx, 0xff
or esi, eax
movzx eax, cl
sub edx, eax
shl esi, 8
vxorps xmm0, xmm0, xmm0
vcvtsi2ss xmm0, xmm0, edx
vmulss xmm0, xmm0, xmm1
vcvttss2si eax, xmm0
sub cl, al
movzx eax, cl
mov ecx, edi
or esi, eax
mov eax, dword [edi]
push esi
call dword [eax + 0x28]
vmovdqu xmm0, xmmword [ebp - 0x50]
mov ecx, dword [0x100563c0]
vpextrd esi, xmm0, 1
vpextrd eax, xmm0, 3
add eax, esi
mov edi, dword [ecx]
push eax
vmovd edx, xmm0
vpextrd eax, xmm0, 2
add eax, edx
push eax
push esi
push edx
call dword [edi + 0x38]
mov edi, dword [ebp - 0x34]
mov ecx, dword [edi + 0x20]
xor edx, edx
sub ecx, dword [edi + 0x1c]
xor esi, esi
mov eax, dword [edi + 0x50]
sar ecx, 2
div ecx
mov dword [ebp - 0x34], esi
mov dword [ebp - 0x30], eax
test ecx, ecx
je 0x10039ae6
xor eax, eax
mov dword [ebp - 0x24], esi
xor edx, edx
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x20], edx
mov dword [ebp - 0x3c], eax
nop dword [eax]
mov esi, dword [edi + 0x28]
add esi, eax
cmp dword [esi + 0x14], 0xf
jbe 0x1003990d
mov esi, dword [esi]
mov eax, dword [edi + 0x1c]
mov eax, dword [eax + edx]
cmp byte [eax], 0
je 0x10039922
vmovss xmm1, dword [0x1004d958]
jmp 0x1003992a
vmovss xmm1, dword [0x1004d93c]
mov eax, dword [0x10057730]
vxorps xmm0, xmm0, xmm0
push esi
mov eax, dword [eax + 0x44]
mov ecx, dword [eax + 0x2c]
mov edx, dword [eax + 0x10]
mov eax, edx
shr eax, 0x18
mov dword [ebp - 0x54], eax
mov dword [ebp - 0x2c], edx
mov eax, edx
shr eax, 8
mov dword [ebp - 0x40], eax
mov eax, ecx
shr eax, 0x10
mov dword [ebp - 0x38], ecx
movzx ecx, al
shr edx, 0x10
movzx eax, dl
sub ecx, eax
vcvtsi2ss xmm0, xmm0, ecx
mov ecx, dword [ebp - 0x38]
vmulss xmm0, xmm0, xmm1
vcvttss2si eax, xmm0
add al, dl
shr ecx, 0x18
mov edx, dword [ebp - 0x54]
movzx esi, al
vxorps xmm0, xmm0, xmm0
movzx eax, dl
sub ecx, eax
vcvtsi2ss xmm0, xmm0, ecx
vmulss xmm0, xmm0, xmm1
vcvttss2si eax, xmm0
add al, dl
mov edx, dword [ebp - 0x40]
movzx eax, al
shl eax, 8
or esi, eax
mov eax, dword [ebp - 0x38]
shr eax, 8
movzx ecx, al
movzx eax, dl
sub ecx, eax
shl esi, 8
vxorps xmm0, xmm0, xmm0
vcvtsi2ss xmm0, xmm0, ecx
mov ecx, dword [ebp - 0x38]
vmulss xmm0, xmm0, xmm1
vcvttss2si eax, xmm0
add al, dl
movzx ecx, cl
mov edx, dword [ebp - 0x2c]
movzx eax, al
or esi, eax
movzx eax, dl
sub ecx, eax
shl esi, 8
vxorps xmm0, xmm0, xmm0
vcvtsi2ss xmm0, xmm0, ecx
mov ecx, dword [0x1005773c]
vmulss xmm0, xmm0, xmm1
vcvttss2si eax, xmm0
add al, dl
mov edx, 0x44
movzx eax, al
or esi, eax
mov eax, dword [edi + 0x48]
push esi
mov esi, dword [ebp - 0x24]
inc eax
push 1
push dword [ecx + 0x38]
add eax, esi
push eax
mov eax, edi
mov eax, dword [eax + edx]
add eax, 4
push eax
push ecx
call fcn.1001be00
mov ecx, dword [0x10057760]
add esp, 0x1c
cmp byte [ecx + 1], 0
je 0x10039a80
cmp byte [ecx + 0x101], 0
jne 0x10039a80
mov edx, dword [edi + 0x48]
add edx, esi
mov esi, edi
mov dword [ebp - 0x40], edx
mov edx, 0x44
mov eax, dword [esi + edx]
mov esi, dword [ebp - 0x24]
mov edx, dword [ebp - 0x40]
cmp dword [ecx + 0x6f4], eax
jle 0x10039a80
add eax, dword [edi + 0x4c]
cmp dword [ecx + 0x6f4], eax
jge 0x10039a80
mov ecx, dword [ecx + 0x6f8]
cmp ecx, edx
jle 0x10039a80
mov eax, dword [ebp - 0x30]
add eax, edx
cmp ecx, eax
jge 0x10039a80
mov eax, dword [edi + 0x1c]
mov ecx, dword [ebp - 0x3c]
mov ecx, dword [ecx + eax]
cmp byte [ecx], 0
sete al
mov byte [ecx], al
mov eax, dword [edi + 0x20]
sub eax, dword [edi + 0x1c]
mov edx, dword [ebp - 0x20]
inc dword [ebp - 0x34]
add edx, 4
add dword [ebp - 0x28], 0x18
add esi, dword [ebp - 0x30]
add dword [ebp - 0x3c], 4
sar eax, 2
cmp dword [ebp - 0x34], eax
mov eax, dword [ebp - 0x28]
mov dword [ebp - 0x24], esi
mov dword [ebp - 0x20], edx
jb 0x10039900
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.10042b39
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
ret
lea ecx, [ebp - 0x90]
call fcn.1000a220
lea eax, [ebp - 0x90]
mov ecx, edi
push eax
call fcn.10035cc0
lea ecx, [ebp - 0x90]
call fcn.1000a390
mov ecx, dword [ebp - 4]
pop edi
xor ecx, ebp
pop esi
call fcn.10042b39
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
ret