flat assembler
Message board for the users of flat assembler.
Index
> Windows > lodsw Error Control |
Author |
|
roticv 04 Mar 2004, 12:43
Try repnz(or repz) scasw depending on your needs.
|
|||
04 Mar 2004, 12:43 |
|
pelaillo 04 Mar 2004, 19:34
If you are looking for a word and you know it will be aligned, you can scan two by two bytes, but if not, you better go byte by byte or scan possibilities of having second byte or first byte. i.e
Code: ; 1 2 3 4 5 6 7 8 9 0 1 2 3 4 ; .. .. .. .. .. .. .. stuff1 db 'this is some stuff, ok?',0,0 stuff2 db 'this is new stuff, ok?',0,0 Start: mov esi,stuff1 Another1: lodsw cmp ax,'ok' jne Another1 ; you will find it ok_found: mov esi,stuff2 Another2: lodsw cmp ax,'ok' jne Another2 ; you won't find it. ; It may run forever, depending on memory ; after stuff2 Another3: lodsw or ax,ax je not_found cmp ax,'ok' jne Another2 ; here it stops in a zero word |
|||
04 Mar 2004, 19:34 |
|
Torrey 05 Mar 2004, 00:05
@pelaillo & roticv
Originally the idea was to scan through a process' memory space for a specific byte pattern, using error control if possible to skip over parts of memory space that esi=??? (nothing) and just do a cmp with esi's current address so it stops at a certain point. As it seems there might not be error control for lodsx. Some colleagues told me to check out SEH for what I wanted. SEH will most likely be the last thing I test out. The first will be checking more into roticv's idea of using repnz or repz scasw. I'm expecting an access violation bomb out, but really hoping for the best. |
|||
05 Mar 2004, 00:05 |
|
JohnFound 05 Mar 2004, 01:45
Torrey wrote: I'm expecting an access violation bomb out, but really hoping for the best. Don't. You probably will get access violation. You need SEH. It is not exactly assembly related stuff, but Windows related. You have to read some tutorials about SEH - in generally it is not so complex. Regards. |
|||
05 Mar 2004, 01:45 |
|
Torrey 05 Mar 2004, 02:26
Honestly I skipped over the scasw stuff earlier and went straight for SEH. Worked perfectly! The hardest part about it all as most of you know...the debugger can't use the new error handler when one is set.
|
|||
05 Mar 2004, 02:26 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.