udis86を使ってディスクイメージのMBRをディスアセンブル

多分objdumpとか他のツール使っても出来ると思うけど、udis86に付属のudcliでもこんな感じに簡単にディスアセンブル出来る。

$ udcli -16 -att -v intel -o 7c00 -c 512 freebsd.img      
0000000000007c00 eb3c             jmp 0x7c3e              
0000000000007c02 0000             add %al, (%bx,%si)      
0000000000007c04 0000             add %al, (%bx,%si)      
0000000000007c06 0000             add %al, (%bx,%si)      
0000000000007c08 0000             add %al, (%bx,%si)      
0000000000007c0a 0000             add %al, (%bx,%si)      
0000000000007c0c 0200             add (%bx,%si), %al      
0000000000007c0e 0000             add %al, (%bx,%si)      
0000000000007c10 0000             add %al, (%bx,%si)      
0000000000007c12 0000             add %al, (%bx,%si)      
0000000000007c14 0000             add %al, (%bx,%si)      
0000000000007c16 0000             add %al, (%bx,%si)      
0000000000007c18 1200             adc (%bx,%si), %al      
0000000000007c1a 0200             add (%bx,%si), %al      
0000000000007c1c 0000             add %al, (%bx,%si)      
0000000000007c1e 0000             add %al, (%bx,%si)      
0000000000007c20 0000             add %al, (%bx,%si)      
0000000000007c22 0000             add %al, (%bx,%si)      
0000000000007c24 00161f66         add %dl, 0x661f         
0000000000007c28 6a00             push $0x0               
0000000000007c2a 51               push %cx                
0000000000007c2b 50               push %ax                
0000000000007c2c 06               push %es                
0000000000007c2d 53               push %bx                
0000000000007c2e 31c0             xor %ax, %ax            
0000000000007c30 88f0             mov %dh, %al            
0000000000007c32 50               push %ax                
0000000000007c33 6a10             push $0x10              
0000000000007c35 89e5             mov %sp, %bp            
0000000000007c37 e8c000           call 0x7cfa             
0000000000007c3a 8d6610           lea 0x10(%bp), %sp      
0000000000007c3d cb               lret                    
0000000000007c3e fc               cld                     
0000000000007c3f 31c9             xor %cx, %cx            
0000000000007c41 8ec1             mov %cx, %es            
0000000000007c43 8ed9             mov %cx, %ds            
0000000000007c45 8ed1             mov %cx, %ss            
0000000000007c47 bc007c           mov $0x7c00, %sp        
0000000000007c4a 89e6             mov %sp, %si            
0000000000007c4c bf0007           mov $0x700, %di         
0000000000007c4f fec5             incb %ch                
0000000000007c51 f3a5             rep movsw               
0000000000007c53 beee7d           mov $0x7dee, %si        
0000000000007c56 80fa80           cmpb $0x80, %dl         
0000000000007c59 722c             jb 0x7c87               
0000000000007c5b b601             mov $0x1, %dh           
0000000000007c5d e86000           call 0x7cc0             
0000000000007c60 b90100           mov $0x1, %cx           
0000000000007c63 bebe8d           mov $0x8dbe, %si        
0000000000007c66 b601             mov $0x1, %dh           
0000000000007c68 807c04a5         cmpb $0xa5, 0x4(%si)    
0000000000007c6c 7507             jnz 0x7c75              
0000000000007c6e e319             jcxz 0x7c89             
0000000000007c70 f60480           testb $0x80, (%si)      
0000000000007c73 7514             jnz 0x7c89              
0000000000007c75 83c610           addw $0x10, %si         
0000000000007c78 fec6             incb %dh                
0000000000007c7a 80fe05           cmpb $0x5, %dh          
0000000000007c7d 72e9             jb 0x7c68               
0000000000007c7f 49               dec %cx                 
0000000000007c80 e3e1             jcxz 0x7c63             
0000000000007c82 bea27d           mov $0x7da2, %si        
0000000000007c85 eb4b             jmp 0x7cd2              
0000000000007c87 31d2             xor %dx, %dx            
0000000000007c89 89160009         mov %dx, 0x900          
0000000000007c8d b610             mov $0x10, %dh          
0000000000007c8f e82e00           call 0x7cc0             
0000000000007c92 bb0090           mov $0x9000, %bx        
0000000000007c95 8b770a           mov 0xa(%bx), %si       
0000000000007c98 01de             add %bx, %si            
0000000000007c9a bf00c0           mov $0xc000, %di        
0000000000007c9d b900ae           mov $0xae00, %cx        
0000000000007ca0 29f1             sub %si, %cx            
0000000000007ca2 f3a4             rep movsb               
0000000000007ca4 fa               cli                     
0000000000007ca5 49               dec %cx                 
0000000000007ca6 7414             jz 0x7cbc               
0000000000007ca8 e464             in $0x64, %al           
0000000000007caa a802             test $0x2, %al          
0000000000007cac 75f7             jnz 0x7ca5              
0000000000007cae b0d1             mov $0xd1, %al          
0000000000007cb0 e664             out %al, $0x64          
0000000000007cb2 e464             in $0x64, %al           
0000000000007cb4 a802             test $0x2, %al          
0000000000007cb6 75fa             jnz 0x7cb2              
0000000000007cb8 b0df             mov $0xdf, %al          
0000000000007cba e660             out %al, $0x60          
0000000000007cbc fb               sti                     
0000000000007cbd e95013           jmp 0x9010              
0000000000007cc0 bb008c           mov $0x8c00, %bx        
0000000000007cc3 8b4408           mov 0x8(%si), %ax       
0000000000007cc6 8b4c0a           mov 0xa(%si), %cx       
0000000000007cc9 0e               push %cs                
0000000000007cca e85aff           call 0x7c27             
0000000000007ccd 732a             jae 0x7cf9              
0000000000007ccf be9d7d           mov $0x7d9d, %si        
0000000000007cd2 e81c00           call 0x7cf1             
0000000000007cd5 bea77d           mov $0x7da7, %si        
0000000000007cd8 e81600           call 0x7cf1             
0000000000007cdb 30e4             xor %ah, %ah            
0000000000007cdd cd16             int $0x16               
0000000000007cdf c70672043412     movw $0x1234, 0x472     
0000000000007ce5 eaf0ff00f0       jmp $0xf000, $0xfff0    
0000000000007cea bb0700           mov $0x7, %bx           
0000000000007ced b40e             mov $0xe, %ah           
0000000000007cef cd10             int $0x10               
0000000000007cf1 ac               lodsb                   
0000000000007cf2 84c0             test %al, %al           
0000000000007cf4 75f4             jnz 0x7cea              
0000000000007cf6 b401             mov $0x1, %ah           
0000000000007cf8 f9               stc                     
0000000000007cf9 c3               ret                     
0000000000007cfa 2ef606b00880     testb $0x80, %cs:0x8b0  
0000000000007d00 7422             jz 0x7d24               
0000000000007d02 80fa80           cmpb $0x80, %dl         
0000000000007d05 721d             jb 0x7d24               
0000000000007d07 bbaa55           mov $0x55aa, %bx        
0000000000007d0a 52               push %dx                
0000000000007d0b b441             mov $0x41, %ah          
0000000000007d0d cd13             int $0x13               
0000000000007d0f 5a               pop %dx                 
0000000000007d10 7212             jb 0x7d24               
0000000000007d12 81fb55aa         cmpw $0xaa55, %bx       
0000000000007d16 750c             jnz 0x7d24              
0000000000007d18 f6c101           testb $0x1, %cl         
0000000000007d1b 7407             jz 0x7d24               
0000000000007d1d 89ee             mov %bp, %si            
0000000000007d1f b442             mov $0x42, %ah          
0000000000007d21 cd13             int $0x13               
0000000000007d23 c3               ret                     
0000000000007d24 52               push %dx                
0000000000007d25 b408             mov $0x8, %ah           
0000000000007d27 cd13             int $0x13               
0000000000007d29 88f5             mov %dh, %ch            
0000000000007d2b 5a               pop %dx                 
0000000000007d2c 72cb             jb 0x7cf9               
0000000000007d2e 80e13f           andb $0x3f, %cl         
0000000000007d31 74c3             jz 0x7cf6               
0000000000007d33 fa               cli                     
0000000000007d34 668b4608         mov 0x8(%bp), %eax      
0000000000007d38 52               push %dx                
0000000000007d39 660fb6d9         movzxb %cl, %ebx        
0000000000007d3d 6631d2           xor %edx, %edx          
0000000000007d40 66f7f3           div %ebx                
0000000000007d43 88eb             mov %ch, %bl            
0000000000007d45 88d5             mov %dl, %ch            
0000000000007d47 43               inc %bx                 
0000000000007d48 30d2             xor %dl, %dl            
0000000000007d4a 66f7f3           div %ebx                
0000000000007d4d 88d7             mov %dl, %bh            
0000000000007d4f 5a               pop %dx                 
0000000000007d50 663dff030000     cmp $0x3ff, %eax        
0000000000007d56 fb               sti                     
0000000000007d57 779d             ja 0x7cf6               
0000000000007d59 86c4             xchg %al, %ah           
0000000000007d5b c0c802           rorb $0x2, %al          
0000000000007d5e 08e8             or %ch, %al             
0000000000007d60 40               inc %ax                 
0000000000007d61 91               xchg %ax, %cx           
0000000000007d62 88fe             mov %bh, %dh            
0000000000007d64 28e0             sub %ah, %al            
0000000000007d66 8a6602           mov 0x2(%bp), %ah       
0000000000007d69 38e0             cmp %ah, %al            
0000000000007d6b 7202             jb 0x7d6f               
0000000000007d6d b001             mov $0x1, %al           
0000000000007d6f bf0500           mov $0x5, %di           
0000000000007d72 c45e04           les 0x4(%bp), %bx       
0000000000007d75 50               push %ax                
0000000000007d76 b402             mov $0x2, %ah           
0000000000007d78 cd13             int $0x13               
0000000000007d7a 5b               pop %bx                 
0000000000007d7b 730a             jae 0x7d87              
0000000000007d7d 4f               dec %di                 
0000000000007d7e 741c             jz 0x7d9c               
0000000000007d80 30e4             xor %ah, %ah            
0000000000007d82 cd13             int $0x13               
0000000000007d84 93               xchg %ax, %bx           
0000000000007d85 ebeb             jmp 0x7d72              
0000000000007d87 0fb6c3           movzxb %bl, %ax         
0000000000007d8a 014608           add %ax, 0x8(%bp)       
0000000000007d8d 7303             jae 0x7d92              
0000000000007d8f ff460a           incw 0xa(%bp)           
0000000000007d92 d0e3             shlb , %bl              
0000000000007d94 005e05           add %bl, 0x5(%bp)       
0000000000007d97 284602           sub %al, 0x2(%bp)       
0000000000007d9a 7788             ja 0x7d24               
0000000000007d9c c3               ret                     
0000000000007d9d 52               push %dx                
0000000000007d9e 6561             popa                    
0000000000007da0 6400426f         add %al, %fs:0x6f(%bp,%si)
0000000000007da4 6f               outsw                   
0000000000007da5 7400             jz 0x7da7               
0000000000007da7 206572           and %ah, 0x72(%di)      
0000000000007daa 726f             jb 0x7e1b               
0000000000007dac 720d             jb 0x7dbb               
0000000000007dae 0a00             or (%bx,%si), %al       
0000000000007db0 8090909090       adcb $0x90, 0x9090(%bx,%si)
0000000000007db5 90               nop                     
0000000000007db6 90               nop                     
0000000000007db7 90               nop                     
0000000000007db8 90               nop                     
0000000000007db9 90               nop                     
0000000000007dba 90               nop                     
0000000000007dbb 90               nop                     
0000000000007dbc 90               nop                     
0000000000007dbd 90               nop                     
0000000000007dbe 0000             add %al, (%bx,%si)      
0000000000007dc0 0000             add %al, (%bx,%si)      
0000000000007dc2 0000             add %al, (%bx,%si)      
0000000000007dc4 0000             add %al, (%bx,%si)      
0000000000007dc6 0000             add %al, (%bx,%si)      
0000000000007dc8 0000             add %al, (%bx,%si)      
0000000000007dca 0000             add %al, (%bx,%si)      
0000000000007dcc 0000             add %al, (%bx,%si)      
0000000000007dce 0000             add %al, (%bx,%si)      
0000000000007dd0 0000             add %al, (%bx,%si)      
0000000000007dd2 0000             add %al, (%bx,%si)      
0000000000007dd4 0000             add %al, (%bx,%si)      
0000000000007dd6 0000             add %al, (%bx,%si)      
0000000000007dd8 0000             add %al, (%bx,%si)      
0000000000007dda 0000             add %al, (%bx,%si)      
0000000000007ddc 0000             add %al, (%bx,%si)      
0000000000007dde 0000             add %al, (%bx,%si)      
0000000000007de0 0000             add %al, (%bx,%si)      
0000000000007de2 0000             add %al, (%bx,%si)      
0000000000007de4 0000             add %al, (%bx,%si)      
0000000000007de6 0000             add %al, (%bx,%si)      
0000000000007de8 0000             add %al, (%bx,%si)      
0000000000007dea 0000             add %al, (%bx,%si)      
0000000000007dec 0000             add %al, (%bx,%si)      
0000000000007dee 800001           addb $0x1, (%bx,%si)    
0000000000007df1 00a5feff         add %ah, 0xfffe(%di)    
0000000000007df5 ff00             incw (%bx,%si)          
0000000000007df7 0000             add %al, (%bx,%si)      
0000000000007df9 0050c3           add %dl, -0x3d(%bx,%si) 
0000000000007dfc 0000             add %al, (%bx,%si)      
0000000000007dfe 55               push %bp                
0000000000007dff aa               stosb