comment
IRC Chat
play_arrow
Este sitio utiliza cookies propias y de terceros. Si continúa navegando consideramos que acepta el uso de cookies. OK Más Información.

[HTA+VBS] Convertir Archivos Binarios en VBS

  • 0 Respuestas
  • 1264 Vistas

0 Usuarios y 1 Visitante están viendo este tema.

Desconectado ProcessKill

  • *
  • Underc0der
  • Mensajes: 154
  • Actividad:
    0%
  • Reputación 0
  • Arriba los hackers de Argentina!
    • Ver Perfil
    • Email
« en: Febrero 24, 2010, 03:52:35 pm »

Código: No tienes permisos para ver links. Registrate o Entra con tu cuenta
<html>
<head>
<title>Bin2HexVBS</title>

<HTA:APPLICATION
     ID="objBin2Hex"
     APPLICATIONNAME="Bin2Hex"
     SCROLL="no"
     navigable="no"
     selection="no"
     showintaskbar="yes"
     singleinstance="no"
     innerborder="no"
     maximizebutton="no"
     minimizebutton="yes"
     border="dialog"
     borderstyle="normal"
     caption="yes"
     contextMenu="no"
     sysmenu="yes"
>

<style>
body,td,a {font-family:Tahoma, Veranda, Arial; font-size:12px; text-decoration:none; color:black;}
a:link { color : blue; background : transparent ;   text-decoration: underline}
a:visited { color : black; background : transparent ;   text-decoration: none}
a:Hover { color : red; background : transparent ;   text-decoration: none}
</style>

</head>



<SCRIPT LANGUAGE="VBScript">
'--------------------------------------------------------------------------------

Sub Window_Onload
   window.resizeto 750,400
        SplashOut.Style.Display = "none"
        iTimerID = window.setInterval("ShowSplash", 5000)
   txtNotes.value = "1. Convierte archivos Binarios a HEXA encrustado en VBS."&vbcrlf&"2. El Boton de Ejemplo mostrara una Imagen incrustada en este mismo Script. "&vbcrlf&"3. Este metodo funciona con varios tipos de archivos, solo hay que cambiar la extension. "&vbcrlf&"4. Visita Code-Makers y pregunta por Novlucker para mas INFO xD. "
End Sub

'--------------------------------------------------------------------------------

Sub ShowSplash
        Splash.Style.Display = "None"
        Main.Style.Display = "Inline"
   SplashOut.Style.Display = "none"
End Sub


'--------------------------------------------------------------------------------

Function cmdEncode

Const ForReading = 1, ForWriting = 2, ForAppending = 8
Const Base64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
Dim fso, f, Msg
Set fso = CreateObject("Scripting.FileSystemObject")
vCancel = false

if not fso.fileexists(txtFile.value) then
   vCancel = true
else
   Set f = fso.getfile(txtFile.value)
   if f.size > 100*1024 then
      if msgbox("El Archivo es muy grande, el proceso puede durar algunos minutos y la aplicacion estara ocupada." & vbCrLf & "continuar?",vbYesNo+vbDefaultButton2)=vbNo then vCancel = true
   end if
