Example A:
mov eax, dword ptr fs:[30h]
mov ebx, byte ptr [eax+2]
test ebx, ebx
jz NoDebuggerDetected
Example B:
mov eax, large fs:30h
mov eax, dword ptr [eax+18h]
cmp dword ptr ds:[eax+10h], 0
jne DebuggerDetected
Both according to book (Practical Malware Analysis) are suppose to access fs segment and check value within PEB, but second example:
mov eax, large fs:30h
is not dereferencing the fs:30h
so why is this considered valid?
fs:30h
stores pointer to PEB, so doing [eax+18h]
would result in dereferencing fs + 48h
which wouldn't dereference PEB and would be invalid?
Is my logic somehow wrong or does 'mov eax, large fs:30h' results in implicit dereference?
-Thanks