Jump to content
Tuts 4 You
Sign in to follow this  
joxxx

Get Last Error with out api

Recommended Posts

joxxx

I read in an article GetLastEror function can be emulated with TIB data .How can it be done ?

Share this post


Link to post
h4sh3m

Hi

You just need look at GetLastError with debugger ;)

GetLastError.png

  • Like 1

Share this post


Link to post
atom0s

If you are looking to do this in code, the struct is referred to has the TEB/TIB (Thread Environment Block or Thread Information Block).

Info about it entirely here:

https://en.wikipedia.org/wiki/Win32_Thread_Information_Block
https://www.nirsoft.net/kernel_struct/vista/TEB.html

Value you are interested in is LastErrorValue. (Keep in mind some of these values can be at different offsets depending on the system used. The struct has changed over the various Windows versions.)

Share this post


Link to post
evlncrn8

you'll never guess what SetLastError does 😜

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
×
×
  • Create New...