Log in

View Full Version : A new version of AVSredirect.dll


Pages : [1] 2

Inc
21st January 2006, 19:05
Hi,

I went into the code of AVSredirect and modified it a bit so it could be more handy to appl. developers.

It will be accessed via stdcall and got some addons.

Avs Scripts now can be easely handled in VB, Delphi, Purebasic etc. without the common VFW workouts.
Scripts at given string pointers also can be handled.

*env = avs_create()

Creates a Scripenvironment for later use



ErrorLength = avs_getlasterror(char *str, int len))

Returns the length of the Errorstring which will be stored at the *str stringpointer



*char = avs_getlasterrorb()

Returns a string pointer where the last Error is stored.
The linebreaks of the string do come as chr(10)+chr(13) istead of a single chr(10)



clip = avs_open(*env, char *fname, AVSDLLVideoInfo *vi)

Opens an avs file, passes the VideoInfo to *vi and returns the clipnumber



clip = avs_script(*env, char *script, AVSDLLVideoInfo *vi, "RGB24")

Takes a string (an avs script) strored at *script, passes the VideoInfo to *vi and returns the clipnumber.
Note, you can force the output to a given Colorpace. Options are "RGB24", "RGB32", "YV12" and "YVY2"



*p = avs_getvframe(*env, clip, frame )

Returns the adress where the Bitmap is stored.



avs_getaframe(*env, clip, *buffer, __int64 start, __int64 count)

Reads the audiodata from the sample start to the sample end and stores it at the given *buffer adress



avs_close(*env, clip)

Releases the clip and the scriptenvironment





The AVSdllVideoInfo Structure:

typedef struct AVSDLLVideoInfo {
// Video
int width;
int height;
int raten;
int rated;
int aspectn; // ?
int aspectd; // ?
int interlaced_frame;
int top_field_first;
int num_frames;
int pixel_type;

// Audio
int audio_samples_per_second;
int sample_type;
int nchannels;
int num_audio_frames;
int64_t num_audio_samples;
} AVSDLLVideoInfo;


Sources are included.

Inc.

dimzon
21st January 2006, 19:09
please, upload it @ mytemdir.com

PS. I just finished my own avsredirect modification ;)

Inc
21st January 2006, 19:13
http://www.mytempdir.com/399643

Amnon82
22nd January 2006, 20:08
Can you post a short example how to use it in delphi?

Inc
23rd January 2006, 09:48
Create a scriptenvironment, open the avs-file or the avs-script-string, get the wanted videoframe, get the wanted audiodata, get the errors if the calls before did return an error value, if not --> .... play it.
Close the avs if you want to release the script.

Look into the sources - they are included as its GPL licensed - the sources speak for themself.

dimzon
23rd January 2006, 18:37
@incredible
http://forum.doom9.org/showthread.php?p=773705#post773705

Inc
23rd January 2006, 21:20
Yupp, how about adding ...
env->BitBlt(bufferVidOut, outPitch, f->GetReadPtr(), f->GetPitch(),
f->GetRowSize(), f->GetHeight());
.. at the end of the avs_getvframe() routine?

But how obtaining the right value for the 'outPitch' depending on the Outputcolorspace (RGB24/32,YV12,YUY2) ?

Inc
24th January 2006, 00:34
I added to the the avs_getvframe() function the BitBlt() so the problem about the smartpointer issue should be solved:

int __stdcall avs_getvframe(IScriptEnvironment* env, int clip_num, BYTE *buf, int frm )
{
try {
PVideoFrame f = clip[clip_num]->GetFrame(frm, env);
env->BitBlt(buf,f->GetPitch(), f->GetReadPtr(), f->GetPitch(),
f->GetRowSize(), f->GetHeight());
g_lasterr[0] = 0;
return 0;
}

catch(AvisynthError err) {
strncpy(g_lasterr,err.msg,ERRMSG_LEN-1);
return -1;
}

}
I used as destPitch in the BitBlt the sourcePitch as I do "assume" that it should be the same!?

I tested the playback and it works fine on a RGB24 previewing output.