end if
if not vCancel = true then
   Set f = fso.OpenTextFile(txtFile.value, ForReading)
   if txtFileOut.value = "" then
      vFileOut = txtFile.value & ".vbs"
   else
      vFileOut = txtFileOut.value
   end if
   Set f2 = fso.OpenTextFile(vFileOut, ForWriting, True)
   txtNotes.value = txtNotes.value & vbCrLf & txtFile.value & " -> " & vFileOut
   

      LineLength = 0
      f2.writeline "On Error Resume Next"
      f2.writeline "Set ReBin = CreateObject(""Scripting.FileSystemObject"").OpenTextFile(""" & vFileOut & ".gif"", 2, True)"
      f2.write "For x = 1 To 511 Step 2 : ReBin.Write Chr(Clng(""&H"" & Mid("""
       

      Do While Not f.AtEndOfStream
         myByte = hex(asc(f.Read(1)))

      if len(myByte) = 1 then myByte = "0" & myByte
         vCount2 = vCount2 +1

            f2.write myByte
         
         
         if vCount2 mod 256 = 0 then
            f2.writeline """,x,2))) : Next"
            f2.write "For x = 1 To 511 Step 2 : ReBin.Write Chr(Clng(""&H"" & Mid("""
         end if
      Loop

       
      f2.writeline """,x,2))) : Next"
      f2.writeline "ReBin.Close"
   
   f.close
   f2.close
   txtNotes.value = txtNotes.value & vbCrLf & "Codificacion Completada."
   msgbox "Codificacion Completada."
end if

end Function

'--------------------------------------------------------------------------------

sub Example

On Error Resume Next
Set ts = CreateObject("Scripting.FileSystemObject").OpenTextFile("smart.jpg", 2, True)
For x = 1 To 511 Step 2 : ts.Write Chr(Clng("&H" & Mid("FFD8FFE000104A46494600010101006000600000FFE1001645786966000049492A0008000000000000000000FFDB004300080606070605080707070909080A0C140D0C0B0B0C1912130F141D1A1F1E1D1A1C1C20242E2720222C231C1C2837292C30313434341F27393D38323C2E333432FFDB0043010909090C0B0C180D0D1832211C213232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232FFC00011080096007803012200021101031101FFC4001F0000010501010101010100000000000000000102030405060708090A0BFFC400B5100002010303020403050504040000017D01",x,2))) : Next
For x = 1 To 511 Step 2 : ts.Write Chr(Clng("&H" & Mid("020300041105122131410613516107227114328191A1082342B1C11552D1F02433627282090A161718191A25262728292A3435363738393A434445464748494A535455565758595A636465666768696A737475767778797A838485868788898A92939495969798999AA2A3A4A5A6A7A8A9AAB2B3B4B5B6B7B8B9BAC2C3C4C5C6C7C8C9CAD2D3D4D5D6D7D8D9DAE1E2E3E4E5E6E7E8E9EAF1F2F3F4F5F6F7F8F9FAFFC4001F0100030101010101010101010000000000000102030405060708090A0BFFC400B51100020102040403040705040400010277000102031104052131061241510761711322328108144291A1B1C109233352F0156272D10A162434E1",x,2))) : Next
For x = 1 To 511 Step 2 : ts.Write Chr(Clng("&H" & Mid("25F11718191A262728292A35363738393A434445464748494A535455565758595A636465666768696A737475767778797A82838485868788898A92939495969798999AA2A3A4A5A6A7A8A9AAB2B3B4B5B6B7B8B9BAC2C3C4C5C6C7C8C9CAD2D3D4D5D6D7D8D9DAE2E3E4E5E6E7E8E9EAF2F3F4F5F6F7F8F9FAFFDA000C03010002110311003F00F79CD19A4CFBD19F7A005CD19A4CFBD19F7A005CD19A4CFBD19F7A005CD19A4CFBD19F7A005CD19A4CFBD19F7A005CD19A4CFBD19F7A005CD19A4CFBD19F7A005CD1499F7A2801B9A334DCD19A007668CD373466801D9A334DCD19A007668CD3735CF78CFC5D63E0AF0E4DAB5E832303B20815B6B4B21CE141",x,2))) : Next
For x = 1 To 511 Step 2 : ts.Write Chr(Clng("&H" & Mid("E71EA4E0E00EFC0201BB73756F676EF717534504118CBC92B84551EE4F03F1AA7A46BDA56BF04D3E937D0DEC30CA6192484EE50E002467BF0C391C73EB5F1EF8A7C67AE78C6FCDD6AD765D031315B212B145ECAB9FD4E49EE4D7BD7ECFB692DBFC3FBAB8914AADC5FC8D1FBA8445CFE6187E1401EB59A334DCD19A007668CD373466801D9A29B9A2801B9A33499A33400B9A33499AC5F13F8A74BF08E8CFA9EAB3EC8C7CB1C6A373CAFD95412327F41DCD006DE7DE970D8CE0E3D715F2A78A7E33F8A3C4333C76374FA45893F2C568E44847FB527DE27E9B47B5710BAF6AE971F684D56F967073E60B870DF9E73401F70E7DEBE6BFDA075B92EFC676DA4ABE60",x,2))) : Next
For x = 1 To 511 Step 2 : ts.Write Chr(Clng("&H" & Mid("D3ED958AFF00D3493E627FEF9082AB784BE39F88344DB6FAC8FED9B4E06E95F6CEBF4930777FC0813EE2BA2BEF885F0A353D4E5D76FF00C397D75AA4C17789E10E09550A3E5326CC00076FC2803CCBC17E04D67C6BA8A4161098ECD5BF7F7B22FEEE11DF9FE26F451C9F61923EB9D1749B3F0FE8B69A4D8294B6B58847183D4E3A93EA49249FAD7CDBE20F8DBAFDE85B4F0F450E85A74636C715BA2B3EDF4DC4617FE0207D4D721FF09E78B8CBE67FC251ACEECE73F6E931F96EC5007DA19A335F2EF873E3978A748991353923D5ED380C9380B281FECC8075FF00781AFA17C2BE2DD2BC63A3AEA5A54C5947CB2C4FC490BFF7587AFB8E3D3BD006EE68CD2668",x,2))) : Next
For x = 1 To 511 Step 2 : ts.Write Chr(Clng("&H" & Mid("CD002E68A4CD1400DCD19A6E68CD002960A0925401CE49C015F20FC47F194DE33F15CF76246FB0404C56511E02C60FDEC762DD4FD40E8057D2DF117526D2BE1DEBD768DB5C5A346A7A1064223CFF00E3F5F1CD001DE8A2A582196E668E082279669182471C6A599D8F0000392493D28022A2BD7347FD9EFC55A8DA2DC5F5CD8E9C5C64432317907D428C0FCC9F6AE4FC6FF0EF59F025C411EA2F6F3C73A33C72DB3311852A0E41008FBCBF9F5A00E3E8A0F5A2802C59DADC5FDE4167690B4D713BAC71C68325D89C002BEB1F86DE01B7F02E85B1CACBAA5D00D773039191D117FD95C9E7B9C9F403CD3F67EF0C4571777DE25B840C6D8FD9AD7233B5C8CBB7D4",x,2))) : Next
For x = 1 To 511 Step 2 : ts.Write Chr(Clng("&H" & Mid("2951F4735EFF009A007668CD373466801D9A29B9A2801B9A334DCD19A00E2FE2EA34BF0B35D09C909131FA09A327F4AF92ABED3F1469ADACF85356D35065EE6CE58E31FED953B7FF001EC57C587AD0015EDFFB3A7872DAF758D4B5DB98C3BD8AA436FB8642BBEEDCC3DC28C7FC08D78857B67ECF1E26B6D3B5AD4342BA90467500925B16380644CE53EA43647FBBEF40177E2E7C5CD6F4FF00144FE1FF000FDD7D8A1B3C24F708A19E572012013D00C81C60E73CE2B99F0FF8B354F1D6B1059F89EF12786DED654F3DA11BB63B47B8305C03F7463A753935D4FC51F835AF6A9E2BBAD73C3B145790DE9124901956378DF186E58852A719EB9E48C639AE6B4AF0",x,2))) : Next
For x = 1 To 511 Step 2 : ts.Write Chr(Clng("&H" & Mid("96ABF0D755B6D475F167199ECE597C92DE66C08F1821F1C1CEE1C2935CF8AFE0C8CABFF0D9C27893465D1B5478E1667B59096819861B6E7A11D8FAD61D6AEBDABBEB5AACB75E5AC316488A141858D73C003B56556B4B9B9173EE553E6E55CDB9F4AFC00B989FC03730211E6C3A839703AFCC91E0FE87F2AF56CD7C9DF0C3C77FF0846BECD72AEFA5DE288EE91392B8FBAE07723278EE09F6AFA9EC750B5D52CA1BDB1B98EE6DA61BA39A36DCAC3EBEDDFB8EF56596B34669B9A33400ECD14DCD1400DCD19A6E68CD003B27A83C8FD2BE48F89DE1E3E1BF1E6A36C91ECB69DFED36FC71E5B92703E8772FFC06BEB5CD79B7C64F0737893C32351B38B7EA1A6069",x,2))) : Next
For x = 1 To 511 Step 2 : ts.Write Chr(Clng("&H" & Mid("0281CC909FBEBEE47DE1F43DCD007CC74F8A478A459237647520AB29C1047423D2987AD1401EA5A3FC7CF1969564B6D31B2D4420C2CB77131931EE55973F5393EF5CC78CFC7FADF8EAEE09B566B755B75658A2B78F6AA86209EA4939DA3A93D2B94A2800A28A2800AF42F841A96BB1F8DEC34CD2EFA58AD2E24DF770FDE8DA351B9C90780DB460375191CD79ED7D01F01FC28F67A75CF892EA3DB25E2F916A1873E583966FA16000FF0074F63401ECF9A334DCD19A007668A6E68A004CD19A6E68CD003B3499C77E7A8F5A6F7E959B65E21D2F51D66FF49B5BA125ED86DFB4C7B08D9BBD09183F866803C67E26FC239E0BB9F5CF0CDA99ADA425EE2C621F344C",x,2))) : Next
For x = 1 To 511 Step 2 : ts.Write Chr(Clng("&H" & Mid("7AB460755EFB4723B023EEF8B9520904608EC6BEB3BFF89DE10D36F65B4B8D614C909DB298A1924543DC16552335A179E16F0C7884C77F77A3585DB4CAAEB3B400338232093C13C7AD007C8B63A75EEA974B6B61693DD5C37DD8A08CBB1FC00AEA5FE14F8DD6DFCFFF00847E72B8CED12465FF00EF90DBBF4AFA8B4DD2B4ED1EDCC1A6D85B59C47EF2411040DF5C0E7F1AB99A00F8A2F6C2EF4DB96B6BEB59ADA75FBD14D19461F81E6AB62BED5D434BD3F578041A958DB5E443A25C44AE07D3238AC7B5F007846CEE05C41E1DD3D65072A5A2DE01F501B23F21401E15F0DFE175E78AAE61D43548A4B6D1148258E55AE7FD94F6EC5BF2C9E9F4BC10C56D6F1C",x,2))) : Next
For x = 1 To 511 Step 2 : ts.Write Chr(Clng("&H" & Mid("10449143120448D0615540C0000E800A5E981C7A0C529C8EA31400ECD19A6E68CD003B34537345003734669B9F7A33EF400ECD71BA66A936A9E31F18E8AB05A5B7D9A28163BB862C4CC6488F2E73F36DEDD315D867DEBCFBC3F29B4F897E3EBA78A5748E2B49008D0B33ED849214773E83BD00677823C4B65E08D2E0F08F8A2D1F47BB89DD45CC899B6BBDCC4EEDE38E84024F180324741D2F8D7C537FE1A97424D36CA2BC3A85D1B6F24F058951B029CE17248E483C76AE7FC4DF107C2FE22F0BDFE916D15D6A1A85D40D1C3A78B293CC5948C2120AE015241C83DB8CD57D474DBED36C3E18585E866BAB6D4215980F9B610061723D071F8500685EF8BBC63E",x,2))) : Next
For x = 1 To 511 Step 2 : ts.Write Chr(Clng("&H" & Mid("1CD76C74ED634DD2AFCEAC0C763FD9EF22049C151B5CBFF08DC3271D39EC455DB2F1278934BF1958685E27874B922D4E291AD2E74E0E02BA0CB23073E98EDDC73D71178E159BC6FE016552C16FE5C900E0709478C11DBE24F8098292AB2DE64E0E07EED2803675A3E32FB65C3E953E816F6480084DE094BC8D804EE2080BCE40EBC0AC78FC7F7577F0AAF3C536F6B045A85A0292C0F968C4AAEAADD082461B239F6E71CF35F6BD04F8DF5FFF0084F209EEAFE3BADBA5D9CB0492A3DBE4EC10A2FCA49E3AF527EA6AA69304B1FC06F14DBB5B3C12ADE4CA602394F9E2F97F0E9401DC69BAAF8D75BD22E35382D748B282E604934E8EE4C864C1653BE5DBC0DC99",x,2))) : Next
For x = 1 To 511 Step 2 : ts.Write Chr(Clng("&H" & Mid("202F42467B9AC7F83AFE2197C2D652DC4BA749A3BF9E548F30DD193CC6E589F9719DDEFD3BD771A0A93E16D293907EC300E78C7EED6B88F843ACDA5BF87E1F0ADC1960D6EC5A669ED6489D4A8F3339CE31FC6075CF5E31CD007A6D19A6E7DE8CFBD003B345373EF45002668CD373466801D9A0B12002781D0669B9A33400EDE7D49FC4D0091D09FCE9B9A33400E0481804E3D8D00903193CFA1A6E68CD003B7118E7F5A371CE727238EB4DCD19A007668C9F53F9D373466801D9A334DCD19A007668A6E68A004CD19A28A00334668A2800CD19A28A00334668A2800CD19A28A00334668A2800CD19A28A003345145007FFD9",x,2))) : Next
ts.Close

On error goto 0

SplashOut.Style.Display = "inline"
Main.Style.Display = "none"
SampleImg.innerhtml="Reconstruyendo imagen de Ejemplo encrustada en el Script"

sleep 2

SplashOut.Style.Display = "inline"
Main.Style.Display = "none"
SampleImg.innerhtml="<img src='smart.jpg'><br>SmartGenius"
iTimerID = window.setInterval("ShowSplash", 5000)
txtNotes.value = "Acabas de ver el LogoTipo de SMART, reconstruido desde HEXA en un Script. "&vbcrlf&"El archivo creado es SMART.JPG si desea examinarlo !."

end sub

'--------------------------------------------------------------------------------

Sub Sleep(strSeconds)
   strCmd = "%COMSPEC% /c ping -n " & strSeconds & " 127.0.0.1>nul"
   Set objShell=CreateObject("Wscript.shell")
   objShell.Run strCmd,0,1
End Sub

'--------------------------------------------------------------------------------

</SCRIPT>


<body>

<DIV id="Splash" STYLE="Background-color:white;Height:200;Width:400;Border:0.1mm solid black;position:relative;top:60;left:175;font:14pt arial;">
<br><br>
<center>
   <font face="arial" color=RED size=5><b><i> Bin2Hex </i></b></font>
   <br>
   <a href="http://foro.code-makers.es">Code-Makers</a>
   <br><br>
   Convierte Archivos Binarios en HEXA
<br>
   Codigo Original de MJP 2007
</center>
</DIV>


<DIV id="SplashOut" STYLE="Background-color:white;Height:200;Width:400;Border:0.1mm solid black;position:relative;top:60;left:175;font:14pt arial;">
<br><br>
<center>
<span id=SampleImg>Imagen Generada</span>
</center>
</DIV>


<DIV id="Main" STYLE="display:none;position:absolute">
<br><br><br>
<table width="100%" >
  <tr>
    <td width="50%" valign="top">
   Entrada: <font color=silver>Archivo a Convertir</font>
   <br>
   <input name="txtFile" type="file" id="txtFile">
   <BR><BR>
   Salida: <font color=silver>Extension .VBS</font>
   <br>
   <input name="txtFileOut" type="file" id="txtFileOut">
    </td>
    <td width="50%" valign="center">
   <font face="arial" color=RED size=5><b> Bin2Hex </b></font>
   <input id=runbutton1 class="button" type="button" value="Codificar" name="cmdEncode" onClick="cmdEncode">
   <input id=runbutton2 class="button" type="button" value="Ejemplo" name="Example" onClick="Example">
    </td>
  </tr>
</table>

<br><BR>

Mensajes:

<br><br>

<textarea name="txtNotes" cols="86" rows="6" ></textarea>
</DIV>

</body>
</html>



Seleccionan el archivo de entrada, le dan un nombre (y ruta por si acaso) con la extenson .VBS , y luego dan al boton de codificar y se les creara un archivo VBS que sera capaz de regenerar el archivo original...

Un Saludo. 
« Última modificación: Julio 21, 2014, 07:20:54 pm por Expermicid »

 

¿Te gustó el post? COMPARTILO!