News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Looking for dll for text search

Started by Rainstorm, March 07, 2006, 04:53:12 PM

Previous topic - Next topic

Rainstorm

Hi

I didn't know where exactly on this board to make this post..
hope it isn't in the wrong place.
I'm not really a programmer.
I'm a fan of assembly programmed apps & have used some neat apps written in assembly.
I haven't gone any farther than reading about it & some tutorials.

I'm looking for a dll that will search text files very fast..
A dll that can be used by Mirc...to do the searches

I have written a few scripts in Mirc & a search function is one of the things..in them.
The text files are around  5Mbytes on an average.. but may be more.

Actually I have written scripts for searching text files in Mirc, & experimented
writing the scripts in different ways sometimes using different functions.. to do
the same search,..but it still, can really get quite slow on certain searches.. :'(
am looking for a dll that can do the searches very fast..
Hence my reason for this post :)
Its purely for my personal use..& the script is used for quoting text & doing searches of
large files in the channels i am on,...on IRC..

Would much appreciate any suggestions & feed back...

Thanks a lot.

Rainstorm






Mark Jones

Hello Rainstorm, and welcome to the group.

Would you be interested in making your own .DLL to do this, getting help from us in the process? You did say you've looked at the MASM32 package somewhat. Or are you hoping someone has made something like this already? Because generally here our motto is "we'll help you answer questions about your project but no hand-outs." :wink

Searching through files isn't too difficult in itself. I've recently made an app to search through the libraries of the MASM installation, see this thread. The real complexity of your task lies in the details. i.e., does the search need to be case-insensitive, and what is the calling method to the .DLL? I understand that you want to search through text files (probably logs) but for the .DLL to be used by mIRC requires the .DLL comply with mIRC's calling conventions. There appear to be some links on .DLL creation for mIRC here: http://mirc.org/links.html

Note that some of the links on the mIRC pages might be a big grey-area here. They start to hint about scripting and bots and whatnot - things we do not condone or tolerate here. As long as your intent is civil, we'll do our best to help you.

"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

Rainstorm

Hi, Thanks for the welcome.

I really didn't imagine writing a dll when i was making this post, I thought there might be
a standard assembly dll or 2 that's out there & would fit the purpose i mentioned.
But your post honestly did spark something in me & am willing to give it a try.
I admit learning something about assembly & any little way i could use it would give me a thrill..
In fact now I'd still be willing to give it a try even if someone already pointed me to a dll
that would do the job  :)
Its been years though, since what little i read about it. & I've been kind of reluctant
because its something not so easy & requires time too.
I'd need some guidance about how to go about it . & for you to outline how i get
started from scratch. -
just hope i don't try someone's patience :)
Due to some personal stuff, i could be tight on time too so it might be slow.
Its kind of excited me & am willing to try it though.

There are few things i have in mind for the search & somethings for the future, but I'll just
state the basic search, which is the general way it'll need to function most of the time.
its not for log files actually, but for searching old texts - bible versions & related books.

this is the basic general form of the text in the files..
(might need it to search stuff with a diff form for other purposes/files in the future, but thats
a side thing & not the main function)

Word1 Word2 Word3-onwards.......


-  the search should exclude, ignore the first 2 words(tokens) in the text file,..from the search.
   So, the search needs to be done only from Word3 onwards till the end of the line
-  The search is case-insensitive
-  The terms being maatched may be seperated by other words. (at the moment I've decided
   on the order the words appear in the line being kept - maybe at a later time i could have an option
   to return a match , whatever the order they may occur in the line)
    So now  it would be..

word1 word2 ......*searchterm1*..(some other words here maybe)...*searchterm2*...and so on...

like if   hello there is the searchterm it should search in the line for

Word1 Word2 ..sometext...*hello*......sometext......*there*


- lastly it should also match the wildcard of the searchterm --- for eg.
  if the searchterm is place it should find places or placers also

am using Windows-Xp pro-Sp2 - P4 1.7ghz Cpu - 512mb ram


After the search I'll need the first 2 tokens of the line returned(they serve as a verse reference) for
each match.- & of course.. the number of total results found.

Thanks a lot!

Rainstorm

-










Mark Jones

Hi Rainstorm, congrats on giving this a try! Sorry for the late reply but things have been busy here also. If you haven't already, here's the things you'll need to get this project started:

1. Goto http://www.masm32.com/masmdl.htm and get version 8.2 and the SP2 update at the bottom. Follow the instructions very carefully and it will install fine. (You could also use other assemblers like NASM or FASM or but we primarily discuss MASM programming here.)
2. A great place to get started with assembler is http://win32assembly.online.fr/tutorials.html - under the "Win32 Assembly" section. These are the legendary Iczelion Tutorials. :bg They start with simple "Hello World!" programs and go all the way up to device drivers, in case you ever wanted to do that.
3. I've found some of the MASM32 help files to be very educational. Be sure to read ASMINTRO.HLP.
4. In the masm32 installation, typically C:\MASM32, there should be an \examples folder. In there are all kinds of simple applications which can be used to learn programming in assembler, including some .DLL templates and examples. You'll have to follow the guidelines provided by the articles at http://mirc.org/links.html to construct the .DLL properly to work with mIRC.
5. You'll eventually need a copy of the Win32API reference. This lists all of the Windows functions you can use. There are literally thousands of windows functions, ranging from text conversion to window display routines, etc. http://ghirai.com/hutch/mmi.html - Ghirai here has the "Extended Win32 API Reference and CNT Files" which are ideal.
6. When you get stuck, post a question in the Campus forum here. That's the best place to get help on general programming. When you get to the point of optimizing your search algorithm, post that question in the Workshop or Laboratory.
7. Please try a few simpler programs before tackling your search plugin; learning assembler language takes some time. Taking in too much at once might be discouraging, let's not discourage you. :toothy

Good luck, and hope to hear from you soon!

Regards,
Mark
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

Rainstorm

Hi Mark..
downloaded the masm package & related stuff..
not been able to load the mirc.org site for some reason :/
installed the masm package & going through some of the help & tutorials atm..
lot of reading to do lol..
will be some time till i post back...

Many thanks for all the guidance & assistance!  :)

Rainstorm.

-