libreplanet-it
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Libreplanet-IT] Richiesta traduzione


From: Denis 'GNUtoo' Carikli
Subject: [Libreplanet-IT] Richiesta traduzione
Date: Fri, 01 Apr 2011 15:26:38 +0200

I traduttori di programmi conoscono magari le variabile LANG e LC_ALL
per settare il linguaggio del sistema.
Per esempio il mio sistema e in inglese:
$ locale
LANG=en_US.utf8
LC_CTYPE="en_US.utf8"
LC_NUMERIC="en_US.utf8"
LC_TIME="en_US.utf8"
LC_COLLATE="en_US.utf8"
LC_MONETARY="en_US.utf8"
LC_MESSAGES="en_US.utf8"
LC_PAPER="en_US.utf8"
LC_NAME="en_US.utf8"
LC_ADDRESS="en_US.utf8"
LC_TELEPHONE="en_US.utf8"
LC_MEASUREMENT="en_US.utf8"
LC_IDENTIFICATION="en_US.utf8"
LC_ALL=

Per vedere le lingue disponibile si fa questo:
$ locale -a
C
ca_AD.utf8
ca_ES.utf8
address@hidden
ca_FR.utf8
ca_IT.utf8
en_AG
en_AG.utf8
en_AU.utf8
en_BW.utf8
en_CA.utf8
en_DK.utf8
en_GB.utf8
en_HK.utf8
en_IE.utf8
en_IN
en_IN.utf8
en_NG
en_NG.utf8
en_NZ.utf8
en_PH.utf8
en_SG.utf8
en_US.utf8
en_ZA.utf8
en_ZW.utf8
es_AR.utf8
es_BO.utf8
es_CL.utf8
es_CO.utf8
es_CR.utf8
es_DO.utf8
es_EC.utf8
es_ES.utf8
es_GT.utf8
es_HN.utf8
es_MX.utf8
es_NI.utf8
es_PA.utf8
es_PE.utf8
es_PR.utf8
es_PY.utf8
es_SV.utf8
es_US.utf8
es_UY.utf8
es_VE.utf8
eu_ES.utf8
eu_FR.utf8
fr_BE.utf8
fr_CA.utf8
fr_CH.utf8
fr_FR.utf8
fr_LU.utf8
gl_ES.utf8
hi_IN
hi_IN.utf8
it_CH.utf8
it_IT.utf8
POSIX
pt_BR.utf8
pt_PT.utf8
tr_CY.utf8
tr_TR.utf8
zh_CN.utf8
zh_HK.utf8
zh_SG.utf8
zh_TW.utf8

Se guardate attentamente vedrete C come linguaggio.

Dunque vorrei richiedere una traduzione di un programma in assembly, in
C.
Il programma sarebbe questo: 
a.out:     file format elf32-littlearm


Disassembly of section .init:

00008274 <_init>:
    8274:       e92d4008        push    {r3, lr}
    8278:       eb000020        bl      8300 <call_gmon_start>
    827c:       e8bd8008        pop     {r3, pc}

Disassembly of section .plt:

00008280 <.plt>:
    8280:       e52de004        push    {lr}            ; (str lr, [sp, #-4]!)
    8284:       e59fe004        ldr     lr, [pc, #4]    ; 8290 <_init+0x1c>
    8288:       e08fe00e        add     lr, pc, lr
    828c:       e5bef008        ldr     pc, [lr, #8]!
    8290:       00008280        .word   0x00008280
    8294:       e28fc600        add     ip, pc, #0
    8298:       e28cca08        add     ip, ip, #32768  ; 0x8000
    829c:       e5bcf280        ldr     pc, [ip, #640]! ; 0x280
    82a0:       e28fc600        add     ip, pc, #0
    82a4:       e28cca08        add     ip, ip, #32768  ; 0x8000
    82a8:       e5bcf278        ldr     pc, [ip, #632]! ; 0x278
    82ac:       e28fc600        add     ip, pc, #0
    82b0:       e28cca08        add     ip, ip, #32768  ; 0x8000
    82b4:       e5bcf270        ldr     pc, [ip, #624]! ; 0x270
    82b8:       e28fc600        add     ip, pc, #0
    82bc:       e28cca08        add     ip, ip, #32768  ; 0x8000
    82c0:       e5bcf268        ldr     pc, [ip, #616]! ; 0x268

Disassembly of section .text:

000082c4 <_start>:
    82c4:       e3a0b000        mov     fp, #0
    82c8:       e3a0e000        mov     lr, #0
    82cc:       e49d1004        pop     {r1}            ; (ldr r1, [sp], #4)
    82d0:       e1a0200d        mov     r2, sp
    82d4:       e52d2004        push    {r2}            ; (str r2, [sp, #-4]!)
    82d8:       e52d0004        push    {r0}            ; (str r0, [sp, #-4]!)
    82dc:       e59fc010        ldr     ip, [pc, #16]   ; 82f4 <_start+0x30>
    82e0:       e52dc004        push    {ip}            ; (str ip, [sp, #-4]!)
    82e4:       e59f000c        ldr     r0, [pc, #12]   ; 82f8 <_start+0x34>
    82e8:       e59f300c        ldr     r3, [pc, #12]   ; 82fc <_start+0x38>
    82ec:       ebffffeb        bl      82a0 <_init+0x2c>
    82f0:       ebffffe7        bl      8294 <_init+0x20>
    82f4:       000083f8        .word   0x000083f8
    82f8:       00008370        .word   0x00008370
    82fc:       00008398        .word   0x00008398

00008300 <call_gmon_start>:
    8300:       e59f0014        ldr     r0, [pc, #20]   ; 831c 
<call_gmon_start+0x1c>
    8304:       e59f2014        ldr     r2, [pc, #20]   ; 8320 
<call_gmon_start+0x20>
    8308:       e08f3000        add     r3, pc, r0
    830c:       e7933002        ldr     r3, [r3, r2]
    8310:       e3530000        cmp     r3, #0
    8314:       012fff1e        bxeq    lr
    8318:       eaffffe3        b       82ac <_init+0x38>
    831c:       00008200        .word   0x00008200
    8320:       0000001c        .word   0x0000001c

00008324 <__do_global_dtors_aux>:
    8324:       e59f3010        ldr     r3, [pc, #16]   ; 833c 
<__do_global_dtors_aux
+0x18>
    8328:       e5d32000        ldrb    r2, [r3]
    832c:       e3520000        cmp     r2, #0
    8330:       02822001        addeq   r2, r2, #1
    8334:       05c32000        strbeq  r2, [r3]
    8338:       e12fff1e        bx      lr
    833c:       00010538        .word   0x00010538

00008340 <frame_dummy>:
    8340:       e59f0020        ldr     r0, [pc, #32]   ; 8368 
<frame_dummy+0x28>
    8344:       e92d4008        push    {r3, lr}
    8348:       e5903000        ldr     r3, [r0]
    834c:       e3530000        cmp     r3, #0
    8350:       08bd8008        popeq   {r3, pc}
    8354:       e59f3010        ldr     r3, [pc, #16]   ; 836c 
<frame_dummy+0x2c>
    8358:       e3530000        cmp     r3, #0
    835c:       08bd8008        popeq   {r3, pc}
    8360:       e12fff33        blx     r3
    8364:       e8bd8008        pop     {r3, pc}
    8368:       00010424        .word   0x00010424
    836c:       00000000        .word   0x00000000

00008370 <main>:
    8370:       e92d4800        push    {fp, lr}
    8374:       e28db004        add     fp, sp, #4
    8378:       e59f0014        ldr     r0, [pc, #20]   ; 8394 <main+0x24>
    837c:       ebffffcd        bl      82b8 <_init+0x44>
    8380:       e3a03000        mov     r3, #0
    8384:       e1a00003        mov     r0, r3
    8388:       e24bd004        sub     sp, fp, #4
    838c:       e8bd4800        pop     {fp, lr}
    8390:       e12fff1e        bx      lr
    8394:       00008408        .word   0x00008408

00008398 <__libc_csu_init>:
    8398:       e92d45f8        push    {r3, r4, r5, r6, r7, r8, sl, lr}
    839c:       e1a06000        mov     r6, r0
    83a0:       e1a07001        mov     r7, r1
    83a4:       e1a08002        mov     r8, r2
    83a8:       e59fa040        ldr     sl, [pc, #64]   ; 83f0 
<__libc_csu_init+0x58>
    83ac:       ebffffb0        bl      8274 <_init>
    83b0:       e59f103c        ldr     r1, [pc, #60]   ; 83f4 
<__libc_csu_init+0x5c>
    83b4:       e08fa00a        add     sl, pc, sl
    83b8:       e08f0001        add     r0, pc, r1
    83bc:       e06a5000        rsb     r5, sl, r0
    83c0:       e1b05145        asrs    r5, r5, #2
    83c4:       08bd85f8        popeq   {r3, r4, r5, r6, r7, r8, sl, pc}
    83c8:       e3a04000        mov     r4, #0
    83cc:       e79a3104        ldr     r3, [sl, r4, lsl #2]
    83d0:       e1a00006        mov     r0, r6
    83d4:       e1a01007        mov     r1, r7
    83d8:       e1a02008        mov     r2, r8
    83dc:       e2844001        add     r4, r4, #1
    83e0:       e12fff33        blx     r3
    83e4:       e1540005        cmp     r4, r5
    83e8:       3afffff7        bcc     83cc <__libc_csu_init+0x34>
    83ec:       e8bd85f8        pop     {r3, r4, r5, r6, r7, r8, sl, pc}
    83f0:       00008060        .word   0x00008060
    83f4:       00008060        .word   0x00008060

000083f8 <__libc_csu_fini>:
    83f8:       e12fff1e        bx      lr

Disassembly of section .fini:

000083fc <_fini>:
    83fc:       e92d4008        push    {r3, lr}
    8400:       e8bd8008        pop     {r3, pc}

Buon primo aprile,

I sorgenti sono stati allegati.

Si compila con :
arm-angstrom-linux-gnueabi-gcc printf.c

e si vede l'assembly con:
arm-angstrom-linux-gnueabi-objdump -d a.out

Ne approfitto per ricordare l'importanza di avere i sorgenti:

Questo mostra la difficoltà di leggere il codice assembly, mentre capire
il codice sorgente e *molto* più facile.
Anch'io ho delle difficoltà a capire cosa fa, Benché conosco l'assembly
arm: so cosa fanno ogni istruzione ma non riesco a collegarlo con il C.

Poi esistono vari meccanismi per rendere ancora più difficile la lettura
del codice assembly, per esempio l'offuscazione di codice oppure la
criptazione di una parte del codice.

Denis.

Attachment: printf.c
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]