Dimzon, I had a closer look at the mod's you did on AVSRedirect.
You did made a separate __patchScript() function, which makes sense, but in case of avs_open() you do force an YV12 output!
I have been even thinking about getting rid of the YV12 and YUY2 output option as it makes imho no sense in case of a wrapper which gots its purpose to provide Videoframes mainly for later displaying in previewing apps.

Sirber
24th January 2006, 02:09
Permission to add to RealAnime :D

Inc
24th January 2006, 09:40
Of course ;)

But as you see its not really ready yet. Lets wait if the BitBlt approach above is correct done.
I want to implement a cropping/resizing function and some more addons.

dimzon
24th January 2006, 11:37
I added to the the avs_getvframe() function the BitBlt() so the problem about the smartpointer issue should be solved
So You choose 1-st variant (CPU && Memory consuming)

dimzon
24th January 2006, 12:48
I added to the the avs_getvframe() function the BitBlt() so the problem about the smartpointer issue should be solved
Unfortunally my knoledge about AviSynth internals are poor.
Waht does I obtain @ the output, how I must threat this values, which buffer size i must provide to to this function?

Sirber
24th January 2006, 13:31
@incredible

Is it ready for at least getting the audio and video informations?

dimzon
24th January 2006, 13:32
@incredible

Is it ready for at least getting the audio and video informations?
Yes! It's even working for getting raw audio data from it (MeGIU use it to encode audio)

Sirber
24th January 2006, 13:42
Cool! I will try it this weekend! Thanks!

Inc
24th January 2006, 13:51
@ Dimzon

In PureBasic Syntax

*buf = AllocateMemory( vi.width * vi.height * 3 ) ;// an RGB 24 buffer
avs_getvframe(*env, clip_num, *buf, frm )

thats like if you do avs_getaframe().

By doing this you get a 'naked' raw RGB24 Bitmap at *buf.
The result value out of the call itself is just a bool like in the other function calls incl. providig the error string to the getlasterror() function if a -1 returns.
Then use a predifined BITMAPINFOHEADER Structure where you do set the obligatory values for width, height, planes, bitcount etc.
Pass these values to the APIs SetDIBits() command and you will have a standard RGB24 Bitmap for displaying in an imageframe.

I do assume as MeGUI also obtaines raw RGB24 Bitmaps out of the DgDecode access, so do look how in MeGUI those raw Bitmaps will be treaten to be displayed in a picture frame.

Inc
24th January 2006, 13:54
@incredible

Is it ready for at least getting the audio and video informations?

These also can be simply obtained via the Windows AviFil32 API (Avistreaminfo/AvifileInfo/BitmapInfoheader etc.) and The VFW API's ICOpen Routines (decompressor query for instance etc), which are included in your system32 as dlls.
So you dont have to provide another dll like the one provided in here with your applikation ;)

Sirber
24th January 2006, 14:13
These also can be simply obtained via the Windows AviFil32 API (Avistreaminfo/AvifileInfo/BitmapInfoheader etc.) and The VFW API's ICOpen Routines (decompressor query for instance etc), which are included in your system32 as dlls.
So you dont have to provide another dll like the one provided in here with your applikation ;)My application already come with lots of DLLs and EXEs. Also, I specificly need AVS informations, for AVI & etc I already manage that. I just need to know if the AVS contain video and/or audio, so I can manage the encoding process.

Inc
24th January 2006, 14:31
struct AVSDLLVideoInfo {
// Video
int width; // From AvifileInfo
int height; // From AvifileInfo
int raten; // From AviStreamInfo
int rated; // From AviStreamInfo
int aspectn; // -->Not provided viy Avisynth
int aspectd; // -->Not provided viy Avisynth
int interlaced_frame; // really needed?
int top_field_first; // really needed? and if ... is this result proof?
int num_frames; // From AviStreamInfo
int pixel_type; From the BitmapInfoHeader

// Audio
int audio_samples_per_second; // From AviStreamInfo/StreamTypeAudio-->WaveFormatEx
int sample_type; // From AviStreamInfo/StreamTypeAudio-->WaveFormatEx
int nchannels; // From AviStreamInfo/StreamTypeAudio-->WaveFormatEx
int num_audio_frames; // From AviStreamInfo/StreamTypeAudio
int64_t num_audio_samples; // Calculate from above
}

So all you need you can get from the AviFil32 API (this is just BTW) ;)
If you need some Infos *ring the bell*

