Ok, I figured out how to use obj2asm. The trick is to cd to the directory holding the file you wish to dissassemble and _not_ specify the whole path, or else it throws a confusing "Fatal error: unrecognized flag" error.

I ran:

obj2asm intLoadTest.o intLoadTest.d > intLoadTest.s

and got this:


FLAT    group   
        extrn   _main
        public  _deh_beg
        public  _deh_end
        public  _tlsstart
        public  _tlsend
        public  _Dmain
        public  _D11intLoadTest12__ModuleInfoZ
        public  main
        extrn   _d_run_main
        extrn   _Dmain
        extrn   _d_dso_registry
.text   segment
        assume  CS:.text
.text   ends
.data   segment
_D11intLoadTest12__ModuleInfoZ:
        db      004h,010h,000h,000h,000h,000h,000h,000h ;........
        db      069h,06eh,074h,04ch,06fh,061h,064h,054h ;intLoadT
        db      065h,073h,074h,000h     ;est.
.data   ends
.bss    segment
.bss    ends
.rodata segment
.rodata ends
.tdata  segment
_tlsstart:
        db      000h,000h,000h,000h,000h,000h,000h,000h ;........
        db      000h,000h,000h,000h,000h,000h,000h,000h ;........
.tdata  ends
.tdata. segment
.tdata. ends
.text._Dmain    segment
        assume  CS:.text._Dmain
_Dmain:
                push    RBP
                mov     RBP,RSP
                mov     EAX,0Ah
                pop     RBP
                ret
                0f1f
                add     [RAX],R8B
.text._Dmain    ends
.text.main      segment
        assume  CS:.text.main
main:
                push    RBP
                mov     RBP,RSP
                sub     RSP,010h
                mov     RDX,offset FLAT:_Dmain@64
                call      _d_run_main@PC32
                leave
                ret
.text.main      ends
.data.d_dso_rec segment
        db      000h,000h,000h,000h,000h,000h,000h,000h ;........
.data.d_dso_rec ends
.text.d_dso_init        segment
        assume  CS:.text.d_dso_init
L0:             enter   0,0
                lea     RAX,_deh_end@PC32[RIP]
                push    RAX
                lea     RAX,_deh_beg@PC32[RIP]
                push    RAX
                lea     RAX,FLAT:[00h][RIP]
                push    RAX
                lea     RAX,FLAT:[00h][RIP]
                push    RAX
                lea     RAX,FLAT:.data.d_dso_rec[00h][RIP]
                push    RAX
                push    1
                mov     RDI,RSP
                call      _d_dso_registry@PLT32
                leave
                ret
.text.d_dso_init        ends
        end

Can you tell whether a 32-bit load was used?

Jake

P.S - That's _way_ less output than what objdump gave!

Reply via email to