Menú

Mostrar Mensajes

Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.

Mostrar Mensajes Menú

Mensajes - 70N1

#31
2.bin es un exe creado con c++.

coming[] es el array de bytes que contiene el exe.

El error esta en assembly.load(buffer);

No se puede cargar el archivo o ensamblado 'ejecutable, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' ni una de sus dependencias. Intento de cargar un archivo ejecutable que no se puede comprobar (la tabla IAT tiene más de 2 secciones o una sección TLS). (Excepción de HRESULT: 0x80131019)


Porsierto... ya me podrian aver mandado un mensaje para avisar de que el tema fue movido
#32
He montado este codigo, pero me dice que la imagen no es valida.
Creo un array de bytes ( byte[] ) con el archivo dentro y al intentar lanzarlo con  Assembly.Load(buffer) me da error.

Código (csharp) [Seleccionar]
// alphabet.txt contains "abcdefghijklmnopqrstuvwxyz"
       using (FileStream fs = new FileStream(@"2.bin", FileMode.Open, FileAccess.Read))
       {
           long length = fs.Length;
           Byte[] coming = new byte[length ];
           byte readd;
           int i = 0;
           FileStream fileStream = new FileStream(fileName, FileMode.Create);
           for (offset = 1; offset <= fs.Length; offset++)
           {
               fs.Seek(-offset, SeekOrigin.End);
               //Console.Write(Convert.ToChar(fs.ReadByte()));
               int readb = fs.ReadByte();
                readd = Convert.ToByte(readb);
               //fileStream.WriteByte(readd);
               coming[i] =readd;
               
               //Console.WriteLine(i);
               i++;
               //Console.ReadLine();
           }
           //Console.Write(coming);
           MemExe(coming);
         
         
       }




 static void MemExe(byte[] buffer)
   {
       Assembly asm = Assembly.Load(buffer);//----------------->> AQUI DA EL ERROR.

       if (asm.EntryPoint == null)
           throw new ApplicationException("No entry point found!");

       MethodInfo ePoint = asm.EntryPoint;
       object ins = asm.CreateInstance(ePoint.Name);
       ePoint.Invoke(ins, null);
   }
#33
Muchas gracias.

Me a servido de mucha ayuda.
Eres un Crack
#34
Este es mi code:

Código (csharp) [Seleccionar]
using (FileStream fs = new FileStream(@"2.bin", FileMode.Open, FileAccess.Read))
       {

           byte[] coming= new byte[1];//------------->> AYUDA
           byte readd;
           FileStream fileStream = new FileStream(fileName, FileMode.Create);
           for (offset = 1; offset <= fs.Length; offset++)
           {
               fs.Seek(-offset, SeekOrigin.End);
               //Console.Write(Convert.ToChar(fs.ReadByte()));
               int readb = fs.ReadByte();
                readd = Convert.ToByte(readb);
               //fileStream.WriteByte(readd);
               coming[+1] =readd;// ----------------------->>AYUDA
           }
           


       
       }


Necesito rellenar el coming[] con los bytes de readd, no tengo ni idea de como declarar el array.
#35
Muchas gracias, me a servido de mucho.

Dejo el code aki por si alguien lo busca, tiene los botones atras y alante mostrando 5 elementos.


<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Documento sin título</title>
<link href="client/css/visiblehidden.css" rel="stylesheet" type="text/css">
<script type="text/javascript">


    function siguiente(){ 
//alert(document.getElementById('2').nextElementSibling.id);
  var contenido=document.getElementsByClassName('visible');
  var Nitem=contenido.item(4).id;
  alert(Nitem);
var nex=document.getElementById(Nitem).nextElementSibling;             
var pre=document.getElementById(Nitem).previousElementSibling.previousElementSibling.previousElementSibling.previousElementSibling;
nex.className='visible';
pre.className='oculto';
       }

function anterior(){


   //alert(document.getElementById('2').previousElementSibling.id);
var contenido=document.getElementsByClassName('visible');
  var Nitem=contenido.item(0).id;
var nex=document.getElementById(Nitem).nextElementSibling.nextElementSibling.nextElementSibling.nextElementSibling;             
var pre=document.getElementById(Nitem).previousElementSibling;
nex.className='oculto';
pre.className='visible';

}

</script>
</head>

<body>


<div id="nav">
       <div id="1" class="visible">1</div>
       <div id="2" class="visible">2</div>
       <div id="3" class="visible">3</div>
       <div id="4" class="visible">4</div>
       <div id="5" class="visible">5</div>
       <div id="6" class="oculto">6</div>
       <div id="7" class="oculto">7</div>
       <div id="8" class="oculto">8</div>
   </div>
<input value="Next" type="button" onclick="siguiente()">
<input value="anterior" type="button" onclick="anterior()">
</body>
</html>
#36
Este es el code que e creado: es para una paginacion y quiero mostrar solo 10 paginas: 1-2-3-4-5-6-7-8-9-10-next

Al hacer click en next deberia esconder el 1 y mostrar el 11.

Me podeis ayudar?


function siguiente(){
                             
var pagina=document.getElementsByClassName("visible");


  alert(pagina.item(pagina.length-1).id);
     
var pagina2= document.getElementById(pagina.item(pagina.length-1).id);
pagina2.className="oculto";

alert("entro1 "+pagina2.className);




var pagina1=document.getElementsByClassName("oculto");


alert("ab "+pagina1.item(pagina1.length-1).id);

var pagina3=document.getElementById(pagina1.item(pagina1.length-1).id);
pagina3.className="visible";

alert("entro2 "+pagina3.className);

   alert("visible :"+pagina.length+"- oculto :"+pagina1.length);
   

};
#37
Muchas gracias
#38
Bueno.
Al final lo encontre: float:right
#39
Desarrollo Web / Colocar divs en linea. Ayuda
2 Agosto 2014, 23:41 PM
Hola.

Seguramente sera una tonteria, pero no encuentro informacion o no se bien que buscar.
La cosa es que quiero poner divs asi:


div1 div2 div3

pero me salen asi

div1
div2
div3

Como lo soluciono?. Muchas gracias por vuestro tiempo.
#40
Fallo mio.

tengo que modificar esta linea:

foo.onclick = function () { alert(parseInt(this.id)+1); };