View previous topic :: View next topic |
Author |
Message |
Twistedfate Expert Cheater
Reputation: 1
Joined: 11 Mar 2016 Posts: 231
|
Posted: Sun Dec 11, 2016 8:08 am Post subject: How to compare string with register+offest asm |
|
|
I need example to compare the string in this offset f48
[ecx+f48] contain string Hello
and I want to compare hello with mystringishere
[ecx+f48],mystringishere
|
|
Back to top |
|
 |
Zanzer I post too much
Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Sun Dec 11, 2016 8:19 am Post subject: |
|
|
Code: | cmp [ecx+F48],'Hell'
jne code
cmp byte ptr [ecx+F4C],'o'
jne code
//it equals! |
|
|
Back to top |
|
 |
Twistedfate Expert Cheater
Reputation: 1
Joined: 11 Mar 2016 Posts: 231
|
Posted: Sun Dec 11, 2016 8:28 am Post subject: |
|
|
like this for mystringishere word ?
Code: | cmp [ecx+F48],'myst'
jne code
cmp byte ptr [ecx+F4C],'ring'
jne code
cmp [ecx+F48],'ishe'
jne code
cmp byte ptr [ecx+F4C],'re'
jne code
//it equals!
|
|
|
Back to top |
|
 |
Zanzer I post too much
Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Sun Dec 11, 2016 9:02 am Post subject: |
|
|
Nope.
Code: | cmp dword ptr [addr],val // compares 4 bytes (default when size isn't specified)
cmp word ptr [addr],val // compares 2 bytes
cmp byte ptr [addr],val // compares 1 byte |
The first 4 characters start at [ecx+F48].
Then the next 4 characters start at [ecx+F4C].
Followed by the next 4 characters at [ecx+F50].
|
|
Back to top |
|
 |
Twistedfate Expert Cheater
Reputation: 1
Joined: 11 Mar 2016 Posts: 231
|
Posted: Sun Dec 11, 2016 9:26 am Post subject: |
|
|
thnx worked ... I cannot rep u untill I rep some one else sorry
|
|
Back to top |
|
 |
|