So You choose 1-st variant (CPU && Memory consuming)
Memory consuming? The *buf adress is fixed (in Purebasic its generated by 'pointer = AllocateMemory(size)' )where all frames will be stored at that adress and it consumpts (width*height*3) bytes.
The *buf generation is done before the getting frames loop.
And the avs BitBlt function seems to be verrry fast related to dev reports in here.

Thats btw. the approch included in Triticals Brief explanation some threads below.

EDIT: Wait ....

(*frame)->GetReadPtr()

Means I just pass the adress to a pointer *frame ? Thats all?
I did understand that the framedata in the memory at the "smart pointer" could get lost? And not the Adress itself!?

Sirber
24th January 2006, 15:42
"AviFil32 API" can open AVS?

dimzon
24th January 2006, 15:44
"AviFil32 API" can open AVS?
Yes, it's by design ;)
Unfortunally if your avs contain error you will not get it via AviFile32 API (you will get video containing error message)

Sirber
24th January 2006, 15:47
How could I catch the error? I know the error colorspace is "DIB ".

Inc
24th January 2006, 16:15
Yes, .... VDub, Qenc, CCE for instance do use it also to access the AVI's or AVS's streams data.

Heres an approach:
http://forum.doom9.org/showthread.php?t=98611

I know the error colorspace is "DIB "But shouldn't be seen as reference. As it represents RGB.
BITMAPINFOHEADER.biCompression = DIB , means the Bitmap is stored as (BGR) RGB24 ... DIB = Device Independent Bitmap
BITMAPINFOHEADER.biCompression = YV12, ... nomen est omen
BITMAPINFOHEADER.biCompression = DIVX .... dto.

Related to avs error parsing via vfw:
http://forum.doom9.org/showthread.php?t=40921

Sirber
25th January 2006, 13:14
unit avisz;

interface

uses
Windows, Messages, SysUtils, Classes;

function GetAVIDisplaySize(Filename:string):TPoint;

implementation

type
PAVIFile = pointer;
rAVIFileInfo = record
dwMaxBytesPerSec:DWORD;
dwFlags:DWORD;
dwCaps:DWORD;
dwStreams:DWORD;
dwSuggestedBufferSize:DWORD;
dwWidth:DWORD;
dwHeight:DWORD;
dwScale:DWORD;
dwRate:DWORD;
dwLength:DWORD;
dwEditCount:DWORD;
szFileType:array[0..63]of char;
end;


procedure AVIFileInit; stdcall; external 'avifil32.dll' name 'AVIFileInit';
procedure AVIFileExit; stdcall; external 'avifil32.dll' name 'AVIFileExit';
function AVIFileOpen(var ppfile:PAVIFILE;szFile:pchar;mode:UINT;pclsidHandler:pointer):HRESULT; stdcall; external 'avifil32.dll' name 'AVIFileOpenA';
function AVIFileInfo(pfile:PAVIFILE; var pfi:rAVIFILEINFO; lSize:cardinal):HRESULT; stdcall; external 'avifil32.dll' name 'AVIFileInfoA';


function GetAVIDisplaySize(Filename:string):TPoint;
var
paf:PAVIFile;
info:rAVIFILEINFO;
begin
AVIFileInit;
try
AVIFileOpen(paf,pchar(Filename),fmOpenRead or fmShareDenyNone,nil);
AVIFileInfo(paf,info,sizeof(info));
finally
AVIFileExit;
end;
Result := Point(Info.dwWidth,Info.dwHeight);
end;

end.For delphi :D

Inc
25th January 2006, 15:32
Yup, nice :)
But dont forget the Avistreaminfo call, as (like above showed) many infos are obtained via this also.

Sirber
26th January 2006, 01:55
Interresting: http://forum.doom9.org/showthread.php?p=589914#post589914

