flat assembler
Message board for the users of flat assembler.

Index > Main > String searches (was "HELP №2 ))))")

Author
Thread Post new topic Reply to topic
labron



Joined: 28 Aug 2013
Posts: 8
labron
how to compare each element
string >dd< 123413241341234
with ASCII necessary to me code?
Post 31 Aug 2013, 00:11
View user's profile Send private message AIM Address Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1408
Location: Toronto, Canada
AsmGuru62
I do not understand your question.
You want to search for some small text inside larger text (a sub-string)?
Post 31 Aug 2013, 03:16
View user's profile Send private message Send e-mail Reply with quote
labron



Joined: 28 Aug 2013
Posts: 8
labron
Code:
format pe gui 4.0
entry start
include 'win32ax.inc'

proc start
mov ecx,0
Start_pars:
cmp ecx,[len_string]
je Stop_pars
cmp [string+ecx],53
je Good_pars
add ecx,4
jmp Start_pars



Stop_pars:
invoke MessageBox,0,"Stop","Stop",0
invoke ExitProcess,0
Good_pars:
invoke MessageBox,0,"good","53",0
invoke ExitProcess,0
endp

string dd 11,22,11,22,22,33,44,33,22,66,34,23,54,34,23,44,11,22,11,22,22,33,44,33,22,66,34,23,54,34,23,44,54
len_string = $ - string
i dd ?



data import
library kernel32, 'KERNEL32.DLL',\
        user32,   'USER32.DLL'
import kernel32,\
       ExitProcess, 'ExitProcess'
import user32,\
       MessageBox, 'MessageBoxA'
end data
    


dont work Sad((
Post 04 Sep 2013, 04:25
View user's profile Send private message AIM Address Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 2891
Location: [RSP+8*5]
bitRAKE
Code:
format pe gui 4.0
entry start
include 'win32ax.inc'

proc start
mov ecx,0
Start_pars:
cmp ecx,[len_string]
je Stop_pars
cmp [string+ecx],53
je Good_pars
add ecx,4
jmp Start_pars



Stop_pars:
invoke MessageBox,0,"Stop","Stop",0
invoke ExitProcess,0
Good_pars:
invoke MessageBox,0,"good","53",0
invoke ExitProcess,0
endp

string dd 11,22,11,22,22,33,44,33,22,66,34,23,54,34,23,44,11,22,11,22,22,33,44,33,22,66,34,23,54,34,23,44,54

len_string dd $ - string



data import
library kernel32, 'KERNEL32.DLL',\
        user32,   'USER32.DLL'
import kernel32,\
       ExitProcess, 'ExitProcess'
import user32,\
       MessageBox, 'MessageBoxA'
end data    
Maybe above work?

_________________
¯\(°_o)/¯ unlicense.org
Post 04 Sep 2013, 06:59
View user's profile Send private message Visit poster's website Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1901
DOS386
labron

Welcome to the FASM forum ... please use descriptive subjects (not HELP HELP HELP HELP ) and code tags (I edited and fixed your 2 posts here)
Post 10 Sep 2013, 08:56
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.