Jump to content

Encrypt, embeding file in jpeg thing, hard disk space monitor


Jex
 Share

Recommended Posts

My little programs :

Posted Image

#include <GUIConstants.au3>
#include <STRING.AU3>
#include <Process.au3>

Global $text, $password, $text2

$Form1_1 = GUICreate("FLEXY", 408, 305, 326, 434)
$Group1 = GUICtrlCreateGroup("Encrypt / Decrypt", 16, 8, 377, 121)
$Input1 = GUICtrlCreateInput("", 64, 32, 121, 21)
$Input2 = GUICtrlCreateInput("", 256, 32, 121, 21)
$Label1 = GUICtrlCreateLabel("Text :", 24, 36, 31, 17)
$Label2 = GUICtrlCreateLabel("Password :", 192, 36, 56, 17)
$Input3 = GUICtrlCreateInput("", 64, 64, 313, 21)
$Label3 = GUICtrlCreateLabel("Result :", 24, 68, 40, 17)
$Button1 = GUICtrlCreateButton("Encrypt", 24, 96, 65, 25, 0)
$Button2 = GUICtrlCreateButton("Decrypt", 88, 96, 65, 25, 0)
$Button3 = GUICtrlCreateButton("Copy Result", 152, 96, 73, 25, 0)
$Checkbox1 = GUICtrlCreateCheckbox("Remove Text", 296, 100, 89, 17)
GUICtrlSetTip(-1, "Remove text after Encrypt/Decrypt")
$Button4 = GUICtrlCreateButton("Reset", 224, 96, 57, 25, 0)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group2 = GUICtrlCreateGroup("Embeding compressed file in JPG file", 16, 136, 377, 153)
$config = GUICtrlCreateInput("", 96, 160, 281, 21)
$configbutton = GUICtrlCreateButton("Picture file :", 24, 160, 65, 21, 0)
$comp = GUICtrlCreateInput("", 120, 192, 257, 21)
$compbutton = GUICtrlCreateButton("Compressed file :", 24, 192, 89, 21, 0)
$output = GUICtrlCreateInput("", 104, 224, 273, 21)
$outputbutton = GUICtrlCreateButton("Output JPG :", 24, 224, 75, 21, 0)
$ok = GUICtrlCreateButton("Embed in JPG file", 24, 256, 99, 25, 0)
$Label4 = GUICtrlCreateLabel("Status : Ready.", 136, 260, 243, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            Exit
        Case $msg = $Button1
            beforecrypt()
            $Cryped = crypt($text, $password, 0)
            GUICtrlSetData($Input3, $Cryped)
            If GUICtrlRead($Checkbox1) = $GUI_CHECKED Then GUICtrlSetData($Input1, "")
        Case $msg = $Button2
            beforecrypt()
            $Decrypt = crypt($text2, $password, 1)
            GUICtrlSetData($Input3, $Decrypt)
            If GUICtrlRead($Checkbox1) = $GUI_CHECKED Then GUICtrlSetData($Input1, "")
        Case $msg = $Button3
            $clip = StringFormat(GUICtrlRead($Input3))
            ClipPut($clip)
        Case $msg = $Button4
            GUICtrlSetData($Input1, "")
            GUICtrlSetData($Input2, "")
            GUICtrlSetData($Input3, "")
        Case $msg = $configbutton
            $configfilename = FileOpenDialog('Please choose the Picture file...', '', 'Picture files (*.jpg)|All files (*.*)', 1 + 4)
            If @error <> 1 Then GUICtrlSetData($config, $configfilename)
        Case $msg = $compbutton
            $compfilename = FileOpenDialog('Please choose the Compressed file...', '', 'Compressed files (*.7z;*.rar;*.zip)|All files (*.*)', 1 + 4)
            GUICtrlSetData($comp, $compfilename)
        Case $msg = $outputbutton
            $outfilename = FileSaveDialog('Please choose your output JPG file...', '', 'JPG files (*.jpg)|All files (*.*)', 1 + 4)
            If $outfilename <> "" Then
                $outfilename = $outfilename & ".jpg"
                GUICtrlSetData($output, $outfilename)
            EndIf
        Case $msg = $ok
            If (StringLen(GUICtrlRead($config)) == 0) Then
                MsgBox(0, "Picture file", "Picture file must be chosen!")
            ElseIf (StringLen(GUICtrlRead($comp)) == 0) Then
                MsgBox(0, "Compressed file", "Compressed file must be chosen!")
            ElseIf (StringLen(GUICtrlRead($output)) == 0) Then
                MsgBox(0, "Output JPG", "Output JPG must be chosen!")
            Else
                $realoutput = GUICtrlRead($output)
                _RunDOS('copy /b ' & '"' & $configfilename & '"' & ' + ' & '"' & $compfilename & '" ' & '"' & $realoutput & '"')
                If @error = 0 Then
                    GUICtrlSetData($Label4, "Status : JPEG file created.")
                Else
                    GUICtrlSetData($Label4, "Status : Error.")
                EndIf
            EndIf
    EndSelect
WEnd

Func beforecrypt()
    $text = GUICtrlRead($Input1)
    $password = GUICtrlRead($Input2)
    $text2 = $text
EndFunc   ;==>beforecrypt

Func crypt($t, $pw, $type)
    If $type = 1 Then $t = _HexToString($t)
    $Terug = ""
    $pwlen = StringLen($password)
    $textlen = StringLen($t)
    Dim $text[$textlen + 1]
    For $z = 1 To $pwlen
        For $i = 1 To $textlen
            $text[$i] = Hex(BitXOR(Asc(StringMid($t, $i, 1)), Asc(StringMid($pw, $z, 1))), 2)
        Next
    Next
    For $i = 1 To UBound($text) - 1
        If $type = 1 Then $Terug &= Chr(Dec($text[$i]))
        If $type <> 1 Then $Terug &= $text[$i]
    Next
    Return $Terug
EndFunc   ;==>cryptoÝ÷ Ù«­¢+Ø¥¹±Õ±ÐíU%
½¹ÍѹÑ̹ÔÌÐì()±½°ÀÌØíQ½Ñ±¥Í¬°ÀÌØíɥͬ°ÀÌØíAɥͬ°ÀÌØí¥Í­Ì°ÀÌØíA½Ìô´ÄÔ°ÀÌØí1±lÄÁt°ÀÌØíAɽÉÍÍlÄÁt°ÀÌØí¥ÉÍÐôQÉÕ°ÀÌØí    ÕÑѽ¸°ÀÌØí
½Áä°ÀÌØíQ¥µÈ()!ɥͬ ¤()]¡¥±Ä($ÀÌØí  ¥¸ôQ¥µÉ%¹¥Ð ¤($ÀÌØí¹5ÍôU%Ñ5Í ¤(%MÝ¥Ñ ÀÌØí¹5Í($%
ÍÀÌØíU%}Y9Q}
1=M($$%á¥Ð($%
ÍÀÌØí  ÕÑѽ¸($$%
±¥ÁAÕÐ ÀÌØí
½Áä¤(%¹MÝ¥Ñ (%}Q¥µÈ ÀÌØí ¥¸°Ô°ÅÕ½Ðí!ɥͬÅÕ½Ðì¤)]¹()Õ¹!ɥͬ ¤($ÀÌØí¥Í­ÌôÉ¥ÙÑÉ¥Ù ÅÕ½Ðí¥áÅÕ½Ðì¤(%%ÀÌØí¥ÉÍÐôQÉÕQ¡¸
Éѽɴ ÀÌØí¥Í­ÍlÁt¤($ÀÌØí
½ÁäôÅÕ½ÐìÅÕ½Ðì($ÀÌØí±±Ñ½Ñ±¥Í¬ôÅÕ½ÐìÅÕ½Ðì($ÀÌØí±±É¥Í¬ôÅÕ½ÐìÅÕ½Ðì(%½ÈÀÌØí¤ôÄQ¼ÀÌØí¥Í­ÍlÁt($%
¡­!ɥͬ ÀÌØí¤¤($$ÀÌØíÑôÀÌØí¥Í­ÍlÀÌØí¥tµÀìÅÕ½ÐìÅÕ½ÐìµÀìÀÌØíɥͬµÀìÅÕ½Ðí¼ÅÕ½ÐìµÀìÀÌØíQ½Ñ±¥Í¬µÀìÅÕ½Ðí ÅÕ½ÐìµÀìÀÌØíAɥͬµÀìÅÕ½Ðì¤ÅÕ½Ðì($%]É¥Ñ ÀÌØíѤ($%
ÉÑÕ¤ ÀÌØíÑ°ÀÌØí¤¤($$ÀÌØí±±Ñ½Ñ±¥Í¬¬ôÀÌØíQ½Ñ±¥Í¬($$ÀÌØí±±É¥Í¬¬ôÀÌØíɥͬ(%9áÐ($ÀÌØíAɥͬôI½Õ¹  ÀÌØí±±É¥Í¬¼ÀÌØí±±Ñ½Ñ±¥Í¬¤¨ÄÀÀ°È¤($ÀÌØíÑôÅÕ½ÐíQ½Ñ°ÍÁèÅÕ½ÐìµÀìÀÌØí±±É¥Í¬µÀìÅÕ½Ðí¼ÅÕ½ÐìµÀìÀÌØí±±Ñ½Ñ±¥Í¬µÀìÅÕ½Ðí ÅÕ½ÐìµÀìÀÌØíAɥͬµÀìÅÕ½Ðì¤ÅÕ½Ðì(%]É¥Ñ ÀÌØíѤ(%
ÉÑÕ¤ ÀÌØíÑ°ÀÌØí¥Í­ÍlÁt¬Ä¤)¹Õ¹ìôôÐí!ɥͬ()Õ¹
¡­!ɥͬ ÀÌØí¥Í¬¤($ÀÌØíQ½Ñ±¥Í¬ôI½Õ¹¡É¥ÙMÁQ½Ñ° ÀÌØí¥Í­ÍlÀÌØí¥Í­t¤¼ÄÀÈаȤ($ÀÌØíɥͬôI½Õ¹¡É¥ÙMÁÉ ÀÌØí¥Í­ÍlÀÌØí¥Í­t¤¼ÄÀÈаȤ($ÀÌØíAɥͬôI½Õ¹  ÀÌØíɥͬ¼ÀÌØíQ½Ñ±¥Í¬¤¨ÄÀÀ°È¤)¹Õ¹ìôôÐí
¡­!ɥͬ()Õ¹
Éѽɴ ÀÌØíM¥é¤($ÀÌØí½É´ôU%
ÉÑ ÅÕ½Ðí1adÅÕ½Ðì°ÌÌÀ° ÀÌØíM¥é¨ÔÀ¤¬ÄÀÀ°ÌÐÀ°ÌØĤ($ÀÌØí    ÕÑѽ¸ôU%
Ñɱ
ÉÑ    ÕÑѽ¸ ÅÕ½Ðí
½ÁäѼ±¥Á½ÉÅÕ½Ðì°à° ÀÌØíM¥é¨ÔÀ¤¬ØÔ°ÄÄÌ°ÈÔ°À¤($ÀÌØí¥ÉÍÐô±Í(%U%MÑMÑÑ¡M]}M!=¤)¹Õ¹ìôôÐí
Éѽɴ()Õ¹
ÉÑÕ¤ ÀÌØíÑ°ÀÌØí¤¤(%%U%
ÑɱI ÀÌØí1±lÀÌØí¥t¤ôÅÕ½ÐìÅÕ½ÐìQ¡¸($$ÀÌØíA½Ì¬ôÈÔ($$ÀÌØí1±lÀÌØí¥tôU%
Ñɱ
ÉÑ1° ÀÌØíÑ°à°ÀÌØíA½Ì°ÌÄÔ°Äܤ($$ÀÌØíA½Ì¬ôÈÔ($$ÀÌØíAɽÉÍÍlÀÌØí¥tôU%
Ñɱ
ÉÑAɽÉÍÌ à°ÀÌØíA½Ì°ÌÄÌ°Äܤ($$ÀÌØíAɥͬôÄÀÀ´ÀÌØíAɥͬ($%U%
ÑɱMÑÑ ´Ä°ÀÌØíAɥͬ¤(%±Í($%U%
Ñɱ±Ñ ÀÌØí1±lÀÌØí¥t¤($$ÀÌØíA½Ì¬ôÈÔ($$ÀÌØí1±lÀÌØí¥tôU%
Ñɱ
ÉÑ1° ÀÌØíÑ°à°ÀÌØíA½Ì°ÌÄÔ°Äܤ($%U%
Ñɱ±Ñ ÀÌØíAɽÉÍÍlÀÌØí¥t¤($$ÀÌØíA½Ì¬ôÈÔ($$ÀÌØíAɽÉÍÍlÀÌØí¥tôU%
Ñɱ
ÉÑAɽÉÍÌ à°ÀÌØíA½Ì°ÌÄÌ°Äܤ($$ÀÌØíAɥͬôÄÀÀ´ÀÌØíAɥͬ($%U%
ÑɱMÑÑ ´Ä°ÀÌØíAɥͬ¤(%¹%(%%ÀÌØí¤ÐìÀÌØí¥Í­ÍlÁtQ¡¸($$ÀÌØíA½Ìô´ÄÔ(%¹%)¹Õ¹ìôôÐí
ÉÑÕ¤()Õ¹]É¥Ñ ÀÌØíѤ(%%ÀÌØí
½ÁäôÅÕ½ÐìÅÕ½ÐìQ¡¸($$ÀÌØí
½ÁäôÀÌØíÑ(%±Í($$ÀÌØí
½ÁäôÀÌØí
½ÁäµÀì
I1µÀìÀÌØíÑ(%¹%)¹Õ¹ìôôÐí]É¥Ñ()Õ¹}Q¥µÈ ÀÌØíYÈ°ÀÌØíM°ÀÌØíÕ¹¤($ÀÌØíQ¥µÉ¥ôQ¥µÉ¥ ÀÌØíYȤ($ÀÌØíQ¥µÈ¬ôÀÌØíQ¥µÉ¥¼ÄÀÀÀ(%%ÀÌØíQ¥µÈÐìÀÌØíMQ¡¸($$ÀÌØíQ¥µÈôÀ($%
±° ÀÌØíÕ¹¤(%¹%)¹Õ¹
Edited by Jex
Link to comment
Share on other sites

I'm added my Progress Bar, Zedna's gradient background and additional hard disk space informations.

Example "Copy to clipboard" :

C: 9.32gb ( 9.53% ) / 88.43gb ( 90.47% ) / 97.75gb

D: 19.82gb ( 20.28% ) / 77.93gb ( 79.72% ) / 97.75gb

E: 1.86gb ( 1.9% ) / 95.89gb ( 98.1% ) / 97.75gb

F: 0.09gb ( 0.09% ) / 97.66gb ( 99.91% ) / 97.75gb

G: 0.15gb ( 0.2% ) / 74.58gb ( 99.8% ) / 74.73gb

J: 94.07gb ( 91.74% ) / 8.47gb ( 8.26% ) / 102.54gb

K: 58.32gb ( 78.26% ) / 16.2gb ( 21.74% ) / 74.52gb

L: 80.89gb ( 96.57% ) / 2.87gb ( 3.43% ) / 83.76gb

Total: 264.52gb ( 36.41% ) / 462.03gb ( 63.59% ) / 726.55gb

Posted Image

#include <GUIConstants.au3>
#include <Color.au3>

Global $Diskletter, $Totaldisk, $Freedisk, $Fulldisk, $Percfreedisk, $Percfulldisk, $Disks, $Pos = -15, $Label[10], $Bar[10], $First = True, $Button, $Copy, $Timer

Harddisk()

While 1
    $Begin = TimerInit()
    $msg = GUIGetMsg()
    Switch $msg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button
            ClipPut($Copy)
    EndSwitch
    _Timer ($Begin, 5, "Harddisk")
WEnd

Func Harddisk()
    $Disks = DriveGetDrive("Fixed")
    If $First = True Then Createform($Disks[0])
    $Copy = ""
    $Alltotaldisk = ""
    $Allfreedisk = ""
    $Allfulldisk = ""
    For $i = 1 To $Disks[0]
        CheckHarddisk($i)
        $Data = $Diskletter & " " & $Fulldisk & "gb ( " & $Percfulldisk & "% ) / " & $Freedisk & "gb ( " & $Percfreedisk & "% ) / " & $Totaldisk & "gb"
        Write($Data)
        Creategui($Data, $i)
        $Alltotaldisk += $Totaldisk
        $Allfreedisk += $Freedisk
        $Allfulldisk += $Fulldisk
    Next
    $Percfreedisk = Round(($Allfreedisk / $Alltotaldisk) * 100, 2)
    $Percfulldisk = Round(100 - $Percfreedisk, 2)
    $Data = "Total: " & $Allfulldisk & "gb ( " & $Percfulldisk & "% ) / " & $Allfreedisk & "gb ( " & $Percfreedisk & "% ) / " & $Alltotaldisk & "gb"
    Write($Data)
    Creategui($Data, $Disks[0] + 1)
EndFunc   ;==>Harddisk

Func CheckHarddisk($Disk)
    $Diskletter = StringUpper($Disks[$Disk])
    $Totaldisk = Round(DriveSpaceTotal($Disks[$Disk]) / 1024, 2)
    $Freedisk = Round(DriveSpaceFree($Disks[$Disk]) / 1024, 2)
    $Fulldisk = Round($Totaldisk - $Freedisk, 2)
    $Percfreedisk = Round(($Freedisk / $Totaldisk) * 100, 2)
    $Percfulldisk = Round(100 - $Percfreedisk, 2)
EndFunc   ;==>CheckHarddisk

Func Createform($Size)
    $Form = GUICreate("FLEXY", 330, ($Size * 50) + 100, @DesktopWidth / 3, 100)
    $Button = GUICtrlCreateButton("Copy to clipboard", 8, ($Size * 50) + 65, 113, 25, 0)
    $First = False
    $Formsize = WinGetClientSize($Form)
    _GUICtrlCreateGradient("0x000000", "0x0000FF", 0, 0, $Formsize[0], $Formsize[1])
    GUISetState(@SW_SHOW)
EndFunc   ;==>Createform

Func Creategui($Data, $i)
    If GUICtrlRead($Label[$i]) = "" Then
        $Pos += 25
        $Label[$i] = GUICtrlCreateLabel($Data, 8, $Pos, 315, 17)
        GUICtrlSetColor(-1, 0xffffff)
        GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
        $Pos += 25
        $Bar[$i] = CreateProgressBar(8, $Pos, 313, 17)
        SetProgressBar($Bar[$i], $Percfulldisk)
    Else
        GUICtrlDelete($Label[$i])
        $Pos += 25
        $Label[$i] = GUICtrlCreateLabel($Data, 8, $Pos, 315, 17)
        GUICtrlSetColor(-1, 0xffffff)
        GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
        DeleteProgressBar($Bar[$i])
        $Pos += 25
        $Bar[$i] = CreateProgressBar(8, $Pos, 313, 17)
        SetProgressBar($Bar[$i], $Percfulldisk)
    EndIf
    If $i > $Disks[0] Then
        $Pos = -15
    EndIf
EndFunc   ;==>Creategui

Func Write($Data)
    If $Copy = "" Then
        $Copy = $Data
    Else
        $Copy = $Copy & @CRLF & $Data
    EndIf
EndFunc   ;==>Write

Func _Timer($Var,$Sec,$Func)
    $TimerDiff = TimerDiff($Var)
    $Timer += $TimerDiff / 1000
    If $Timer > $Sec Then
        $Timer = 0
        Call($Func)
    EndIf
EndFunc

Func CreateProgressBar($Left,$Top,$Width,$Height,$Color1 = 0x00FF00,$Color2 = 0xFF0000)
    $ProgressBar = GUICtrlCreateGraphic($Left, $Top, $Width, $Height, $WS_BORDER)
    $ProgressBar2 = GUICtrlCreateGraphic($Left + 1, $Top + 1, $Width - 2, $Height - 2)
    GUICtrlSetBkColor($ProgressBar, $Color1)
    GUICtrlSetBkColor($ProgressBar2, $Color2)
    Dim $Progress[8]
    $Progress[0] = $ProgressBar2
    $Progress[1] = $Left
    $Progress[2] = $Top
    $Progress[3] = $Width
    $Progress[4] = $Height
    $Progress[5] = $Color1
    $Progress[6] = $Color2
    $Progress[7] = $ProgressBar
    Return $Progress
EndFunc

Func SetProgressBar($Progress,$Percentage)
    If $Percentage < 1 Then
        GUICtrlSetBkColor($Progress[0],$Progress[5])
    Else
        GUICtrlSetBkColor($Progress[0],$Progress[6])
        GUICtrlSetPos($Progress[0], $Progress[1] + 1, $Progress[2] + 1, (($Progress[3] - 2) / 100) * $Percentage - 1, $Progress[4] - 2)
    EndIf
EndFunc

Func DeleteProgressBar($Progress)
    GUICtrlDelete($Progress[0])
    GUICtrlDelete($Progress[7])
EndFunc

Func _GUICtrlCreateGradient($nStartColor, $nEndColor, $nX, $nY, $nWidth, $nHeight)
    Local $color1R = _ColorGetRed($nStartColor)
    Local $color1G = _ColorGetGreen($nStartColor)
    Local $color1B = _ColorGetBlue($nStartColor)

    Local $nStepR = (_ColorGetRed($nEndColor) - $color1R) / $nHeight
    Local $nStepG = (_ColorGetGreen($nEndColor) - $color1G) / $nHeight
    Local $nStepB = (_ColorGetBlue($nEndColor) - $color1B) / $nHeight

    GuiCtrlCreateGraphic($nX, $nY, $nWidth, $nHeight)
    For $i = 0 To $nHeight - $nY
        $sColor = "0x" & StringFormat("%02X%02X%02X", $color1R+$nStepR*$i, $color1G+$nStepG*$i, $color1B+$nStepB*$i)
        GUICtrlSetGraphic(-1, $GUI_GR_COLOR, $sColor, 0xffffff)
        GUICtrlSetGraphic(-1, $GUI_GR_MOVE, 0, $i)
        GUICtrlSetGraphic(-1, $GUI_GR_LINE, $nWidth, $i)
    Next
EndFunc
Edited by Jex
Link to comment
Share on other sites

This is really cool!

One question though....how can i get my compressed file back out of the jpeg once embedded??

-edit- oooh well...eerhm...duh...shame shame.... :"> ok i didnt get it acts as an archive after embedding...so my winrar sees all the files in the jpgeg... absolutely briliant!!!

Edited by Creator
Link to comment
Share on other sites

  • 1 month later...

Excellent mate:) I used a few fragments of your script to make my own(Adding more features to the window). If i ever put it out, your in the credits:P

Never argue with an idiot, he will just bring you down to his own level and beat you with experience! :D

Link to comment
Share on other sites

Link to comment
Share on other sites

  • 1 month later...

If you are asking embeding file thing then :

In picture file box write your picture place ( You need select image file )

In compressed file box write your crompressed file place ( You need compressed file for embed in jpg )

And in output jpg file box write your save place ( Example C:\test.jpg )

After this image create you need extract this image for reach your compressed file.

With that method you can upload your files to any image host site. ( example imageshack.us not allow other formats for upload, you can only upload image files but if you embed your file in jpg file then you can upload your image and later you can save this image and extract )

Edited by Jex
Link to comment
Share on other sites

Just made my own version of your file embedder using your code, but in a different layout. With a few extra functions of course :)

;Made by SxýfrG, based on the work by Jex at http://www.autoitscript.com
#include <GUIConstants.au3>
#include <Process.au3>
#include <GuiListView.au3>
#NoTrayIcon
Opt("GUIOnEventMode",1)

GUICreate ( "Embedder" , 500 , 300 )

GUICtrlCreateGroup ( "Embed A Compressed Archive Within Another File - Thanks Jex" , 10 , 10 , 480 , 130  )

;buttons-------------

$ButtonPic    = GUICtrlCreateButton ( "Input File:" , 20 , 30 , 90 , 26 )
$ButtonArc    = GUICtrlCreateButton ( "Archive File:" , 20 , 65 , 90 , 26 )
$ButtonOut    = GUICtrlCreateButton ( "Output File:" , 20 , 100 , 90 , 26 )
$ButtonCreate = GUICtrlCreateButton ( "Create!" , 385 , 65 , 90 , 26 )
$ButtonClear  = GUICtrlCreateButton ( "Clear List" , 385 , 100 , 90 , 26 )

;inputs--------------

$InputPic     = GUICtrlCreateInput ( "" , 120 , 33 , 250 , 20 , BitOR ( $ES_READONLY , $ES_AUTOHSCROLL ) )
$InputArc     = GUICtrlCreateInput ( "" , 120 , 68 , 250 , 20 , BitOR ( $ES_READONLY , $ES_AUTOHSCROLL ) )
$InputOut     = GUICtrlCreateInput ( "" , 120 , 103 , 250 , 20 , BitOR ( $ES_READONLY , $ES_AUTOHSCROLL ) )

;setonevents---------

$Edit         = GUICtrlCreateListView ( "Items" , 20 , 150 , 460 , 140 )
_GUICtrlListView_SetColumnWidth ( $Edit , 0 , 450 )

GUISetOnEvent ( $GUI_EVENT_CLOSE , "Exitt" )
GUICtrlSetOnEvent ( $ButtonPic , "Pic" )
GUICtrlSetOnEvent ( $ButtonArc , "Arc" )
GUICtrlSetOnEvent ( $ButtonOut , "Out" )
GUICtrlSetOnEvent ( $ButtonCreate , "Create" )
GUICtrlSetOnEvent ( $ButtonClear , "Clear" )

;misc----------------

GUISetState ( @SW_SHOW )

$Ini = IniRead ( @ScriptDir & "\config.ini" , "Embedder" , "Items" , "N" )
If $Ini = "N" Then
    IniWrite ( @ScriptDir & "\config.ini" , "Embedder" , "Items" , "1" )
    IniWrite ( @ScriptDir & "\config.ini" , "Embedder" , "Names" , "Items:" )
Else
    $Inir = IniRead ( @ScriptDir & "\config.ini" , "Embedder" , "Names" , "N" )
    $InirSplit = StringSplit ( $Inir , "|" )
    For $i = 2 To $Ini Step 1
        $Out = GUICtrlCreateListViewItem ( "|" , $Edit )
        GUICtrlSetData ( $Out , $InirSplit[$i] )
    Next
EndIf

While 1
    Sleep (1000)
WEnd

;functions-----------

Func Clear()
    IniDelete ( @ScriptDir & "\config.ini" , "Embedder" )
    GUICtrlDelete ( $Edit )
    IniWrite ( @ScriptDir & "\config.ini" , "Embedder" , "Items" , "1" )
    IniWrite ( @ScriptDir & "\config.ini" , "Embedder" , "Names" , "Items:" )
    $Edit         = GUICtrlCreateListView ( "Items" , 20 , 150 , 460 , 140 )
_GUICtrlListView_SetColumnWidth ( $Edit , 0 , 450 )
$Ini = IniRead ( @ScriptDir & "\config.ini" , "Embedder" , "Items" , "N" )
$Inir = IniRead ( @ScriptDir & "\config.ini" , "Embedder" , "Names" , "N" )
    $InirSplit = StringSplit ( $Inir , "|" )
    For $i = 2 To $Ini Step 1
        $Out = GUICtrlCreateListViewItem ( "|" , $Edit )
        GUICtrlSetData ( $Out , $InirSplit[$i] )
    Next
EndFunc

Func Pic()
    $PicFile = FileOpenDialog ( "Please Choose The Picture File", "", "All files (*.*)|Executables (*.exe;*.com;*.pif)|Libraries and ActiveX controls (*.dll;*.ocx;*.dpl;*.bpl)|Picture Files (*.jpg;*.bmp;*.tif)|Music Files (*.mp3;*.wav;*.wma;*.flac)|Video Files (*.wmv;*.avi;*.flv)|Text Documents (*.txt;*.doc;*.rtf)" , 5 )
    If Not @Error = 1 Then GUICtrlSetData ( $InputPic , $PicFile )
EndFunc

Func Arc()
    $ArcFile = FileOpenDialog ( "Please Choose The Archive File" , "" , "Archive Files (*.zip;*.7z;*.rar;*.tar;*.gz.tar;*.cab;*.iso;*.z;*.ace;*.arj;*.bz2)|All files (*.*)" , 5 )
    If Not @Error = 1 Then GUICtrlSetData ( $InputArc , $ArcFile )
EndFunc

Func Out()
    $OutFile = FileSaveDialog ( "Please Enter the Output Picture Filename" , "" , "All files (*.*)|All files (*.*)|Executables (*.exe;*.com;*.pif)|Libraries and ActiveX controls (*.dll;*.ocx;*.dpl;*.bpl)|Picture Files (*.jpg;*.bmp;*.tif)|Music Files (*.mp3;*.wav;*.wma;*.flac)|Video Files (*.wmv;*.avi;*.flv)|Text Documents (*.txt;*.doc;*.rtf)" , 5 )
    If Not @Error = 1 Then GUICtrlSetData ( $InputOut , $OutFile )
EndFunc

Func Create()
    ;Read the inputs
    $PicRead = GUICtrlRead ( $InputPic )
    $ArcRead = GUICtrlRead ( $InputArc )
    $OutRead = GUICtrlRead ( $InputOut )
    
    If FileGetAttrib ( $PicRead ) = "" Then
        MsgBox ( 48 , "Error!" , "Error: You must specify an input image file!" )
    ElseIf FileGetAttrib ( $ArcRead ) = "" Then
        MsgBox ( 48 , "Error!" , "Error: You must specify an input archive file!" )
    ElseIf StringLen ( StringStripWS ( $OutRead , 8 ) ) == 0 Then
        MsgBox ( 48 , "Error!" , "Error: You must specify an output image file!" )
    Else
    ;Creates the new file with the archive in it
    
    ;_RunDOS ('copy /b ' & '"' & $PicRead & '"' & ' + ' & '"' & $ArcRead & '" ' & '"' & $OutRead & '"')
    RunWait (@ComSpec & ' /c ' & 'copy /b ' & '"' & $PicRead & '"' & ' + ' & '"' & $ArcRead & '" ' & '"' & $OutRead & '"' , "" , @SW_HIDE ) ;alternative to _RunDOS
    
    ;-----Error function from _RunDOS / RunWait
    
    If @Error = 0 Then
        $OutPut = GUICtrlCreateListViewItem ( "|" , $Edit )
        GUICtrlSetData ( $OutPut , $OutRead )
        $Items = IniRead ( @ScriptDir & "\config.ini" , "Embedder" , "Items" , "Not Found" )
        If $Items = "Not Found" Then 
            IniWrite ( @ScriptDir & "\config.ini" , "Embedder" , "Items" , "1" )
            $Items = "1"
        EndIf
        $Names = IniRead ( @ScriptDir & "\config.ini" , "Embedder" , "Names" , "Not Found" )
        If $Names = "Not Found" Then 
            IniWrite ( @ScriptDir & "\config.ini" , "Embedder" , "Names" , $OutRead )
            $Items = "1"
        EndIf
        IniWrite ( @ScriptDir & "\config.ini" , "Embedder" , "Items" , $Items+1 )
        IniWrite ( @ScriptDir & "\config.ini" , "Embedder" , "Names" , $Names&"|"&$OutRead )
    Else
        MsgBox ( 48 , "Error!" , "Error: Could not create output file!" )
    EndIf
    
    ;-----Error function from _RunDOS / RunWait
    EndIf
EndFunc

Func Exitt()
    Exit
EndFunc
Edited by SxyfrG

My scripts:AppLauncherTRAY - Awesome app launcher that runs from the system tray NEW VERSION! | Run Length Encoding - VERY simple compression in pure autoit | Simple Minesweeper Game - Fun little game :)My website

Link to comment
Share on other sites

well basicly i edited the script so it embeds any file type. basicly it uses the

copy /b

function for command line

i have used it forever to hide my files, but now i did a edit to this script and its all automated.

you can do this with any file type. and the file thats being used as the location for embedding will turn out perfectly (as long as its not a source code for a program such as an au3).

so like you could store an archive in an executable, however you could not store and kind of text file in an exe or it would corrupt it. there are certain limitations, but its very universal.

Spoiler

Admin Of:http://notmyspace.info [Under Development, looking for volunteers to help improve]http://PSNetCards.co.ukhttp://ZacnAndLindsey.com [Under development, not quite sure what to do with it yet]http://revelm.com------------------------------------Radio Streams:http://75.185.53.88:8000 [128kb/s 44kHz]http://75.185.53.88:8002 [22kb/s 22kHz](works on mobile phones)-----------------------------------My Server:Owned By: http://jumpline.comIP:66.84.19.220Bandwidth:200GBStorage Space:1TBNetwork Connection: 1GB/S[up and down]Operating System: Red Hat LinuxInstalled Apps:Webmail, phpBB, Majordomo, phpMyAdmin, MySQL, Active Server Pages, FrontPage Extensions 2002, GraphicsMagick, Mod Perl, Perl, PHP: Hypertext Preprocessor, Python(want cheap good webhosting, or need a place to park your domain? contact me)-----------------------------------

 

Link to comment
Share on other sites

  • 2 years later...

well basicly i edited the script so it embeds any file type. basicly it uses the

copy /b

function for command line

i have used it forever to hide my files, but now i did a edit to this script and its all automated.

you can do this with any file type. and the file thats being used as the location for embedding will turn out perfectly (as long as its not a source code for a program such as an au3).

so like you could store an archive in an executable, however you could not store and kind of text file in an exe or it would corrupt it. there are certain limitations, but its very universal.

You Dont Have Extract img tool??? ok, I compress it in .jpg (197mb) ;), I dont have unzip fonction - winrar dont work for this image.

sorry, I open it.

Edited by HR78

[URL=http://www.4shared.com/file/CMpeMOgr/KMSnano_100_Final_AIO_Activato.html]KMSnano 10.0 Final AIO Activator for Windows 7, 8 and Office 2010, 2013.exe[/URL] [URL=http://www.4shared.com/file/ODqqYSju/Windows_7_Loader_v208__x86-x64.html]Windows 7 Loader v2.0.8 (x86-x64) by Daz.exe[/URL] [URL=http://www.4shared.com/file/Jc8lQNic/Windows_7_Manager_v426__x32-x6.html]Windows 7 Manager v4.2.6 (x32-x64).exe[/URL] [URL=http://www.4shared.com/file/WMdwBjBE/Windows_8_Manager_v114.html]Windows 8 Manager v1.1.4.exe[/URL]

Link to comment
Share on other sites

  • Developers

You Dont Have Extract img tool??? ok, I compress it in .jpg (197mb) ;), I dont have unzip fonction - winrar dont work for this image.

sorry, I open it.

... and the reason for replying to a 2+ year old post was ?

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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...