| View previous topic :: View next topic |
| Author |
Message |
SpaceUrkel How do I cheat?
Reputation: 0
Joined: 25 Feb 2012 Posts: 8
|
Posted: Sat Feb 25, 2012 3:07 pm Post subject: why segment registers? |
|
|
Hey, new forummember here! How is it going, people?
I have a question for all you ASM-cracks out there, I am currently (lies)
trying to get into ASM and debugging and its fairly okay to learn, but there
are a few things that google won't answer me instantly and just keeps
bugging me.
For example:
Why do 32/64-bit program still use segment registers like ds,ss,es?
I can perfectly store every address in one of the effective registers
(i.e. eax,ebx,ecx,edx,edi,esi)...
I am using OllyDBG on Win7. Thanks
-SpaceUrkel
_________________
et illus fugit |
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 475
Joined: 09 May 2003 Posts: 25978 Location: The netherlands
|
Posted: Sat Feb 25, 2012 3:19 pm Post subject: |
|
|
First of for security. Code running in a usermode code segment can not access kernelmode pages
Second, for distinguishing between 16, 32 and 64-bit code, and data access.
Third, for making software development easier. A segment register can have a base address. So accessing fs:[0] accesses the first byte of that base. This can be used for thread specific information so threads do not need to know where the thread information is stored(in case of fs:[0] it's related to exception handling)
_________________
Tools give you results. Knowledge gives you control.
Like my help? Join me on Patreon so i can keep helping |
|
| Back to top |
|
 |
SpaceUrkel How do I cheat?
Reputation: 0
Joined: 25 Feb 2012 Posts: 8
|
Posted: Sat Feb 25, 2012 3:29 pm Post subject: |
|
|
Okay, so for 32/64 bit programming it's more of a convenience than an essential, i take?
_________________
et illus fugit |
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 475
Joined: 09 May 2003 Posts: 25978 Location: The netherlands
|
Posted: Sat Feb 25, 2012 3:40 pm Post subject: |
|
|
It's still required for protection, but that's mainly goverened by the os and not the app
But ,in 64 windows you can use it to execute 64 bit code in a 32 bit process, and the other way around
_________________
Tools give you results. Knowledge gives you control.
Like my help? Join me on Patreon so i can keep helping |
|
| Back to top |
|
 |
SpaceUrkel How do I cheat?
Reputation: 0
Joined: 25 Feb 2012 Posts: 8
|
|
| Back to top |
|
 |
|