Sirber
26th January 2006, 02:00
Yup, nice :)
But dont forget the Avistreaminfo call, as (like above showed) many infos are obtained via this also.Seems I need the VFW unit. This is bad and big :(

Sirber
26th January 2006, 03:49
procedure TAnalyze.AnalyzeAVS();
var
// VFW
pAVIfich: PAVIFile;
pAVIinfo: PAVIFILEINFOA;
pAVItrack: PAVIStream;
pAVItrackAudio: PAVISTREAMINFOA;
pAVItrackVideo: PAVISTREAMINFOA;

source: TSource;
tracktype: string;
begin
// Init
AVIFileInit();

// Open
AVIFileOpen(pAVIfich, pChar(setting.source_copy), fmOpenRead or fmShareDenyNone, nil);

// Info
AVIFileInfo(pAVIfich, pAVIinfo, sizeof(pAVIinfo));

// Look for audio
if (AVIFileGetStream(pAVIfich, pAVItrack, streamtypeAUDIO, 0) = AVIERR_OK) then
if (AVIStreamInfo(pAVItrack, pAVItrackAudio, sizeof(pAVItrackAudio)) = AVIERR_OK) then
begin
// We got audio track AND info!
source := CleanSource(source);
source.source := setting.source_copy;
source.codec := 'PCM';
source.output := setting.dir_temp + 'audio.mp4';
source.tracktype := 2; // audio
source.lang := setting.avi_aud_lang;
source.toencode := true;
source.toextract := false;
source.toremerge := false;
AddTrack(source);

bAnalyzed := true;
end;

// Look for video
if (AVIFileGetStream(pAVIfich, pAVItrack, streamtypeVIDEO, 0) = AVIERR_OK) then
if (AVIStreamInfo(pAVItrack, pAVItrackVideo, sizeof(pAVItrackVideo)) = AVIERR_OK) then
begin
// We got video track AND info!
source := CleanSource(source);
source.source := setting.source_copy;
source.codec := 'YV12';
source.output := setting.dir_temp + 'video';
source.tracktype := 1; // video
source.lang := 'und';
source.toencode := true;
source.toextract := false;
source.toremerge := false;
AddTrack(source);

bAnalyzed := true;
end;

// Close
AVIFileExit();
end;
"if (AVIStreamInfo(pAVItrack, pAVItrackAudio, sizeof(pAVItrackAudio)) = AVIERR_OK) then" returns a negative number. Did I do something wrong?

[edit]

return integer is: -2147205013
and it's not in any const.

Inc
26th January 2006, 10:47
I dont have any skills on Delphi but ...

if (AVIStreamInfo(pAVItrack, @pAVItrackAudio, sizeof(pAVItrackAudio)) = AVIERR_OK) then
begin

Maybe thats the trick?
As you have to serve the data to a AVISTREAMINFO structure

PS: As this thread in here deals about the avisynth script access via AvsRedirect.dll please do open a new thread related to avs accessing via AviFil32 API. Thanks :)

Or ... Could someone split the AviFil32 related part to a new Thread, thanks.

dimzon
26th January 2006, 11:30
@incredible
does you know what is a proper way
1) create new IScriptingEnviroment for each clip
OR
2) create one IScriptingEnviroment and use it for every clip

Inc
26th January 2006, 11:52
If you do generate an environment, then everytime when you do open a new script or a new scriptstringpointer the Clip count rises. Thats why also 'Max Clips' is determined for the maximal clip count in the given environment.

So you also can delete each given clip individually and of course at the very final deleting the *env.

I tried that in Purebasic using 4 Preview windows where every preview received its own clipnumber ... all of them refered to the same *env.


@ Avisynth Developers

What about these lines here:
int __stdcall avs_getvframe(IScriptEnvironment* env, int clip_num, BYTE *buf, int frm )
{
try {
PVideoFrame f = clip[clip_num]->GetFrame(frm, env);
env->BitBlt(buf,f->GetPitch(), f->GetReadPtr(), f->GetPitch(),
f->GetRowSize(), f->GetHeight());
g_lasterr[0] = 0;
return 0;
}

catch(AvisynthError err) {
strncpy(g_lasterr,err.msg,ERRMSG_LEN-1);
return -1;
}

}

If I do obtain a PVideoFrame where the Frame is RGB24 and I want to do a BitBlt for later preview that frame in an appl. ---> .... what about the DestPitch??
As you see above I used as DestPitch the SourcePitch .... is that ok?

dimzon
26th January 2006, 11:56
If you do generate an environment, then everytime when you do open a new script or a new scriptstringpointer the Clip count rises. Thats why also 'Max Clips' is determined for the maximal clip count in the given environment.

