Function at 0x40d740
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x57a8a8
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x28
push ebx
push esi
mov esi, ecx
push edi
lea ecx, [ebp - 0x18]
mov dword [ebp - 0x14], esi
call fcn.004059e0
mov al, byte [0x5de524]
mov dword [ebp - 4], 0
test al, 1
jne 0x40d79a
lea eax, [0x40d79a]
nop
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x1c]
lea ecx, [ebp - 0x18]
push eax
push 0x44
push str.E:devABASEA3DAssistSnd.cpp
push 0
call fcn.004059f0
mov esi, dword [esi + 0xc]
mov ebx, dword [ebp + 8]
push ebx
mov ecx, esi
mov edi, dword [esi + 0x14]
call fcn.0040e250
xor edx, edx
mov ecx, dword [esi + 8]
div edi
mov edi, dword [ecx + edx*4]
test edi, edi
je 0x40d7f5
mov eax, dword [edi + 8]
mov esi, ebx
mov dl, byte [eax]
mov cl, dl
cmp dl, byte [esi]
jne 0x40d7e2
test cl, cl
je 0x40d7de
mov dl, byte [eax + 1]
mov cl, dl
cmp dl, byte [esi + 1]
jne 0x40d7e2
add eax, 2
add esi, 2
test cl, cl
jne 0x40d7be
xor eax, eax
jmp 0x40d7e7
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
je 0x40d92a
mov edi, dword [edi]
test edi, edi
jne 0x40d7b9
lea eax, [ebp - 0xe]
lea ecx, [ebp - 0x20]
push eax
push ecx
mov byte [ebp - 0xe], 0
mov dword [ebp - 0x20], 0
lea ecx, [ebp - 0x2c]
call fcn.0040ec70
mov edx, eax
mov eax, dword [edx]
mov ecx, dword [edx + 4]
mov edx, dword [ebp - 0x14]
mov dword [edx + 0x10], eax
mov dword [edx + 0x14], ecx
mov al, byte [edx + 0x14]
test al, al
je 0x40d834
mov eax, dword [edx + 0x10]
mov ebx, dword [eax]
test ebx, ebx
jge 0x40da52
push 1
mov ecx, edx
call fcn.0040d0d0
mov ebx, eax
test ebx, ebx
jl 0x40d958
mov edi, dword [ebp - 0x14]
push ebx
mov ecx, edi
call fcn.0040d530
mov ecx, dword [edi + 0x2c]
lea edx, [ebp - 0x20]
push edx
mov eax, dword [ecx + 0xabc]
mov ecx, dword [ebp + 8]
push ecx
mov eax, dword [eax + 0x10]
mov ecx, eax
call fcn.005098e0
test al, al
je 0x40d97d
mov eax, dword [ebp - 0x20]
test eax, eax
je 0x40d97d
mov edx, dword [edi + 0x28]
mov dword [ebp - 0x1c], ebx
mov dword [edx + ebx*4], eax
mov ecx, dword [edi + 8]
lea eax, [ebx + ebx*4]
lea eax, [ecx + eax*4]
cmp byte [eax], 0
je 0x40d8b7
mov ecx, dword [eax + 0xc]
test ecx, ecx
je 0x40d8af
lea edx, [ebp - 0x24]
mov eax, ecx
mov ecx, dword [edi + 0xc]
push edx
mov dword [ebp - 0x24], eax
call fcn.0040eec0
push ebx
mov ecx, edi
call fcn.0040d080
mov eax, dword [ebp + 8]
mov ecx, dword [ebp - 0x1c]
lea esi, [edi + 0x18]
push eax
push ecx
mov ecx, esi
call fcn.00414a30
test al, al
je 0x40d944
mov edx, dword [ebp - 0x1c]
mov ecx, esi
push edx
call fcn.004149e0
mov edi, dword [edi + 0xc]
mov dword [ebp - 0x28], eax
mov ecx, edi
mov eax, dword [edi + 4]
inc eax
push eax
call fcn.0040ec90
lea ecx, [ebp - 0x1c]
lea edx, [ebp - 0x28]
push ecx
push edx
mov ecx, edi
call fcn.0040ede0
test al, al
je 0x40d944
mov eax, dword [ebp - 0x1c]
mov ecx, esi
push eax
call fcn.004149e0
mov ecx, dword [ebp - 0x1c]
lea edx, [ecx + ecx*4]
mov ecx, dword [ebp - 0x14]
mov esi, dword [ecx + 8]
mov dword [esi + edx*4 + 0xc], eax
mov eax, dword [ebp - 0x1c]
mov ecx, dword [ecx + 8]
lea eax, [eax + eax*4]
mov byte [ecx + eax*4], 1
jmp 0x40da52
lea eax, [ebp - 0xd]
lea ecx, [ebp - 0x1c]
add edi, 4
push eax
push ecx
mov byte [ebp - 0xd], 1
mov dword [ebp - 0x1c], edi
lea ecx, [ebp - 0x34]
jmp 0x40d80b
mov edx, dword [ebp + 8]
push ebx
push edx
push str.____Can_not_register_sndfile:_s_for_idx:_d
push 0
call fcn.00404080
add esp, 0x10
lea ecx, [ebp - 0x18]
mov dword [ebp - 4], 0xffffffff
call fcn.00405a80
pop edi
pop esi
or eax, 0xffffffff
pop ebx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret 4
mov ecx, dword [edi + 8]
lea eax, [ebx + ebx*4]
mov esi, dword [ecx + eax*4 + 0xc]
test esi, esi
mov dword [ebp - 0x28], esi
je 0x40da3b
mov cl, byte [esi]
mov edi, dword [edi + 0xc]
xor eax, eax
mov dword [ebp - 0x1c], edi
test cl, cl
mov edx, esi
je 0x40d9be
mov edi, eax
and ecx, 0xff
shl edi, 5
sub edi, eax
add edi, ecx
mov cl, byte [edx + 1]
inc edx
mov eax, edi
test cl, cl
jne 0x40d9a2
mov edi, dword [ebp - 0x1c]
mov ecx, dword [edi + 0x14]
xor edx, edx
div ecx
mov eax, dword [edi + 8]
mov edi, dword [eax + edx*4]
test edi, edi
lea edx, [eax + edx*4]
mov dword [ebp - 0x24], edx
je 0x40da38
jmp 0x40d9da
mov esi, dword [ebp - 0x28]
mov eax, dword [edi + 8]
mov dl, byte [eax]
mov cl, dl
cmp dl, byte [esi]
jne 0x40da01
test cl, cl
je 0x40d9fd
mov dl, byte [eax + 1]
mov cl, dl
cmp dl, byte [esi + 1]
jne 0x40da01
add eax, 2
add esi, 2
test cl, cl
jne 0x40d9dd
xor eax, eax
jmp 0x40da06
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
je 0x40da15
mov dword [ebp - 0x30], edi
mov edi, dword [edi]
test edi, edi
jne 0x40d9d7
jmp 0x40da38
mov eax, dword [ebp - 0x24]
cmp edi, dword [eax]
jne 0x40da22
mov ecx, dword [edi]
mov dword [eax], ecx
jmp 0x40da29
mov eax, dword [ebp - 0x30]
mov edx, dword [edi]
mov dword [eax], edx
push edi
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
mov eax, dword [ebp - 0x1c]
add esp, 4
dec dword [eax + 4]
mov edi, dword [ebp - 0x14]
push ebx
mov ecx, edi
call fcn.0040d080
mov ecx, dword [ebp + 8]
push ebx
push ecx
push str._____Can_not_LoadSoundBufferFromFile_for__s___d
jmp 0x40d94e
lea ecx, [ebp - 0x18]
mov dword [ebp - 4], 0xffffffff
call fcn.00405a80
mov ecx, dword [ebp - 0xc]
pop edi
mov eax, ebx
pop esi
pop ebx
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret 4