the problem starts with a function call to a mono function that is not supported yet. the call is made from a close matlab DLL called MWARRAY.DLL (.net version 2.x), this dll is normally used with VS .NET and is working if you use .net 3.5.

the function is : [mscorlib]System.Security.Principal.WindowsIdentity::GetCurrent(bool)

I can think of a few possible solution, but i am not sure how to do them:

  1. decompile dll and replace byte code with a similar and working function: [mscorlib]System.Security.Principal.WindowsIdentity::GetCurrent() notice that there is no boolean passed to the function
  2. compile mono and write the function myself
  3. using an old version of MWARRAY.DLL (couldnt find, but might still use the same code)

for the decompilation i used IDA. i found the location where there is a call to the first function, CIL + HEX below

loc_38B1:    
ldsfld  native     
int [mscorlib]System.IntPtr::Zero   
stloc.s 7    
ldc.i4.0
stloc.s 8
ldc.i4.1
stloc.s 9
ldc.i4.1
call    class [mscorlib]System.Security.Principal.WindowsIdentity::GetCurrent(bool)
stloc.s 0xA
call    void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::PrepareConstrainedRegions()
  .try {
ldc.i4.0
stloc.s 0xB
br      loc_3982

the HEX of the call and stloc commands:

28 96 00 00 0A 

i also compiled and decompiled my own dll, with calls to both functions just to see how the other command looks in byte code:

loc_3AE:
call    class [mscorlib]System.Security.Principal.WindowsIdentity [mscorlib]System.Security.Principal.WindowsIdentity::GetCurrent()
callvirt class System.String [mscorlib]System.Security.Principal.WindowsIdentity::get_Name()
stloc.s 8
ldc.i4.1

hex of the custom compiled/decompiled lines in bold:

28  00 00 0A 6F 1B 00 00 0A  13 08 17

i would like to know if anyone has an idea of the proposed solution paths, or anything else that might come in mind ?

1

There are 1 best solutions below

0
On BEST ANSWER

this has been solved.

using .net reflector to extract mwarray.dll it is possible to change the code from inside visual studio.

in class MCR() around line 330 there is a call to getcurrent(). replace with =null;