-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: spark
Message 5 in Discussion


well 
ildasm is limited , atleast for now, to disassemble IL binary. 

yes 
you exe can have native code mixed with your IL code - ildasm usually doesnt 
touch the native code.
 
its 
question of how you look at it right ? various systems have dissemblers and they 
are all not always coverting ix86 binary to human readable form. ILdams also 
puts in the effort of turing a lot of other information in teh exe to a readable 
form other than just the IL code.
 
about 
the mixed binary here is an example that i had mailed someone 
today:
do 
glance thorugh this :
 

#include 
<stdio.h>
#using <mscorlib.dll>
using namespace 
System;
 
__gc class 
managed
{
public:
 static void 
hello()
 {
  Console::WriteLine("hello");
 }
};
 
class 
unmanaged
{
public:
 static void 
hello()
 {
  _asm {
   mov 
ax,0
  }
  printf("hello");
 }
}; 
 
void 
main()
{
 unmanaged::hello();
}
 
 
and after 
compilation :
>cl /clr 
/Famix.cpp.asm  mix.cpp 
 
 
; Listing generated by 
Microsoft (R) Optimizing Compiler Version 13.00.9466 
 
; Generated by VC++ for 
Common Language Runtime
file "mix.cpp"
global [EMAIL PROTECTED]@hello?$AA@   ; 
`string'
; File 
d:\roshanj\work\cpp\mcpp\mix.cpp
 .data
 .comdat any, [EMAIL PROTECTED]@hello?$AA@
 
[EMAIL PROTECTED]@hello?$AA@:    ; 
`string'
 .ascii "hello\000"
; Function compile flags: 
/Odt
 .text
 .comdat any, [EMAIL PROTECTED]@@$$FSMXXZ
global [EMAIL PROTECTED]@@$$FSMXXZ   ; 
managed::hello
[EMAIL PROTECTED]@@$$FSMXXZ:    ; 
managed::hello
; .proc.def D:V()
 
; Function Header:
; 
max stack depth = 1
; function size = 16 bytes
; local varsig tk = 0x0 

; Exception Information:
; 0 handlers, each consisting of filtered 
handlers
 

; .proc.beg
; Line 
10
 ldsflda  [EMAIL PROTECTED]@hello?$AA@
 newobj  [EMAIL PROTECTED]@@[EMAIL PROTECTED]@Z
 call  [EMAIL PROTECTED]@System@@[EMAIL PROTECTED]@@Z
$L2209:
; Line 11
 ret  
 .end 
[EMAIL PROTECTED]@@$$FSMXXZ    ; 
managed::hello
; .proc.end.void
; Function compile flags: 
/Odt
 .text
 .comdat any, ??0managed@@[EMAIL PROTECTED]
global ??0managed@@[EMAIL PROTECTED]    ; managed::managed
??0managed@@[EMAIL PROTECTED]:    ; 
managed::managed
; .proc.def D:V()
 
; Function Header:
; max stack depth = 1
; 
function size = 7 bytes
; local varsig tk = 0x0 
; Exception 
Information:
; 0 handlers, each consisting of filtered handlers
 
; .formal.mptr 0,"_this$" SIG: Optional C Binding 
Modifier(token:0x82DB52).class (token:0x82DB54)
 
; .proc.beg
 ldarg.0    ; 
_this$
 call  [EMAIL PROTECTED]@@[EMAIL PROTECTED]
$L2211:
 ret  
 .end ??0managed@@[EMAIL PROTECTED]    ; 
managed::managed
; .proc.end.void
; Function compile flags: 
/Odt
 .text
global ?main@@$$HYAHXZ     ; main
?main@@$$HYAHXZ:     ; 
main
; .proc.def D:I()
 
; Function Header:
; max stack depth = 1
; 
function size = 7 bytes
; local varsig tk = 0x0 
; Exception 
Information:
; 0 handlers, each consisting of filtered handlers
 

; .proc.beg
; Line 
28
 call  [EMAIL PROTECTED]@@$$FSAXXZ
 ldc.i.0  0  ; i32 0x0
$L2221:
; 
Line 29
 ret  
 .end ?main@@$$HYAHXZ     ; 
main
; .proc.end.i4
text ENDS
PUBLIC [EMAIL PROTECTED]@@$$HYAHXZ
; COMDAT [EMAIL PROTECTED]@@$$HYAHXZ
data SEGMENT
[EMAIL PROTECTED]@@$$HYAHXZ TOKEN 06000004
; Function compile flags: 
/Odt
data ENDS
; COMDAT 
_main
text SEGMENT
_main PROC 
NEAR     ; COMDAT
 jmp DWORD PTR [EMAIL PROTECTED]@@$$HYAHXZ
_main ENDP
text ENDS
PUBLIC [EMAIL PROTECTED]@@SAXXZ    ; 
unmanaged::hello
EXTRN _printf:NEAR
; Function compile flags: 
/Odt
; COMDAT [EMAIL PROTECTED]@@SAXXZ
text SEGMENT
 
//////////////////////////////////////// <---look at 
this part good old assembly

[EMAIL PROTECTED]@@SAXXZ PROC NEAR   ; unmanaged::hello, COMDAT
; Line 
18
 push ebp
 mov ebp, esp
; Line 
20
 mov ax, 0
; Line 22
 push OFFSET 
FLAT:[EMAIL PROTECTED]@hello?$AA@
 call _printf
 add esp, 
4
; Line 23
 pop ebp
 ret 0
[EMAIL PROTECTED]@@SAXXZ ENDP    ; 
unmanaged::hello
text ENDS
END


-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/BDotNet/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you received 
this message by mistake, please click the "Remove" link below. On the pre-addressed 
e-mail message that opens, simply click "Send". Your e-mail address will be deleted 
from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to