« Return to Thread: VisualwebGUI 6.0.4, Framework 2.0 working with Linux + Mono.

Re: VisualwebGUI 6.0.4, Framework 2.0 working with Linux + Mono.

by linuxfreak@uy :: Rate this Message:

Reply to Author | View in Thread

Well I have something here, with the stack trace you posted the last time I disassembled (a few days ago) 'Gizmox.WebGUI.Server' (version 6.0.4, 6.1 and 6.1.2 for FRAMEWORK 2.0) and looked what the method (is a property actually) was all about and all I could see it's a simple property which returns a Boolean nothing more so I discarded it as the source of the exception you are experiencing. Now looking your IL code it tooked me a few seconds to realize that your version of "get_ChacheOK" is not like any I saw before so I went directly to disassemble the 'Gizmox.WebGUI.Server' for FRAMEWORK 3.5, look for 'get_CacheOk' and bingo. Now I was at the right place to start and I don't know if you already mentioned it but I didn't know that you were using VWG for framework 3.5.  

I'm quite sure that there's something suspicious at the 'get_CacheOK' (assembly for framework 3.5) , first it's full of 'nop' operations (more likely operation from a patched assembly that from a compiled/built assembly) then it's also full of 'br.s' operations and finally at least one of the 'brfalse.s' I think could throw an exception (the famous invalid IL code exception, IL_0006:  brfalse.s  IL_000b).

#
#get_CacheOK (IL code for the other versions of VWG for framework 2.0)
#
# Only one operation here, returning a bool variable value.
#

.method /*06000016*/ assembly hidebysig specialname static
          bool  get_CacheOK() cil managed
  // SIG: 00 00 02
  {
    // Method begins at RVA 0x22ec
    // Code size       6 (0x6)
    .maxstack  8
    IL_0000:  /* 7E   | (04)00000E       */ ldsfld     bool Gizmox.WebGUI.Server.Cache/*02000006*/::'60AAA' /* 0400000E */
    IL_0005:  /* 2A   |                  */ ret
  } // end of method Cache::get_CacheOK


Notice that the the last two operations from the IL code for the 'get_CacheOK' of the assembly for framework 3.5 (what Stephanus sent) are the same operations I just put in here which are the RETURN of a boolean value from an existing BOOLEAN variable therefore the other operations seems to be void and they do nothing meaningful.

If you want you can use (in Windows) besides 'ildasm' or 'IDA', an interesting application that maybe you already know called 'Reflector' (sort of decompiler which uses reflection, etc.) and if you try to view the 'get_CacheOK' property it throws an exception and that for me is the verification that I needed to affirm that that code is bugged or something.

I will report this to the VWG guys to know what they can tell us.


Stephanus van Staden wrote:
I did some further testing and tried to see if my 64bit issue will go away on a another platform and another version of Mono.  I think I must mention that this work with Microsoft .Net 2.0
I'm now trying to find where the problem lies - Mono or WebGUI

So I tried Opensuse 10.2 (32 bit x86)  - Mono JIT compiler version 2.1 - Latest VisualWebGUI 6.1.2

I now even get the error on 32 bit - the same problem - so I disassemled the function that give the problem and it seems like the Mono does not like IL_0006 (see below).  I do not have any experience in the IL stuff - but it seems like something to do with the way an if/switch statement is compiled and then obfuscated  (I'm just guessing...)
Maybe it is obvious to someone else who knows the IL stuff by heart.

.method assembly hidebysig specialname static
        bool  get_CacheOK() cil managed
{
  // Code size       31 (0x1f)
  .maxstack  8
  IL_0000:  nop
  IL_0001:  nop
  IL_0002:  ldc.i4.1
  IL_0003:  br.s       IL_0012
  IL_0005:  nop
  IL_0006:  brfalse.s  IL_000b
  IL_0008:  nop
  IL_0009:  br.s       IL_0018
  IL_000b:  ldc.i4.1
  IL_000c:  brfalse.s  IL_0015
  IL_000e:  br.s       IL_0000
  IL_0010:  br.s       IL_0014
  IL_0012:  br.s       IL_0005
  IL_0014:  nop
  IL_0015:  ldc.i4.0
  IL_0016:  brtrue.s   IL_0002
  IL_0018:  nop
  IL_0019:  ldsfld     bool Gizmox.WebGUI.Server.Cache::'12AA0'
  IL_001e:  ret
} // end of method Cache::get_CacheOK

 « Return to Thread: VisualwebGUI 6.0.4, Framework 2.0 working with Linux + Mono.