Hiding a file in a .jpg

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Kjodiz
Posts: 4
Joined: 21 Sep 2011 02:14

Hiding a file in a .jpg

#1 Post by Kjodiz » 21 Sep 2011 02:31

I've been working on a script which is supposed to hide a file in a .jpg, but i can't get it to work.

I've been looking through my code and can't find anything that's not right.

Could you please help me out?

Here's the code:

Code: Select all

@echo off

:Start

If Not Exist C:\HideMe goto DC
If not exist C:\HideMe\*.jpg goto NOJPG
If exist C:\HideMe\*.jpg goto TXTA

:TXTA
If exist C:\HideMe\*.txt goto TXTB
if not exist C:\HideMe\*.txt goto EXEA

:TXTB
Copy /b C:\HideMe\*.txt C:\HideMe\File.rar goto END

:EXEA
If Exist C:\HideMe\*.exe goto EXEB
If Not Exist C:\HideMe\*.exe goto RAR

:EXEB
Copy /b C:\HideMe\*.exe C:\HideMe\File.rar goto END

:RAR
If exist C:\HideMe\*.rar goto RAREND
If not exist C:\HideMe\*.rar goto BATA

:BATA
If exist C:\HideMe\*.bat goto BATB
If not exist C:\HideMe\*.bat goto VBSA

:BATB
Copy /b C:\HideMe\*.bat C:\HideMe\File.rar goto END

:VBSA
If exist C:\HideMe\*.vbs goto VBSB
If not exist C:\HideMe\*.vbs Goto MP3A

:VBSB
Copy /b C:\HideMe\*.vbs C:\HideMe\File.rar goto END

:MP3A
If exist C:\HideMe\*.mp3 goto MP3B
If not exist C:\HideMe\*.mp3 goto WAVA

:MP3B
Copy /b C:\HideMe\*.mp3 C:\HideMe\File.rar goto END

:WAVA
If exist C:\HideMe\*.wav goto WAVB
If not exist C:\HideMe\*.wav goto MP4A

:WAVB
Copy /b C:\HideMe\*.wav C:\HideMe\File.rar goto END

:MP4A
If exist C:\HideMe\*.mp4 goto MP4B
If not exist C:\HideMe\*.mp4 goto DLLA

:MP4B
Copy /b C:\HideMe\*.mp4 C:\HideMe\File.rar goto END

:DLLA
If exist C:\HideMe\*.dll goto DLLB
If not exist C:\HideMe\*.dll goto JPEGA

:DLLB
Copy /b C:\HideMe\*.dll C:\HideMe\File.rar goto END

:JPEGA
If exist C:\HideMe\*.jpeg goto JPEGB
If not exist C:\HideMe\*.jpeg goto PNGA

:JPEGB
Copy /b C:\HideMe\*.jpeg C:\HideMe\File.rar goto END

:PNGA
If exist C:\HideMe\*.png goto PNGB
If not exist C:\HideMe\*.png goto AU3A

:PNGB
Copy /b C:\HideMe\*.png C:\HideMe\File.rar goto END

:AU3A
If exist C:\HideMe\*.au3 goto AU3B
If not exist C:\HideMe\*.au3 goto PYA

:AU3B
Copy /b C:\HideMe\*.au3 C:\HideMe\File.rar goto END

:PYA
If exist C:\HideMe\*.py goto PYB
If not exist C:\HideMe\*.py goto HTMLA

:PYB
Copy /b C:\HideMe\*.py C:\HideMe\File.rar goto END

:HTMLA
If exist C:\HideMe\*.html goto HTMLB
If not exist C:\HideMe\*.html goto JSA

:HTMLB
Copy /b C:\HideMe\*.html C:\HideMe\File.rar goto END

:JSA
If exist C:\HideMe\*.js goto JSB
If not exist C:\HideMe\*.js goto VBA

