i am a n00b to x86 asm and i was wonder what is the difference between using
mov eax,[fs:30h]
and using
mov eax,[fs+30h]
i am using NASM (yeah i know this is a MASM forum but its one of the only x86 asm boards i could find) if it helps
thanks for your help
: is used to show which segment the data is in.
+ simply means add up to find the address.
The first instruction puts into eax the dword at address 30h in the segment pointed to by fs.
The second instruction puts into eax the dword at the address (30h + value of fs register) in the segment pointe to by ds.
Speaking of which, is there a tutorial somewhere about how segmentation works? I never did learn all that...
Segmentation means that to get a linear address, you add together a base and an offset.
THe offset is specified in the program, and has the option of depending on registers as well as constants.
In real mode the base is the value of the segment register * 16
IN protected mode the base is worked out by looking up the entry in the GDT referenced by the segment register.
Robert check out charpter 4 (http://webster.cs.ucr.edu/AoA/DOS/ch04/CH04-1.html) of Randall Hydes Art of Assembly book for 16bit DOS. It explains it all very well.
Hello Mr Miyagi,
Yes, this is the same Donkey as at the other forum you are banned from, BTW you can probably add this one to the list of bans, it will be Hutch who makes that determination. We are well aware that you are only interested in shellcode for malicious purposes and I do watch your IP and can track you if I please.
mr_miyagi,
Take the moderators warning seriously, both members and moderators here know what this type of code is used for and we have all heard the tricks and other nonsense before. You are welcome here as a member to ask technical questions related to programming issues but our rules are specific to ANY ilegal activity whatsoever and if there is any nonsense, we will act to prevent it from happening.
This is the only warning you will get and we will act if there are any more indiscretions.