So you also can delete each given clip individually and of course at the very final deleting the *env.

I tried that in Purebasic using 4 Preview windows where every preview received its own clipnumber ... all of them refered to the same *env.

Is'nt more safer to create separate env for every clip instead?

Inc
26th January 2006, 12:00
If you look into the AvsWarp sources then there you even can access/edit the individual resulted clips by using "..pos" variants of the clip accessing commands.

But like I did edit my posting above ..... maybe some AVS Developers better should proof that. Or give their comments.

dimzon
26th January 2006, 12:07
If you look into the AvsWarp sources then there you even can access/edit the individual resulted clips by using "..pos" variants of the clip accessing commands.
I can't find it via google. Please, share it with me.

But like I did edit my posting above ..... maybe some AVS Developers better should proof that. Or give their comments.
Yes, it will be best!

tritical
26th January 2006, 18:43
@incredible
does you know what is a proper way
1) create new IScriptingEnviroment for each clip
OR
2) create one IScriptingEnviroment and use it for every clip
From my experience with dgvfapi, it is better to only create one script environment and use it for all clips. People reported problems when it was made to create a new scriptenvironment for every clip and a large number of clips were opened at the same time (15-20). Switching it to share one scriptenvironment among all clips fixed the problems. You just have to make sure that the scriptenvironment is not closed until all clips opened using it are closed. Also, avisynth's memory managment is pretty much designed for having only one scriptenvironment open at a time.

If I do obtain a PVideoFrame where the Frame is RGB24 and I want to do a BitBlt for later preview that frame in an appl. ---> .... what about the DestPitch??
As you see above I used as DestPitch the SourcePitch .... is that ok?
IMHO, destpitch should be supplied by the caller as it completely depends on how the caller allocated his buffer. He might allocate it so that width == pitch or so that pitch is dword-aligned, in which case if you use the frame's pitch and it is larger (in avs 2.56 pitch for packed frames is mod 16 and for planarframes it is 16 for y and 8 for uv) you will overrun the buffer. Or the caller might want to use a pitch size that is the next largest mod 16 or 32 size for alignment reasons. IIRC, BMP scanlines are dword-aligned.

dimzon
26th January 2006, 18:59
Switching it to share one scriptenvironment among all clips fixed the problems. You just have to make sure that the scriptenvironment is not closed until all clips opened using it are closed.
Is it safe to create scriptenvironment in one thread and create multiple clips on in in other threads? Is scriptenviroment a thread-safe?
Is threre a restriction how many clips can be created at one scriptenvironment at same time?

Sirber
26th January 2006, 19:05
@incredible

Thanks for the help and sorry for the troubles :D

tritical
26th January 2006, 19:13
Is it safe to create scriptenvironment in one thread and create multiple clips on in in other threads? Is scriptenviroment a thread-safe? I'm not an expert on the multi-threading stuff (you need tsp), but I don't believe that in 2.56 it is thread-safe.

Is threre a restriction how many clips can be created at one scriptenvironment at same time?Not that I'm aware of.

dimzon
26th January 2006, 19:14
I'm not an expert on the multi-threading stuff (you need tsp), but I don't believe that in 2.56 it is thread-safe.

Not that I'm aware of.
thanx for a help.
So we still need comments from AviSynth developers

Bidoche
27th January 2006, 13:11
Is it safe to create scriptenvironment in one thread and create multiple clips on in in other threads? Is scriptenviroment a thread-safe?Avs was not designed multithread initially.
Some work has been done recently to improve this, but as far as i know, the env was not fully synchronized.

Would probably be safer to use an env per thread.
It's already what happens when you open multiple scripts at once (which works fine)

Is threre a restriction how many clips can be created at one scriptenvironment at same time?No restriction

dimzon
27th January 2006, 13:53
Avs was not designed multithread initially.
Some work has been done recently to improve this, but as far as i know, the env was not fully synchronized.

Would probably be safer to use an env per thread.
It's already what happens when you open multiple scripts at once (which works fine)

No restriction
Thanx a lot!
Can you comment this http://forum.doom9.org/showthread.php?p=775306#post775306 too?

