Jump to content

Why can't I read from stdout of hashdeep.exe?


tip
 Share

Recommended Posts

Hi to all,

I was writing a little script and I realized that I can not read from stdout stream of hashdeep.exe. Does anyone have an idea why I can't?

The code I'm running is:

$File1Pid = Run($HashDeeplocation & ' -c md5 -e "C:\File.avi"',@ScriptDir,@SW_SHOW, $STDOUT_CHILD)

While ProcessExists($File1Pid)

    $HashDeepTextRead = "-> " & StdoutRead($File1Pid)
    ToolTip($HashDeepTextRead)
    Sleep(10)

WEnd


//P.S.:"-c" option is to determine which hash algorithm to use and "-e" option is to show progress info.

I ran the code without $stdout_child opt and I can say that it is working the way it suppose to. But when I try to read from standart out stream I get nothing.

Hashdeep.exe can be obtained from here Hashdeep/md5deep

Thanks everybody in advance.

Regards,

Tip

Edited by tip

[center]MsgBox_Tipped: Eye candy msgboxes/inputboxes/loginboxes. | CreateBlankBox: Semi-transparent layers with borders and rounded corners.[/center]

Link to comment
Share on other sites

Run this from SciTE and see if you get anything written to console:

Local $iPID = Run($sHashDeeplocation & ' -h"', "", @SW_HIDE, 6) ; $STDERR_CHILD + $STDOUT_CHILD

Local $sLine, $sLineError

While 1
    $sLineError = StderrRead($iPID)
    If @error Then ExitLoop
    ConsoleWriteError($sLineError)
    Sleep(100)
WEnd

While 1
    $sLine = StdoutRead($iPID)
    If @error Then ExitLoop
    ConsoleWrite($sLine)
    Sleep(100)
WEnd

If not the check $sHashDeeplocation because that really should print something.

Edited by trancexx

♡♡♡

.

eMyvnE

Link to comment
Share on other sites

When hashdeep.exe had completed hash calculation and exit it gave me these lines:

Console:

File.avi: 50MB of 1400MB done, 00:00:26 left                       
File.avi: 148MB of 1400MB done, 00:00:16 left                      
File.avi: 245MB of 1400MB done, 00:00:14 left                      
File.avi: 339MB of 1400MB done, 00:00:12 left                      
File.avi: 434MB of 1400MB done, 00:00:11 left                      
File.avi: 532MB of 1400MB done, 00:00:09 left                      
File.avi: 631MB of 1400MB done, 00:00:08 left                      
File.avi: 729MB of 1400MB done, 00:00:07 left                      
File.avi: 827MB of 1400MB done, 00:00:06 left                      
File.avi: 924MB of 1400MB done, 00:00:05 left                      
File.avi: 1017MB of 1400MB done, 00:00:04 left                     
File.avi: 1113MB of 1400MB done, 00:00:03 left                     
File.avi: 1212MB of 1400MB done, 00:00:02 left                     
File.avi: 1310MB of 1400MB done, 00:00:00 left                     
                                                                        
%%%% HASHDEEP-1.0
%%%% size,md5,filename
## Invoked from: C:\Documents and Settings\Administrator\My Documents\My Software\by tip\
## C:\> C:\DOCUME~1\ADMINI~1\MYDOCU~1\MYSOFT~1\BYTIP~1\hashdeep.exe -c MD5 -e C:\File.avi
## 
1468526592,993232f47d990bc0f815ba4367726af9,C:\File.avi

When I run the code with out $STDOUT_CHILD opt, I can read "File.avi: 50MB of 1400MB done, 00:00:26 left" on the command line window(updated every second). But when I enable $STDOUT_CHILD, the output(everything from the start to the end) is given at the end of the process like it is one complete message. Do you have an idea?

[center]MsgBox_Tipped: Eye candy msgboxes/inputboxes/loginboxes. | CreateBlankBox: Semi-transparent layers with borders and rounded corners.[/center]

Link to comment
Share on other sites

Hi to all, again,

I found out something new. When I run this code directly from commandline

hashdeep -c md5 -e "C:\File.avi" > 1.txt

I still see these lines in the commandline window: "File.avi: 1310MB of 1400MB done, 00:00:00 left"

And when everything is finished output to 1.txt is like this:

%%%% HASHDEEP-1.0
%%%% size,md5,filename
## Invoked from: C:\Hashdeep
## C:\> hashdeep -c md5 -e C:\File.avi
## 
4694479189,7707f090cd8c601eb63f663cdbed7372,"C:\File.avi"

There is nothing about progress info in the 1.txt.

I think it is related to how hashdeep.exe is coded. But is there a way to read progress info lines too?

Thanks again in advance.

Regards,

Tip

[center]MsgBox_Tipped: Eye candy msgboxes/inputboxes/loginboxes. | CreateBlankBox: Semi-transparent layers with borders and rounded corners.[/center]

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...