:JSB
Copy /b C:\HideMe\*.js C:\HideMe\File.rar goto END

:VBA
If exist C:\HideMe\*.vb goto VBB
If not exist C:\HideMe\*.vb goto MSIA

:VBB
Copy /b C:\HideMe\*.vb C:\HideMe\File.rar goto END

:MSIA
If exist C:\HideMe\*.msi goto MSIB
If not exist C:\HideMe\*.msi goto DONE

:MSIB
Copy /b C:\HideMe\*.msi C:\HideMe\File.rar goto END

:DC
mkdir C:\HideMe
Msg * Please read the .txt (Readme.txt)
exit

:NOJPG
msg * No .jpg found in C:\HideMe
Msg * Please read the .txt (ReadMe.txt)
exit

:DONE
Msg * Your file was not found
exit

:RAREND
Copy /b C:\HideMe\*rar + C:\HideMe\*.jpg Secureshit.jpg
Msg * Your Hiding Is Done :)
Exit

:END
Copy /b C:\HideMe\File.rar + C:\HideMe\*.jpg C:\HideMe\SecureShit.jpg
msg * Your Hiding Is Done :)
exit

Ed Dyreen
Expert
Posts: 1569
Joined: 16 May 2011 08:21
Location: Flanders(Belgium)
Contact:

Re: Hiding a file in a .jpg

#2 Post by Ed Dyreen » 21 Sep 2011 02:54

'

Code: Select all

@echo off

:Start ()
::(
  if not exist "C:\HideMe\" (
    ::
    goto :DC "()"

  ) else if exist "C:\HideMe\*.jpg" (
    ::
    goto :TXTA "()"

  ) else if exist "C:\HideMe\*.jpg" (
    ::
    goto :NOJPG "()"
  )
::)

:TXTA ()
::(
  if exist "C:\HideMe\*.txt" (
    ::
    goto :TXTB "()"
  ) else goto :EXEA "()"
::)

I stop here because I doubt next copy will work like that ??!
:TXTB ()
::(
  copy /b "C:\HideMe\*.txt" "C:\HideMe\File.rar"

Kjodiz
Posts: 4
Joined: 21 Sep 2011 02:14

Re: Hiding a file in a .jpg

#3 Post by Kjodiz » 21 Sep 2011 02:58

So you're saying I can't continue with more filenames?

Ed Dyreen
Expert
Posts: 1569
Joined: 16 May 2011 08:21
Location: Flanders(Belgium)
Contact:

Re: Hiding a file in a .jpg

#4 Post by Ed Dyreen » 21 Sep 2011 03:02

'
You are correct, it works like that, didn't know :)

Kjodiz
Posts: 4
Joined: 21 Sep 2011 02:14

Re: Hiding a file in a .jpg

#5 Post by Kjodiz » 21 Sep 2011 03:12

So for it to check all kinds of files, i have to make another .bat for each filetype?

so it would be something like:

Code: Select all

@echo off

:Start

If Not Exist C:\HideMe goto DC
If not exist C:\HideMe\*.jpg goto NOJPG
If exist C:\HideMe\*.jpg goto TXTA

:TXTA
If exist C:\HideMe\*.txt goto TXTB
if not exist C:\HideMe\*.txt start exe.bat


etc..

nitt
Posts: 218
Joined: 22 Apr 2011 02:43

Re: Hiding a file in a .jpg

#6 Post by nitt » 22 Sep 2011 17:13

Just an FYI, you can store files in any image format (JPG, PNG, GIF, etc...) and any music format (MP3, WAV, WMA, etc...). You can store any compressed folder format, such as ZIP, TAR, RAR, etc...

Kjodiz
Posts: 4
Joined: 21 Sep 2011 02:14

Re: Hiding a file in a .jpg

#7 Post by Kjodiz » 23 Sep 2011 05:45

Found out how to do it :)

Had to use a little bit of AutoIt tho ^^

Post Reply