5,23 → 5,16 |
|
section '.text' align 16 code readable executable |
|
public _InitSound@0 |
public _CreateBuffer@8 |
public _InitSound@4 |
public _CreateBuffer@12 |
public _DestroyBuffer@4 |
|
align 4 |
proc _InitSound@0 |
locals |
handle dd ? |
io_code dd ? |
input dd ? |
inp_size dd ? |
output dd ? |
out_size dd ? |
endl |
_InitSound@4: ;p_ver:dword |
|
push ebx |
push ecx |
|
mov eax, 68 |
mov ebx, 16 |
mov ecx, szInfinity |
36,96 → 29,81 |
int 0x40 |
mov [hrdwSound], eax |
|
mov eax, [hSound] |
lea eax, [esp+12] ;p_ver |
xor ebx, ebx |
|
mov [handle], eax |
mov [io_code], SRV_GETVERSION |
mov [input], ebx |
mov [inp_size], ebx |
mov [output], ebx |
mov [out_size], ebx |
push 4 ;.out_size |
push eax ;.output |
push ebx ;.inp_size |
push ebx ;.input |
push SRV_GETVERSION ;.code |
push [hSound] ;.handle |
|
mov eax, 68 |
mov ebx, 17 |
lea ecx, [handle] |
mov ecx, esp ;[handle] |
int 0x40 |
add esp, 24 |
pop ecx |
pop ebx |
ret 4 |
.fail: |
|
.done: |
or eax, -1 |
pop ecx |
pop ebx |
ret |
endp |
ret 4 |
|
|
align 4 |
proc _CreateBuffer@8 stdcall, format:dword, size:dword |
locals |
handle dd ? |
io_code dd ? |
input dd ? |
inp_size dd ? |
output dd ? |
out_size dd ? |
endl |
_CreateBuffer@12: ;format:dword,size:dword,p_str:dword |
|
push ebx |
push ecx |
mov eax, [hSound] |
lea ebx, [format] |
xor ecx, ecx |
lea eax, [esp+20] ;p_str |
lea ebx, [esp+12] ;format |
|
mov [handle], eax |
mov [io_code], SND_CREATE_BUFF |
mov [input], ebx |
mov [inp_size], 4 |
mov [output], ecx |
mov [out_size], ecx |
push 4 ;.out_size |
push eax ;.output |
push 8 ;.inp_size |
push ebx ;.input |
push SND_CREATE_BUFF;.code |
push [hSound] ;.handle |
|
mov eax, 68 |
mov ebx, 17 |
lea ecx, [handle] |
mov ecx, esp |
int 0x40 |
add esp, 24 ;io_cintrol |
pop ecx |
pop ebx |
ret |
endp |
ret 12 |
|
align 4 |
proc _DestroyBuffer@4 stdcall, str:dword |
locals |
handle dd ? |
io_code dd ? |
input dd ? |
inp_size dd ? |
output dd ? |
out_size dd ? |
endl |
_DestroyBuffer@4: ;str:dword |
|
push ebx |
push ecx |
|
mov eax, [hSound] |
lea ebx, [str] |
xor ecx, ecx |
xor eax, eax |
lea ebx, [esp+12] ;[stream] |
|
mov [handle], eax |
mov [io_code], SND_DESTROY_BUFF |
mov [input], ebx |
mov [inp_size], 4 |
mov [output], ecx |
mov [out_size], ecx |
push eax ;.out_size |
push eax ;.output |
push 4 ;.inp_size |
push ebx ;.input |
push SND_DESTROY_BUFF;.code |
push [hSound] ;.handle |
|
mov eax, 68 |
mov ebx, 17 |
lea ecx, [handle] |
mov ecx, esp ;[handle] |
int 0x40 |
add esp, 24 |
pop ecx |
pop ebx |
ret |
endp |
ret 4 |
|
|
section '.data' align 16 data readable writable |
|
public hSound |