|
Mostrar Mensajes
|
Páginas: [1] 2 3
|
2
|
Programación / Java / Arreglo de inmuebles
|
en: 18 Febrero 2015, 21:30 pm
|
Hola, estoy haciendo un programa pero tengo un error en la implementación de mi código y no se cual es, lo que pasa es que escogiendo la opción 2(Mostrar Inmuebles), sale para cada inmueble el mismo propietario. Estas son las Clases import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class TestPropietario { private static Inmueble ArregloI[]=new Inmueble[5]; public static void Imprimir (int Pos ) throws IOException{ System. out. println("\nPropietario " + ArregloI [Pos ]. getMiPropietario(). getNombreCompleto() + ":\n"); System. out. println("Estado " + ArregloI [Pos ]. getEstado() + "\n"); } int Opcion=0; System. out. println("\n1. Ingresar un inmueble\n"); System. out. println("2. Mostrar Inmuebles\n"); System. out. println("3. Salir\n"); Capturar= Lector.readLine(); return Opcion; } int OpcionM=0, Cont=0; Propietario AuxProp= new Propietario(null, null); for(int i=0; i<5; i++) ArregloI[i]= new Inmueble(); while(OpcionM!=3){ OpcionM=MenuPrincipal(); switch(OpcionM){ case 1: System. out. println("Ingrese el Estado del Inmueble (Libre - Ocupado)"); Capturar= Lector.readLine(); Estado=Capturar; System. out. println("Ingrese el Nombre del Propietario"); Capturar= Lector.readLine(); AuxProp.setNombreCompleto(Capturar); System. out. println("Ingrese el numero de telefono del propietario"); Capturar= Lector.readLine(); AuxProp.setTelContac(Capturar); if(Cont<5){ ArregloI[Cont].Llenar(Estado, AuxProp); Cont+=1; } else System. out. println("Ha llegado al límite máximo de Inmuebles"); break; case 2: for(int i=0; i<5; i++) Imprimir(i); break; case 3: break; } } }
public class Propietario { private String NombreCompleto ; public Propietario (String nombreCompleto, String telContac ) { NombreCompleto = nombreCompleto; TelContac = telContac; } public String getNombreCompleto () { return NombreCompleto; } public void setNombreCompleto (String nombreCompleto ) { NombreCompleto = nombreCompleto; } public String getTelContac () { return TelContac; } public void setTelContac (String telContac ) { TelContac = telContac; } }
public class Inmueble { private Propietario MiPropietario=new Propietario(null, null); public void Llenar (String Estado, Propietario MiPropietario ){ setEstado(Estado); setMiPropietario(MiPropietario); } public Inmueble() { } return Estado; } public void setEstado (String estado ) { Estado = estado; } public Propietario getMiPropietario() { return MiPropietario; } public void setMiPropietario(Propietario miPropietario) { MiPropietario = miPropietario; } }
Verán, al momento ingresar a la opción 2 después de haber llenado 2 inmueble sale algo así:
|
|
|
4
|
Programación / Ingeniería Inversa / Desensamblado de un archivo binario
|
en: 26 Noviembre 2014, 03:00 am
|
Hola gente, gracias por leer mi post, primero que todo tengo un archivo desensamblado en codigo ensamblador y quisiera que me guiaran por donde empiezo para interpretar y lograr descifrar que es lo que hace el programa 08048424 <_init>: 8048424: 53 push %ebx 8048425: 83 ec 08 sub $0x8,%esp 8048428: e8 13 01 00 00 call 8048540 <__x86.get_pc_thunk.bx> 804842d: 81 c3 d3 1b 00 00 add $0x1bd3,%ebx 8048433: 8b 83 fc ff ff ff mov -0x4(%ebx),%eax 8048439: 85 c0 test %eax,%eax 804843b: 74 05 je 8048442 <_init+0x1e> 804843d: e8 6e 00 00 00 call 80484b0 <__gmon_start__@plt> 8048442: 83 c4 08 add $0x8,%esp 8048445: 5b pop %ebx 8048446: c3 ret
Desensamblado de la sección .plt:
08048450 <read@plt-0x10>: 8048450: ff 35 04 a0 04 08 pushl 0x804a004 8048456: ff 25 08 a0 04 08 jmp *0x804a008 804845c: 00 00 add %al,(%eax) ...
08048460 <read@plt>: 8048460: ff 25 0c a0 04 08 jmp *0x804a00c 8048466: 68 00 00 00 00 push $0x0 804846b: e9 e0 ff ff ff jmp 8048450 <_init+0x2c>
08048470 <printf@plt>: 8048470: ff 25 10 a0 04 08 jmp *0x804a010 8048476: 68 08 00 00 00 push $0x8 804847b: e9 d0 ff ff ff jmp 8048450 <_init+0x2c>
08048480 <inet_pton@plt>: 8048480: ff 25 14 a0 04 08 jmp *0x804a014 8048486: 68 10 00 00 00 push $0x10 804848b: e9 c0 ff ff ff jmp 8048450 <_init+0x2c>
08048490 <htons@plt>: 8048490: ff 25 18 a0 04 08 jmp *0x804a018 8048496: 68 18 00 00 00 push $0x18 804849b: e9 b0 ff ff ff jmp 8048450 <_init+0x2c>
080484a0 <puts@plt>: 80484a0: ff 25 1c a0 04 08 jmp *0x804a01c 80484a6: 68 20 00 00 00 push $0x20 80484ab: e9 a0 ff ff ff jmp 8048450 <_init+0x2c>
080484b0 <__gmon_start__@plt>: 80484b0: ff 25 20 a0 04 08 jmp *0x804a020 80484b6: 68 28 00 00 00 push $0x28 80484bb: e9 90 ff ff ff jmp 8048450 <_init+0x2c>
080484c0 <__libc_start_main@plt>: 80484c0: ff 25 24 a0 04 08 jmp *0x804a024 80484c6: 68 30 00 00 00 push $0x30 80484cb: e9 80 ff ff ff jmp 8048450 <_init+0x2c>
080484d0 <memset@plt>: 80484d0: ff 25 28 a0 04 08 jmp *0x804a028 80484d6: 68 38 00 00 00 push $0x38 80484db: e9 70 ff ff ff jmp 8048450 <_init+0x2c>
080484e0 <socket@plt>: 80484e0: ff 25 2c a0 04 08 jmp *0x804a02c 80484e6: 68 40 00 00 00 push $0x40 80484eb: e9 60 ff ff ff jmp 8048450 <_init+0x2c>
080484f0 <fputs@plt>: 80484f0: ff 25 30 a0 04 08 jmp *0x804a030 80484f6: 68 48 00 00 00 push $0x48 80484fb: e9 50 ff ff ff jmp 8048450 <_init+0x2c>
08048500 <connect@plt>: 8048500: ff 25 34 a0 04 08 jmp *0x804a034 8048506: 68 50 00 00 00 push $0x50 804850b: e9 40 ff ff ff jmp 8048450 <_init+0x2c>
Desensamblado de la sección .text:
08048510 <_start>: 8048510: 31 ed xor %ebp,%ebp 8048512: 5e pop %esi 8048513: 89 e1 mov %esp,%ecx 8048515: 83 e4 f0 and $0xfffffff0,%esp 8048518: 50 push %eax 8048519: 54 push %esp 804851a: 52 push %edx 804851b: 68 60 88 04 08 push $0x8048860 8048520: 68 f0 87 04 08 push $0x80487f0 8048525: 51 push %ecx 8048526: 56 push %esi 8048527: 68 10 86 04 08 push $0x8048610 804852c: e8 8f ff ff ff call 80484c0 <__libc_start_main@plt> 8048531: f4 hlt 8048532: 66 90 xchg %ax,%ax 8048534: 66 90 xchg %ax,%ax 8048536: 66 90 xchg %ax,%ax 8048538: 66 90 xchg %ax,%ax 804853a: 66 90 xchg %ax,%ax 804853c: 66 90 xchg %ax,%ax 804853e: 66 90 xchg %ax,%ax
08048540 <__x86.get_pc_thunk.bx>: 8048540: 8b 1c 24 mov (%esp),%ebx 8048543: c3 ret 8048544: 66 90 xchg %ax,%ax 8048546: 66 90 xchg %ax,%ax 8048548: 66 90 xchg %ax,%ax 804854a: 66 90 xchg %ax,%ax 804854c: 66 90 xchg %ax,%ax 804854e: 66 90 xchg %ax,%ax
08048550 <deregister_tm_clones>: 8048550: b8 43 a0 04 08 mov $0x804a043,%eax 8048555: 2d 40 a0 04 08 sub $0x804a040,%eax 804855a: 83 f8 06 cmp $0x6,%eax 804855d: 77 01 ja 8048560 <deregister_tm_clones+0x10> 804855f: c3 ret 8048560: b8 00 00 00 00 mov $0x0,%eax 8048565: 85 c0 test %eax,%eax 8048567: 74 f6 je 804855f <deregister_tm_clones+0xf> 8048569: 55 push %ebp 804856a: 89 e5 mov %esp,%ebp 804856c: 83 ec 18 sub $0x18,%esp 804856f: c7 04 24 40 a0 04 08 movl $0x804a040,(%esp) 8048576: ff d0 call *%eax 8048578: c9 leave 8048579: c3 ret 804857a: 8d b6 00 00 00 00 lea 0x0(%esi),%esi
08048580 <register_tm_clones>: 8048580: b8 40 a0 04 08 mov $0x804a040,%eax 8048585: 2d 40 a0 04 08 sub $0x804a040,%eax 804858a: c1 f8 02 sar $0x2,%eax 804858d: 89 c2 mov %eax,%edx 804858f: c1 ea 1f shr $0x1f,%edx 8048592: 01 d0 add %edx,%eax 8048594: d1 f8 sar %eax 8048596: 75 01 jne 8048599 <register_tm_clones+0x19> 8048598: c3 ret 8048599: ba 00 00 00 00 mov $0x0,%edx 804859e: 85 d2 test %edx,%edx 80485a0: 74 f6 je 8048598 <register_tm_clones+0x18> 80485a2: 55 push %ebp 80485a3: 89 e5 mov %esp,%ebp 80485a5: 83 ec 18 sub $0x18,%esp 80485a8: 89 44 24 04 mov %eax,0x4(%esp) 80485ac: c7 04 24 40 a0 04 08 movl $0x804a040,(%esp) 80485b3: ff d2 call *%edx 80485b5: c9 leave 80485b6: c3 ret 80485b7: 89 f6 mov %esi,%esi 80485b9: 8d bc 27 00 00 00 00 lea 0x0(%edi,%eiz,1),%edi
080485c0 <__do_global_dtors_aux>: 80485c0: 80 3d 44 a0 04 08 00 cmpb $0x0,0x804a044 80485c7: 75 13 jne 80485dc <__do_global_dtors_aux+0x1c> 80485c9: 55 push %ebp 80485ca: 89 e5 mov %esp,%ebp 80485cc: 83 ec 08 sub $0x8,%esp 80485cf: e8 7c ff ff ff call 8048550 <deregister_tm_clones> 80485d4: c6 05 44 a0 04 08 01 movb $0x1,0x804a044 80485db: c9 leave 80485dc: f3 c3 repz ret 80485de: 66 90 xchg %ax,%ax
080485e0 <frame_dummy>: 80485e0: a1 08 9f 04 08 mov 0x8049f08,%eax 80485e5: 85 c0 test %eax,%eax 80485e7: 74 1f je 8048608 <frame_dummy+0x28> 80485e9: b8 00 00 00 00 mov $0x0,%eax 80485ee: 85 c0 test %eax,%eax 80485f0: 74 16 je 8048608 <frame_dummy+0x28> 80485f2: 55 push %ebp 80485f3: 89 e5 mov %esp,%ebp 80485f5: 83 ec 18 sub $0x18,%esp 80485f8: c7 04 24 08 9f 04 08 movl $0x8049f08,(%esp) 80485ff: ff d0 call *%eax 8048601: c9 leave 8048602: e9 79 ff ff ff jmp 8048580 <register_tm_clones> 8048607: 90 nop 8048608: e9 73 ff ff ff jmp 8048580 <register_tm_clones> 804860d: 66 90 xchg %ax,%ax 804860f: 90 nop
08048610 <main>: 8048610: 55 push %ebp 8048611: 89 e5 mov %esp,%ebp 8048613: 83 e4 f0 and $0xfffffff0,%esp 8048616: 81 ec 30 04 00 00 sub $0x430,%esp 804861c: c7 84 24 2c 04 00 00 movl $0x0,0x42c(%esp) 8048623: 00 00 00 00 8048627: c7 84 24 28 04 00 00 movl $0x0,0x428(%esp) 804862e: 00 00 00 00 8048632: 83 7d 08 02 cmpl $0x2,0x8(%ebp) 8048636: 74 1f je 8048657 <main+0x47> 8048638: 8b 45 0c mov 0xc(%ebp),%eax 804863b: 8b 00 mov (%eax),%eax 804863d: 89 44 24 04 mov %eax,0x4(%esp) 8048641: c7 04 24 80 88 04 08 movl $0x8048880,(%esp) 8048648: e8 23 fe ff ff call 8048470 <printf@plt> 804864d: b8 01 00 00 00 mov $0x1,%eax 8048652: e9 8c 01 00 00 jmp 80487e3 <main+0x1d3> 8048657: c7 44 24 08 00 04 00 movl $0x400,0x8(%esp) 804865e: 00 804865f: c7 44 24 04 30 00 00 movl $0x30,0x4(%esp) 8048666: 00 8048667: 8d 44 24 28 lea 0x28(%esp),%eax 804866b: 89 04 24 mov %eax,(%esp) 804866e: e8 5d fe ff ff call 80484d0 <memset@plt> 8048673: c7 44 24 08 00 00 00 movl $0x0,0x8(%esp) 804867a: 00 804867b: c7 44 24 04 01 00 00 movl $0x1,0x4(%esp) 8048682: 00 8048683: c7 04 24 02 00 00 00 movl $0x2,(%esp) 804868a: e8 51 fe ff ff call 80484e0 <socket@plt> 804868f: 89 84 24 2c 04 00 00 mov %eax,0x42c(%esp) 8048696: 83 bc 24 2c 04 00 00 cmpl $0x0,0x42c(%esp) 804869d: 00 804869e: 79 16 jns 80486b6 <main+0xa6> 80486a0: c7 04 24 a0 88 04 08 movl $0x80488a0,(%esp) 80486a7: e8 f4 fd ff ff call 80484a0 <puts@plt> 80486ac: b8 01 00 00 00 mov $0x1,%eax 80486b1: e9 2d 01 00 00 jmp 80487e3 <main+0x1d3> 80486b6: c7 44 24 08 10 00 00 movl $0x10,0x8(%esp) 80486bd: 00 80486be: c7 44 24 04 30 00 00 movl $0x30,0x4(%esp) 80486c5: 00 80486c6: 8d 44 24 18 lea 0x18(%esp),%eax 80486ca: 89 04 24 mov %eax,(%esp) 80486cd: e8 fe fd ff ff call 80484d0 <memset@plt> 80486d2: 66 c7 44 24 18 02 00 movw $0x2,0x18(%esp) 80486d9: c7 04 24 88 13 00 00 movl $0x1388,(%esp) 80486e0: e8 ab fd ff ff call 8048490 <htons@plt> 80486e5: 66 89 44 24 1a mov %ax,0x1a(%esp) 80486ea: 8b 45 0c mov 0xc(%ebp),%eax 80486ed: 83 c0 04 add $0x4,%eax 80486f0: 8b 00 mov (%eax),%eax 80486f2: 8d 54 24 18 lea 0x18(%esp),%edx 80486f6: 83 c2 04 add $0x4,%edx 80486f9: 89 54 24 08 mov %edx,0x8(%esp) 80486fd: 89 44 24 04 mov %eax,0x4(%esp) 8048701: c7 04 24 02 00 00 00 movl $0x2,(%esp) 8048708: e8 73 fd ff ff call 8048480 <inet_pton@plt> 804870d: 85 c0 test %eax,%eax 804870f: 7f 16 jg 8048727 <main+0x117> 8048711: c7 04 24 c3 88 04 08 movl $0x80488c3,(%esp) 8048718: e8 83 fd ff ff call 80484a0 <puts@plt> 804871d: b8 01 00 00 00 mov $0x1,%eax 8048722: e9 bc 00 00 00 jmp 80487e3 <main+0x1d3> 8048727: c7 44 24 08 10 00 00 movl $0x10,0x8(%esp) 804872e: 00 804872f: 8d 44 24 18 lea 0x18(%esp),%eax 8048733: 89 44 24 04 mov %eax,0x4(%esp) 8048737: 8b 84 24 2c 04 00 00 mov 0x42c(%esp),%eax 804873e: 89 04 24 mov %eax,(%esp) 8048741: e8 ba fd ff ff call 8048500 <connect@plt> 8048746: 85 c0 test %eax,%eax 8048748: 79 16 jns 8048760 <main+0x150> 804874a: c7 04 24 dd 88 04 08 movl $0x80488dd,(%esp) 8048751: e8 4a fd ff ff call 80484a0 <puts@plt> 8048756: b8 01 00 00 00 mov $0x1,%eax 804875b: e9 83 00 00 00 jmp 80487e3 <main+0x1d3> 8048760: eb 36 jmp 8048798 <main+0x188> 8048762: 8d 54 24 28 lea 0x28(%esp),%edx 8048766: 8b 84 24 28 04 00 00 mov 0x428(%esp),%eax 804876d: 01 d0 add %edx,%eax 804876f: c6 00 00 movb $0x0,(%eax) 8048772: a1 40 a0 04 08 mov 0x804a040,%eax 8048777: 89 44 24 04 mov %eax,0x4(%esp) 804877b: 8d 44 24 28 lea 0x28(%esp),%eax 804877f: 89 04 24 mov %eax,(%esp) 8048782: e8 69 fd ff ff call 80484f0 <fputs@plt> 8048787: 83 f8 ff cmp $0xffffffff,%eax 804878a: 75 0c jne 8048798 <main+0x188> 804878c: c7 04 24 f7 88 04 08 movl $0x80488f7,(%esp) 8048793: e8 08 fd ff ff call 80484a0 <puts@plt> 8048798: c7 44 24 08 ff 03 00 movl $0x3ff,0x8(%esp) 804879f: 00 80487a0: 8d 44 24 28 lea 0x28(%esp),%eax 80487a4: 89 44 24 04 mov %eax,0x4(%esp) 80487a8: 8b 84 24 2c 04 00 00 mov 0x42c(%esp),%eax 80487af: 89 04 24 mov %eax,(%esp) 80487b2: e8 a9 fc ff ff call 8048460 <read@plt> 80487b7: 89 84 24 28 04 00 00 mov %eax,0x428(%esp) 80487be: 83 bc 24 28 04 00 00 cmpl $0x0,0x428(%esp) 80487c5: 00 80487c6: 7f 9a jg 8048762 <main+0x152> 80487c8: 83 bc 24 28 04 00 00 cmpl $0x0,0x428(%esp) 80487cf: 00 80487d0: 79 0c jns 80487de <main+0x1ce> 80487d2: c7 04 24 0d 89 04 08 movl $0x804890d,(%esp) 80487d9: e8 c2 fc ff ff call 80484a0 <puts@plt> 80487de: b8 00 00 00 00 mov $0x0,%eax 80487e3: c9 leave 80487e4: c3 ret 80487e5: 66 90 xchg %ax,%ax 80487e7: 66 90 xchg %ax,%ax 80487e9: 66 90 xchg %ax,%ax 80487eb: 66 90 xchg %ax,%ax 80487ed: 66 90 xchg %ax,%ax 80487ef: 90 nop
080487f0 <__libc_csu_init>: 80487f0: 55 push %ebp 80487f1: 57 push %edi 80487f2: 31 ff xor %edi,%edi 80487f4: 56 push %esi 80487f5: 53 push %ebx 80487f6: e8 45 fd ff ff call 8048540 <__x86.get_pc_thunk.bx> 80487fb: 81 c3 05 18 00 00 add $0x1805,%ebx 8048801: 83 ec 1c sub $0x1c,%esp 8048804: 8b 6c 24 30 mov 0x30(%esp),%ebp 8048808: 8d b3 04 ff ff ff lea -0xfc(%ebx),%esi 804880e: e8 11 fc ff ff call 8048424 <_init> 8048813: 8d 83 00 ff ff ff lea -0x100(%ebx),%eax 8048819: 29 c6 sub %eax,%esi 804881b: c1 fe 02 sar $0x2,%esi 804881e: 85 f6 test %esi,%esi 8048820: 74 27 je 8048849 <__libc_csu_init+0x59> 8048822: 8d b6 00 00 00 00 lea 0x0(%esi),%esi 8048828: 8b 44 24 38 mov 0x38(%esp),%eax 804882c: 89 2c 24 mov %ebp,(%esp) 804882f: 89 44 24 08 mov %eax,0x8(%esp) 8048833: 8b 44 24 34 mov 0x34(%esp),%eax 8048837: 89 44 24 04 mov %eax,0x4(%esp) 804883b: ff 94 bb 00 ff ff ff call *-0x100(%ebx,%edi,4) 8048842: 83 c7 01 add $0x1,%edi 8048845: 39 f7 cmp %esi,%edi 8048847: 75 df jne 8048828 <__libc_csu_init+0x38> 8048849: 83 c4 1c add $0x1c,%esp 804884c: 5b pop %ebx 804884d: 5e pop %esi 804884e: 5f pop %edi 804884f: 5d pop %ebp 8048850: c3 ret 8048851: eb 0d jmp 8048860 <__libc_csu_fini> 8048853: 90 nop 8048854: 90 nop 8048855: 90 nop 8048856: 90 nop 8048857: 90 nop 8048858: 90 nop 8048859: 90 nop 804885a: 90 nop 804885b: 90 nop 804885c: 90 nop 804885d: 90 nop 804885e: 90 nop 804885f: 90 nop
08048860 <__libc_csu_fini>: 8048860: f3 c3 repz ret 8048862: 66 90 xchg %ax,%ax
Desensamblado de la sección .fini:
08048864 <_fini>: 8048864: 53 push %ebx 8048865: 83 ec 08 sub $0x8,%esp 8048868: e8 d3 fc ff ff call 8048540 <__x86.get_pc_thunk.bx> 804886d: 81 c3 93 17 00 00 add $0x1793,%ebx 8048873: 83 c4 08 add $0x8,%esp 8048876: 5b pop %ebx 8048877: c3 ret
Como pueden ver el codigo es algo extenso pero esta como que dividido en partes y además contiene estos subtítulos Desensamblado de la sección .plt Desensamblado de la sección .text Desensamblado de la sección .fini Tambien hay que analizar estos para entender el programa??
|
|
|
6
|
Foros Generales / Dudas Generales / Re: Como se interpreta este comando??
|
en: 18 Mayo 2014, 04:27 am
|
Quería que un programa se ejecutara al prender el equipo, pero como el computador tiene permisos de administrador, me toca hacerlo a mano con estas instrucciones
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run syst32 /t REG_SZ/d "C:Users\..........\Downloads\Log.exe"
Lo de rojo es lo que no he entendido, ya que ya abri el editor de registro y llegue hasta la parte de la direccion \Run
|
|
|
|
|
|
|