And just another question. If I create clip using env in thread1 then transmit it to thread2 - how safe is to use it in thread2

Bidoche
27th January 2006, 14:24
@incredible
does you know what is a proper way
1) create new IScriptingEnviroment for each clip
OR
2) create one IScriptingEnviroment and use it for every clipIt's one env per filter chain.

If I create clip using env in thread1 then transmit it to thread2 - how safe is to use it in thread2Err...
If it is the only thread using the clip (and all its childs), it's probably safe.

But I am not sure, better to get an avs2.5 dev to confirm this (as the version I work on is quite different)

dimzon
27th January 2006, 14:34
It's one env per filter chain.
I'm sorry - misunderstood your answer
I' using Eval or Import to get clip

alfixdvd
27th January 2006, 17:45
Please, is there any translation to Delphi ?

Thanks

Inc
27th January 2006, 18:50
I dont have any skills in Delphi, but the approach is easy as self-explaining in the first post where the commands are listened and in the 2nd or 3rd post where I gave an answer to the same question, so sorry.
Beside that you have to know how to call Dlls and their functions in delphi and how to display a raw RGB stream in your appl.

These days Ill update the dll to its last state of developement and also a simple Basic approach will be given in here which could be easely ported to diff. coding environments/syntaxes.

Amnon82
27th January 2006, 19:28
Here some Delphi DLL Tutorials:

