Timeline for Purpose of test eax,eax after a strcmp
Current License: CC BY-SA 4.0
12 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jan 11, 2020 at 20:20 | comment | added | Peter Cordes |
It's equivalent to cmp eax,0 : Test whether a register is zero with CMP reg,0 vs OR reg,reg? and `testl` eax against eax?
|
|
Sep 4, 2018 at 14:09 | vote | accept | user1584421 | ||
Sep 4, 2018 at 12:00 | history | tweeted | twitter.com/StackReverseEng/status/1036947208619339776 | ||
Sep 3, 2018 at 20:13 | comment | added | Peter Cordes | strcpy returns an integer in EAX, not in FLAGS. See `testl` eax against eax? for how this instruction sets flags according to EAX. | |
Sep 3, 2018 at 15:41 | comment | added | fpmurphy |
EAX is the register used by IA32 calling conventions to either return an interger value or a memory address to the calling routine. By design, strcpy can return either -1,0 or 1 in EAX with 0 indicating both strings match. TEST EAX,EAX tests whether EAX is zero or not and sets or unsets the ZF bit.
|
|
Sep 3, 2018 at 15:36 | answer | added | Edheldil | timeline score: 12 | |
Sep 3, 2018 at 13:31 | answer | added | perror | timeline score: 2 | |
Sep 3, 2018 at 13:00 | answer | added | blabb | timeline score: 8 | |
Sep 3, 2018 at 10:45 | answer | added | 0xC0000022L♦ | timeline score: 22 | |
Sep 3, 2018 at 10:40 | history | edited | user1584421 | CC BY-SA 4.0 |
added 143 characters in body
|
Sep 3, 2018 at 10:35 | review | First posts | |||
Sep 3, 2018 at 10:43 | |||||
Sep 3, 2018 at 10:30 | history | asked | user1584421 | CC BY-SA 4.0 |