Доброе время суток, вот встретилась API функция GetLastError() как выяснилось далее при выполнении она кладет в eax содержимое fs:[xx]. Так вот в чем вопрос собственно, не подскажете где можно почитать что же лежит в этом fs. про то что можно понять находится ли процесс под отладкой из этой информации я знаю, но вот остальный биты что значат???
Remarks Functions executed by the calling thread set this value by calling the SetLastError function. You should call the GetLastError function immediately when a function's return value indicates that such a call will return useful data. That is because some functions call SetLastError with a zero when they succeed, wiping out the error code set by the most recently failed function. To obtain an error string for system error codes, use the FormatMessage function. For a complete list of error codes provided by the operating system, see System Error Codes. The error codes returned by a function are not part of the Windows API specification and can vary by operating system or device driver. For this reason, we cannot provide the complete list of error codes that can be returned by each function. There are also many functions whose documentation does not include even a partial list of error codes that can be returned. Error codes are 32-bit values (bit 31 is the most significant bit). Bit 29 is reserved for application-defined error codes; no system error code has this bit set. If you are defining an error code for your application, set this bit to one. That indicates that the error code has been defined by an application, and ensures that your error code does not conflict with any error codes defined by the system. To convert a system error into an HRESULT value, use the HRESULT_FROM_WIN32 macro. http://msdn2.microsoft.com/en-us/library/ms679360.aspx
большое спасибо за ответ, к тому же на столько оперативный =) только боюсь я не верно в таком случае выразился, дело в том что сама функция GetLastError() была приведена как пример обращения к FS. На самом деле мне бы хотелось знать больше о том что лежит в сегментом регистре FS. Пытался найти а сети, но пока безуспешно. Если есть ссылки кидайте буду благодарен.
за направление спасибо. посмотрел щас структуру TEB. поправь если ошибаюсь, но пока что понял именно так : FS указывает на структуру TEB и когда мы пишем что то вроде fs:[xx] - просто обращаемся к полям структуры... так?
Vic во второй части "Об упаковщиках в последний раз"("СТАТЬИ > Исследование программ") про содержимое fs, TEB/PEB и иже с ними весьма подробно написано.