Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.msdos.programmer > #639

Re: Borlands Tasm5 and data in a DLL

From JJ <jaejunks_at@_googlemail_dot._com>
Newsgroups comp.os.msdos.programmer
Subject Re: Borlands Tasm5 and data in a DLL
Date 2012-06-13 00:14 +0000
Organization A noiseless patient Spider
Message-ID <XnsA07149C1EA08Fjaejunksgooglemailco@0.0.0.29> (permalink)
References <4fd6504d$0$6942$e4fe514c@news2.news.xs4all.nl> <XnsA070F37A1B56Djaejunksgooglemailco@0.0.0.29> <4fd781dc$0$6975$e4fe514c@news2.news.xs4all.nl>

Show all headers | View raw


I forgot that it's an explitic import, so it's a pointer of a pointer to 
actual code/data. It's how the import table is implemented. We can't 
change that unless you implicit import via GetProcAddress.

The only way to make it the simplest is to keep using explicit import 
and "fix" the MyData address.

;init part
mov eax, [MyData] ;get ptr to import table entry
mov edx, [eax] ;get actual address of imported data
mov [eax], edx ;replace the address

;usage part
mov eax, [MyData] ;will get actual value

As for why the address of off by a WORD...
Are you sure the exported variable is not a structure?


"R.Wieser" <address@not.available> wrote in
news:4fd781dc$0$6975$e4fe514c@news2.news.xs4all.nl: 

> JJ,
> 
>> What you get from a DLL function is the pointer to that
>> function.
> 
> True, but (normally) the address your own code calls (to access the
> function in that DLL) is not the address of that function.  Instead,
> it calls into a special table which holds a jump command and the real
> address of that DLL function.
> 
>> This is exactly the same with a DLL variable.
>> You get the pointer to that variable.
> 
> I'm sorry, did you see the code I posted (those three lines) ?   The
> first line shows you that the pointer is not at the adress pointed to
> by the "MyData" label (but two bytes beyond it).   The second line
> shows you that there is a second indirection.
> 
> In short : I'm not getting a pointer to that variable.   *Thats the
> whole problem*
> 
> Regards,
> Rudy Wieser

Back to comp.os.msdos.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Borlands Tasm5 and data in a DLL "R.Wieser" <address@not.available> - 2012-06-11 22:10 +0200
  Re: Borlands Tasm5 and data in a DLL JJ <jaejunks_at@_googlemail_dot._com> - 2012-06-12 16:54 +0000
    Re: Borlands Tasm5 and data in a DLL "R.Wieser" <address@not.available> - 2012-06-12 19:54 +0200
      Re: Borlands Tasm5 and data in a DLL JJ <jaejunks_at@_googlemail_dot._com> - 2012-06-13 00:14 +0000
        Re: Borlands Tasm5 and data in a DLL "R.Wieser" <address@not.available> - 2012-06-13 10:54 +0200
  Re: Borlands Tasm5 and data in a DLL JJ <jaejunks_at@_googlemail_dot._com> - 2012-06-12 16:57 +0000
  Re: Borlands Tasm5 and data in a DLL Ross Ridge <rridge@csclub.uwaterloo.ca> - 2012-06-12 18:54 -0400
    Re: Borlands Tasm5 and data in a DLL "R.Wieser" <address@not.available> - 2012-06-13 10:37 +0200
      Re: Borlands Tasm5 and data in a DLL Ross Ridge <rridge@csclub.uwaterloo.ca> - 2012-06-13 13:03 -0400
        Re: Borlands Tasm5 and data in a DLL "R.Wieser" <address@not.available> - 2012-06-14 09:30 +0200
          Re: Borlands Tasm5 and data in a DLL Ross Ridge <rridge@csclub.uwaterloo.ca> - 2012-06-14 11:55 -0400
            Re: Borlands Tasm5 and data in a DLL "R.Wieser" <address@not.available> - 2012-06-14 21:49 +0200
              Re: Borlands Tasm5 and data in a DLL Ross Ridge <rridge@csclub.uwaterloo.ca> - 2012-06-14 16:21 -0400
                Re: Borlands Tasm5 and data in a DLL "R.Wieser" <address@not.available> - 2012-06-15 12:18 +0200
                Re: Borlands Tasm5 and data in a DLL rugxulo@gmail.com - 2012-06-19 18:27 -0700

csiph-web