News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

LookingFor: A Masm64 tool to find strings in files.

Started by HSE, May 01, 2024, 01:10:37 AM

Previous topic - Next topic

HSE

Hi all!

I have some ideas about mask for file inclusion and exclusion, but finally don't have much sense  :biggrin:

Then I made just very standard: now  is available " * " for all files to search, " *. " for files without extension and for only extension files " .* " was already working.

Update in first post.

Regards, HSE.
Equations in Assembly: SmplMath

six_L

Hi,HSE
Great! Looking for some files at attosecond.

Regard.
Say you, Say me, Say the codes together for ever.

greenozon

If I set dir to say
c:\ddd
(the dir is real and has files in it)

and pressing "Find" button
I"m hitting strange error: (which repeats 2 times in a row)

---------------------------
LookingFor
---------------------------
Fail to set directory
---------------------------
OK   
---------------------------

also even after error the Cancel button is still actual


2) If I apppend \ to the dir like
C:\ddd\
then tehre is another error

---------------------------
LookingFor
---------------------------
Name or extension target problem
---------------------------
OK   
---------------------------


and button returns immediately to Find

3) if set c:\ddd* then app eats 100% CPU and doing nothing

HSE

Equations in Assembly: SmplMath

HSE

Hi greenozon!

The target must have a path and a file mask. Perhaps it's no so clear in the help  :rolleyes:

Quote from: greenozon on May 15, 2024, 07:31:24 PMc:\ddd
(the dir is real and has files in it)

and pressing "Find" button
I"m hitting strange error: (which repeats 2 times in a row)

---------------------------
LookingFor
---------------------------
Fail to set directory
---------------------------
OK 
---------------------------

also even after error the Cancel button is still actual

In this case you are searching "c:\" as path and "ddd" as mask. Because it's searching entire C: disk, is failing to access some long path or unicode name directory. 

After message, it skip that directory and search reasume (I think).

Quote from: greenozon on May 15, 2024, 07:31:24 PM3) if set c:\ddd* then app eats 100% CPU and doing nothing

In this case you are searching "c:\" as path and "ddd*" as mask. Probably it's the same that case 1 but, because wildcard, check the mask it's slower (again I think). I will test these cases.

The correct target for this search could be:c:\ddd\*
Quote from: greenozon on May 15, 2024, 07:31:24 PM2) If I apppend \ to the dir like
C:\ddd\
then tehre is another error

---------------------------
LookingFor
---------------------------
Name or extension target problem
---------------------------
OK 
---------------------------
and button returns immediately to Find

That it's correct because there is no mask. Perhaps error message need to be a little more verbose  :thumbsup:

Thanks very much, HSE
Equations in Assembly: SmplMath

HSE

Hi all!

Some error messages a bit more descriptive, and now catch some error to access target path.

Update in first post.

Regards, HSE.
Equations in Assembly: SmplMath

greenozon

Thanks a lot for the fresh build!
new err boxes are much better, but.. found out this one -

---------------------------
LookingFor:
---------------------------
Could not open
---------------------------
OK   
---------------------------

it happens when fill in very long value in the 1st drop down
also it's tricky to show this err...
try to click and on Find by mouse -> nothing
press Space -> gotcha

HSE

Hi greenozon!

Quote from: greenozon on May 17, 2024, 06:22:35 AM---------------------------
LookingFor:
---------------------------
Could not open
---------------------------
OK 
---------------------------

That could be an error or not, but anyway a good point  :thumbsup:

That message popup after click in some filename that match definitions.

You can see how that work in procedure ListProc, inside more.inc file.

If file extension is .bat or .CMD, shell call \masm64\qeditor. That is hardcoded but you can change path or editor and rebuild program. This necessary to prevent file execution.

Perhaps that also happen with other extensions associated with a program not present or moved.

Because is a tool for programming, is expected that extensions of interest have associated an editor.

Quote from: greenozon on May 17, 2024, 06:22:35 AMtry to click and on Find by mouse -> nothing
press Space -> gotcha

:thumbsup: There are remains from early development  :biggrin:

Thanks, HSE.
Equations in Assembly: SmplMath

HSE

I all!

I failed to reproduce greenozon problem :sad:

Anyway now editor for *.bat, *.cmd, and *.js is not longer hardcoded.

Quote from:  LookingFor.pdfClicking with mouse or pressing Enter key will open selected file in result list. Because is a tool for programming, is expected that extensions of interest have associated an editor.
   
   Executable files will not open to prevent unwanted runnings.
   
   In similar way *.bat, *.cmd and *.js files will not run. But in this cases they will open in an editor. By default /masm64/qeditor is that editor. But is possible to select a new path or editor. If default or stored editor fail, a dialog will ask a new path or editor. Later, editor could be changed in LookingFor.ini file.

Update in first post.

Regards, HSE.
Equations in Assembly: SmplMath

HSE

Minor update to help file (in first post). Now Release 1.0
Equations in Assembly: SmplMath

HSE

Hi all!

File system exploration example in Masm32 SDK check file attributes:
        .if wfd.dwFileAttributes == FILE_ATTRIBUTE_DIRECTORY
and that worked well.

Just now happen that, when you customize directory icon, another bit is added (readonly). Then these directories are ignored  :biggrin: , unless you change file attributes evaluation to bits instead of values:
        .if wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY

Update in first post.

Regards, HSE.
Equations in Assembly: SmplMath

jj2007

Quote from: HSE on July 03, 2024, 02:19:44 AM.if wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY

Check in debugger. I remember that at least one assembler version (ml.exe?) had problems with the single ampersand.

HSE

Quote from: jj2007 on July 03, 2024, 04:45:31 AMI remember that at least one assembler version (ml.exe?) had problems with the single ampersand.

No problem. This is Masm64 SDK (Vasily's macro).
Equations in Assembly: SmplMath

greenozon

#28
Using latest build - 1.2

there are some handles leakage when you run then stop then run again -> it is only increasing (sometimes -1)
eg:
https://prnt.sc/0KjFpGqsQ9Jj

greenozon

#29
If during active Find operation you click for example Help button the debugger reports some heap corruption cases, eg:

https://prnt.sc/DeiF_aN7w__U