DSDT DLL (german) (http://www.dsdt.info/tutorials/dlls/)
Delphi: Using or Writing DLLs (http://sheepdogguides.com/dt3k.htm)
inside3d (http://www.inside3d.com/dll/dll_getstarted.shtml)
DLL Tut (http://www.mircscripts.org/showdoc.php?type=tutorial&id=127)

... maybe that can help us to use it in delphi ;)

tritical
28th January 2006, 02:00
Basically, if you are going to have multiple scripts open at once, but in a way such that you will only be requesting frames from, or working on, one clip at a time (single threaded app for example), Avisynth will be more efficient memory wise, and cause less problems, if you open all of the scripts in the same scriptenvironment. However, if you are going to have multiple threads requesting frames from different clips at the same time, then you need to have one scriptenvironment per thread (with v2.56 and prior, v2.6 is mt safe) as Bidoche said. Inside each of those threads you can open as many scripts as you want in a single scriptenvironment.

For comparison, if you use the avifile api to open avs scripts, avisynth internally creates a new scriptenvironment for each opened file... so you end up with one scriptenvironment per script. That way is less efficient when you need to open a lot of scripts at the same time, but doesn't have to worry about threading issues.

Myrsloik
28th January 2006, 12:52
Delphi/pascal people in general can use avisynth pascal (http://forum.doom9.org/showthread.php?t=98327) (a conversion of avisynth_c.h). While the avisynth_c interface is slightly cryptic at least you can do everything with it.

alfixdvd
29th January 2006, 21:09
I try to use AVSredirect.dll from Delphi, and I can't because AVSredirect.dll don't export any function.

avsdll := LoadLibrary('AVSredirect.dll');

It works fine and I load the library succesfuly, but when I try:


GetProcAddress(avsdll,'avs_create')
GetProcAddress(avsdll,'avs_open')
GetProcAddress(avsdll,'avs_script')
GetProcAddress(avsdll,'avs_getvframe')
GetProcAddress(avsdll,'avs_getaframe')
GetProcAddress(avsdll,'avs_close')
GetProcAddress(avsdll,'avs_getlasterror')
GetProcAddress(avsdll,'avs_getlasterrorb')


I get null pointers for any function in the dll.


Listing avsredirect.dll with tdump.exe don't exhibit any exports.

Turbo Dump Version 5.0.16.12 Copyright (c) 1988, 2000 Inprise Corporation
Display of File AVSREDIRECT.DLL

Old Executable Header

DOS File Size 15C00h ( 89088. )
Load Image Size 210h ( 528. )
Relocation Table entry count 0000h ( 0. )
Relocation Table address 0040h ( 64. )
Size of header record (in paragraphs) 0004h ( 4. )
Minimum Memory Requirement (in paragraphs) 000Fh ( 15. )
Maximum Memory Requirement (in paragraphs) FFFFh ( 65535. )
File load checksum 0000h ( 0. )
Overlay Number 001Ah ( 26. )

Initial Stack Segment (SS:SP) 0000:00B8
Program Entry Point (CS:IP) 0000:0000


Portable Executable (PE) File

Header base: 00000100

CPU type 80386
Flags A18E [ executable 32bit library ]
DLL flags 0001 [ ProcInit ]
Linker Version 2.19
Time stamp 2A425E19 : Sat Jun 20 00:22:17 1992
O/S Version 4.0
User Version 0.0
Subsystem Version 4.0
Subsystem 0002 [ Windows GUI ]
Object count 00000006
Symbols offset 00000000
Symbols count 00000000
Optional header size 00E0
Magic # 10B
Code size 00011800
Init Data size 00004000
Uninit Data size 00000000
Entry RVA 00012628
Image base 00400000
Code base 00001000
Data base 00013000
Object/File align 00001000/00000200
Reserved 00000000
Image size 0001A000
Header size 00000400
Checksum 00000000
Stack reserve/commit 00000000/00000000
Heap reserve/commit 00100000/00001000
Number interesting RVAs 00000010
Name RVA Size
------------------ -------- --------
Exports 00000000 00000000



Listing AuthDvd.dll with tdump.exe exhibit exports.

Turbo Dump Version 5.0.16.12 Copyright (c) 1988, 2000 Inprise Corporation
Display of File AUTHDVD.DLL

Old Executable Header

DOS File Size 11000h ( 69632. )
Load Image Size 450h ( 1104. )
Relocation Table entry count 0000h ( 0. )
Relocation Table address 0040h ( 64. )
Size of header record (in paragraphs) 0004h ( 4. )
Minimum Memory Requirement (in paragraphs) 0000h ( 0. )
Maximum Memory Requirement (in paragraphs) FFFFh ( 65535. )
File load checksum 0000h ( 0. )
Overlay Number 0000h ( 0. )

Initial Stack Segment (SS:SP) 0000:00B8
Program Entry Point (CS:IP) 0000:0000


Portable Executable (PE) File

Header base: 000000D8

CPU type 80386
Flags 210E [ executable backwards 32bit library ]
DLL flags 0000 [ ]
Linker Version 6.0
Time stamp 3D25A935 : Fri Jul 05 16:12:05 2002
O/S Version 4.0
User Version 0.0
Subsystem Version 4.0
Subsystem 0002 [ Windows GUI ]
Object count 00000004
Symbols offset 00000000
Symbols count 00000000
Optional header size 00E0
Magic # 10B
Code size 00008000
Init Data size 00009000
Uninit Data size 00000000
Entry RVA 00003A8F
Image base 10000000
Code base 00001000
Data base 00009000
Object/File align 00001000/00001000
Reserved 00000000
Image size 00012000
Header size 00001000
Checksum 00000000
Stack reserve/commit 00100000/00001000
Heap reserve/commit 00100000/00001000
Number interesting RVAs 00000010
Name RVA Size
------------------ -------- --------
Exports 00009D30 000000BE


Section: Exports
Flags: 00000000
Time Stamp: 3D25A935 : Fri Jul 05 16:12:05 2002
Major Version: 0000
Minor Version: 0000

Exports from AuthDVD.DLL
7 exported name(s), 7 export addresse(s). Ordinal base is 1.
Not sorted
RVA Ord. Hint Name
-------- ---- ---- ----
00002820 1 0000 AuthDVD
000027A0 2 0001 AuthDrive
000028E0 3 0002 BS_About
00002900 4 0003 BS_CallBack
00002650 5 0004 CheckASPI
000026D0 6 0005 GetASF
00002720 7 0006 GetTitleKey



What's wrong ?

Inc
30th January 2006, 09:18
Try this ...
GetProcAddress(avsdll,'_avs_create@0')
GetProcAddress(avsdll,'_avs_open@12')
GetProcAddress(avsdll,'_avs_script@16')
GetProcAddress(avsdll,'_avs_getvframe@12')
GetProcAddress(avsdll,'_avs_getaframe@28')
GetProcAddress(avsdll,'_avs_close@8')
GetProcAddress(avsdll,'_avs_getlasterror@8')
GetProcAddress(avsdll,'_avs_getlasterrorb@0')