Prev: ml.exe
Next: beginner asm, where next?
From: swishhh on 19 Jan 2007 19:21 Hi! I have the problem, that my EAX sometimes points on a unreadable area, because it is unallocated or the program has not the right. I call a function of a DLL. The returned value in EAX shall point to a structure. When the function fails, it returns a value, which points on a unreadable area. Trying to access [EAX] fails. Is there a possibility to check - without 'SetUnhandledExceptionFilter' - if EAX points on a readable value? Is there a test flag?? I would not really like to use exception handeling, because it slows the application down. I CAN NOT use a different DLL. Thanks, Sasha Gunthers
From: David Jones on 19 Jan 2007 20:06 swishhh <dungspace(a)gmx.de> wrote... > I have the problem, that my EAX sometimes points on a unreadable area, > because it is unallocated or the program has not the right. > > I call a function of a DLL. The returned value in EAX shall point to a > structure. When the function fails, it returns a value, which points on > a unreadable area. Trying to access [EAX] fails. Is there a possibility > to check - without 'SetUnhandledExceptionFilter' - if EAX points on a > readable value? Is there a test flag?? > > I would not really like to use exception handeling, because it slows > the application down. I CAN NOT use a different DLL. I presume that you're talking about the Microsoft Windows platform due to the references to SetUnhandledExceptionFilter. If so, you'd probably have better luck asking in a platform-specific group rather than in a language group -- this is not an assembly language problem, but a general Windows problem. Put another way, your question is: "How can I know if a pointer is valid?" That having been said, you might want to check out VirtualQuery. http://msdn2.microsoft.com/en-us/library/aa366902.aspx David
From: santosh on 19 Jan 2007 22:57 swishhh wrote: > Hi! > > I have the problem, that my EAX sometimes points on a unreadable area, > because it is unallocated or the program has not the right. > > I call a function of a DLL. The returned value in EAX shall point to a > structure. When the function fails, it returns a value, which points on > a unreadable area. Trying to access [EAX] fails. Is there a possibility > to check - without 'SetUnhandledExceptionFilter' - if EAX points on a > readable value? Is there a test flag?? > > I would not really like to use exception handeling, because it slows > the application down. I CAN NOT use a different DLL. Look up the docs on msdn.com. There're functions named isValidPtr() or something to that effect which check your pointer's value for deferencability.
From: LocoDelAssembly on 19 Jan 2007 23:06 You can use http://win32assembly.online.fr/Exceptionhandling.html which not relies on SetUnhandledExceptionFilter or http://msdn2.microsoft.com/en-us/library/aa366713.aspx (IsBadReadPtr) swishhh ha escrito: > Hi! > > I have the problem, that my EAX sometimes points on a unreadable area, > because it is unallocated or the program has not the right. > > I call a function of a DLL. The returned value in EAX shall point to a > structure. When the function fails, it returns a value, which points on > a unreadable area. Trying to access [EAX] fails. Is there a possibility > to check - without 'SetUnhandledExceptionFilter' - if EAX points on a > readable value? Is there a test flag?? > > I would not really like to use exception handeling, because it slows > the application down. I CAN NOT use a different DLL. > > > Thanks, > > Sasha Gunthers
From: David Jones on 19 Jan 2007 23:47
IsBadReadPtr isn't a good idea. http://blogs.msdn.com/larryosterman/archive/2004/05/18/134471.aspx http://blogs.msdn.com/oldnewthing/archive/2006/09/27/773741.aspx David LocoDelAssembly <ellocodelassembler(a)gmail.com> wrote... > You can use http://win32assembly.online.fr/Exceptionhandling.html which > not relies on SetUnhandledExceptionFilter or > http://msdn2.microsoft.com/en-us/library/aa366713.aspx (IsBadReadPtr) > > swishhh ha escrito: > > Hi! > > > > I have the problem, that my EAX sometimes points on a unreadable area, > > because it is unallocated or the program has not the right. > > > > I call a function of a DLL. The returned value in EAX shall point to a > > structure. When the function fails, it returns a value, which points on > > a unreadable area. Trying to access [EAX] fails. Is there a possibility > > to check - without 'SetUnhandledExceptionFilter' - if EAX points on a > > readable value? Is there a test flag?? > > > > I would not really like to use exception handeling, because it slows > > the application down. I CAN NOT use a different DLL. > > > > > > Thanks, > > > > Sasha Gunthers > > |