Function at 0x46c290
Capabilities:
Get file size
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4cb800
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x220
push ebx
push esi
mov esi, dword [ebp + 0xc]
push edi
xor ebx, ebx
mov ecx, 0x81
xor eax, eax
lea edi, [ebp - 0x22a]
mov word [ebp - 0x22c], bx
mov dword [ebp - 0x10], esp
rep stosd dword es:[edi], eax
push ebx
push esi
mov dword [ebp - 0x18], 1
stosw word es:[edi], ax
call fcn.00422750
add esp, 8
test eax, eax
push esi
jne 0x46c301
mov ecx, dword [0x5cad44]
lea eax, [ebp - 0x22c]
push 0x103
push eax
push ecx
call fcn.00422760
jmp 0x46c318
push 0x4de3ac
lea edx, [ebp - 0x22c]
push 0x103
push edx
call dword [sym.imp.MSVCRT.dll__snwprintf]
add esp, 0x10
lea eax, [ebp - 0x22c]
push ebx
push eax
call fcn.00422750
add esp, 8
test eax, eax
je 0x46c50c
push ebx
push 0x8000080
push 3
push ebx
push 1
lea ecx, [ebp - 0x22c]
push DirectSoundCreate
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
push ebx
push edi
mov dword [ebp - 0x14], edi
mov dword [ebp - 4], ebx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x46c384
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, 1
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
lea edi, [ebx + 1]
push edi
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
mov ecx, edi
mov esi, eax
mov edx, ecx
xor eax, eax
mov edi, esi
add esp, 4
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
mov dword [ebp - 0x20], esi
and ecx, 3
test esi, esi
rep stosb byte es:[edi], al
je 0x46c4da
mov ecx, dword [ebp - 0x14]
lea eax, [ebp - 0x24]
push 0
push eax
push ebx
push esi
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFile]
xor eax, eax
mov ah, byte [esi + 1]
mov al, byte [esi]
cmp ax, 0xfeff
jne 0x46c462
lea eax, [esi + 2]
test eax, eax
mov dword [ebp - 0x1c], eax
jne 0x46c3e5
xor edi, edi
mov dword [ebp + 0xc], edi
jmp 0x46c3f1
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenW]
mov dword [ebp + 0xc], eax
mov edi, eax
mov ebx, dword [ebp + 0x10]
mov eax, dword [ebx]
cmp dword [eax - 0xc], 1
jg 0x46c401
cmp edi, dword [eax - 4]
jle 0x46c418
mov ecx, ebx
call fcn.004053e0
push edi
mov ecx, ebx
call fcn.00405350
test eax, eax
je 0x46c4be
mov esi, dword [ebp - 0x1c]
lea eax, [edi + edi]
mov edi, dword [ebx]
mov ecx, eax
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
mov edx, dword [ebp + 0xc]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [ebx]
mov esi, dword [ebp - 0x20]
push esi
mov dword [ecx - 8], edx
mov ecx, dword [ebx]
mov word [eax + ecx], 0
call fcn.00495c27
mov edx, dword [ebp - 0x14]
add esp, 4
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebp - 4], 0xffffffff
jmp 0x46c50f
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov ebx, dword [ebp + 0x10]
mov edi, eax
mov eax, dword [ebx]
cmp dword [eax - 0xc], 1
jg 0x46c47b
cmp edi, dword [eax - 4]
jle 0x46c48e
mov ecx, ebx
call fcn.004053e0
push edi
mov ecx, ebx
call fcn.00405350
test eax, eax
je 0x46c4be
lea eax, [edi + 1]
mov edi, dword [ebx]
test eax, eax
jne 0x46c49b
test edi, edi
jne 0x46c4b5
push eax
push edi
push 0xffffffffffffffff
push esi
push 0
push 0
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
test eax, eax
jle 0x46c4b5
mov word [edi + eax*2 - 2], 0
push 0xffffffffffffffff
mov ecx, ebx
call fcn.00434070
push esi
call fcn.00495c27
mov edx, dword [ebp - 0x14]
add esp, 4
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebp - 4], 0xffffffff
jmp 0x46c50f
mov edx, dword [ebp - 0x14]
mov ebx, dword [ebp + 0x10]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebp - 4], 0xffffffff
jmp 0x46c50f
mov ebx, dword [ebp + 0x10]
mov ecx, dword [ebp + 8]
cmp ecx, 0xffffffff
je 0x46c5ac
mov edx, dword [ebx]
mov eax, dword [edx - 8]
test eax, eax
jne 0x46c5ac
mov eax, dword [ebp + 0x14]
test eax, eax
je 0x46c5ac
push eax
lea eax, [ebp + 0x10]
push str.script
push eax
push ecx
mov dword [ebp + 0x10], 0
call fcn.00457330
mov esi, eax
add esp, 0x10
test esi, esi
je 0x46c55a
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov edi, eax
jmp 0x46c55c
xor edi, edi
mov eax, dword [ebx]
cmp dword [eax - 0xc], 1
jg 0x46c569
cmp edi, dword [eax - 4]
jle 0x46c57c
mov ecx, ebx
call fcn.004053e0
push edi
mov ecx, ebx
call fcn.00405350
test eax, eax
je 0x46c5ac
lea eax, [edi + 1]
mov edi, dword [ebx]
test eax, eax
jne 0x46c589
test edi, edi
jne 0x46c5a3
push eax
push edi
push 0xffffffffffffffff
push esi
push 0
push 0
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
test eax, eax
jle 0x46c5a3
mov word [edi + eax*2 - 2], 0
push 0xffffffffffffffff
mov ecx, ebx
call fcn.00434070
mov ecx, dword [ebx]
mov eax, dword [ecx - 8]
test eax, eax
je 0x46c5bc
mov dword [ebp - 0x18], 0
mov ecx, dword [ebp - 0xc]
mov eax, dword [ebp - 0x18]
pop edi
pop esi
mov dword fs:[0], ecx
pop ebx
mov esp, ebp
pop ebp
ret