The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: ragdog on July 22, 2008, 10:27:28 PM

Title: Calculation or Buffer Problem
Post by: ragdog on July 22, 2008, 10:27:28 PM
hi

I have a little trouble with my calculation routine for
Imagebase-VA=RVA

the result must stored in Pe.Rva
   
I do not know whether the routine correctly calculate


     lea edi,offset Pe.Rva
    mov esi,offset Pe.ImageBase ;00400000 -
    mov edx,offset Pe.VA        ;004040A8
     sub edx,esi                      ;result = 000040A8
invoke SetDlgItemText,hWnd,IDC_RVA,edi


Have your an idea?

Please!

greets,
ragdog
Title: Re: Calculation or Buffer Problem
Post by: BlackVortex on July 22, 2008, 11:27:15 PM
You mean VA-imagebase=RVA  !!!

It's just a subtraction  :-(  Am I missing something here ?

Why do you move into the registers the offsets and not the dwords themselves ?

like :
mov esi,dword ptr [Pe.ImageBase]