[Mono-dev] Mono.Security.StrongName.Verify Assemblies In Memory?

2008-04-07 Thread Jim Purbrick (Babbage)
We ship assemblies around over the network a lot and would like to be able to use Mono.Security.StrongName to verify assemblies without writing them to disk. Would it be OK to add Mono.Security.StrongName.Verfiy(Stream) and refactor some of the internals of Mono.Security.StrongName to

Re: [Mono-dev] What would you like to see in Mono?

2006-03-29 Thread Jim Purbrick
Hi Miguel, What would be the top feature you would like to see in Mono? 1) Explicit (GC_Free style) assembly unloading. 2) Assembly unloading via application domain unload. 3) Full bytecode verification. (But you knew that) ;-) Cheers, Jim/Babbage.

[Mono-dev] 1488 Ways To Break A Runtime

2006-02-23 Thread Jim Purbrick
New archive here: http://homepage.ntlworld.com/james.purbrick/VerifierTests7.tar I've added tests for assignment compatibility and new tests for merging stack state based on the verification type compatibility rules. All the new tests assembly with mono ilasm and give the expected errors when

Re: [Mono-dev] 1003 Ways To Break A Runtime

2006-02-21 Thread Jim Purbrick
ILASM doesn't seem to like them. I tried .field public int32 i .field public class [mscorlib]System.TypedReference val2 Both ilasm .net and mono are able to compile this. Oops, sorry Ankit, my fault. It was a problem with the scripts. I've fixed them and uploaded a new

[Mono-dev] 1076 Ways To Break A Runtime

2006-02-21 Thread Jim Purbrick
New archive here: http://homepage.ntlworld.com/james.purbrick/VerifierTests5.tar This version incorporates all of the old tests. Most are generated from templates, but there were the odd few that didn't warrant a template and couldn't be generated from an existing one, so I've just included

[Mono-dev] 1003 Ways To Break A Runtime

2006-02-20 Thread Jim Purbrick
Hi Paolo/All, I've started using templates parameterized by types and opcodes as it makes the tests much easier to write and check. I've written tests for shifts, stack merging and coercion this way and started converting the old tests and now have 15 shell scripts which generate 1003 tests :-)

Re: [Mono-dev] The State Of Mono Assembly Verification?

2006-02-17 Thread Jim Purbrick
Hi Paolo/All, --- Paolo Molaro [EMAIL PROTECTED] wrote: I'd like this to be done a bit differently. Take the existing tests you made and change (for example for the 3.1 ones) add with BINARY_NUM_OP. Then a little script will copy and replace and create tests for each of a list of opcodes.

Re: [Mono-dev] The State Of Mono Assembly Verification?

2006-02-16 Thread Jim Purbrick
OK, I've uploaded a first batch of ~230 verifier tests based on ECMA-335 III here: http://homepage.ntlworld.com/james.purbrick/VerifierTests.tar I'd appreciate it if you could take a look and let me know if they look OK, especially the III,3.1 and III,3.3 tests which I'll mechanically copy and

Re: [Mono-dev] Security spokesperson

2006-02-03 Thread Jim Purbrick
Hello Christopher, That's great news! I've obviously been spending quite a bit of time rummaging around in Mono and ECMA-335 III,1.8 and will help out as much as I can! Cheers, Jim. --- Sebastien Pouliot [EMAIL PROTECTED] wrote: Hello Christopher, On Fri, 2006-02-03 at 09:06 +0200,

Re: [Mono-dev] The State Of Mono Assembly Verification?

2006-02-02 Thread Jim Purbrick
mono_method_verify () has been superseded by verification during JIT time. When JIT time verification is failed is there an exception thrown that an embedding app can use to take appropriate action? The latter is more correct and complete, though a few checks are still missing. Do you know

Re: [Mono-dev] The State Of Mono Assembly Verification?

2006-02-02 Thread Jim Purbrick
Hi Everyone, It's good to see a healthy debate about these issues :-) I second this. It would be very very useful for us if mono wouldn't g_assert but throw exceptions when the dll is invalid/broken/obfuscated/maliciously modified. Does that mean that you might be able to contribute some

Re: [Mono-dev] The State Of Mono Assembly Verification?

2006-02-02 Thread Jim Purbrick
Sounds good! This is the way we'd ideally like to be able to use the verifier: call an API from the process which embeds mono to check the verifiability of an assembly. If the assembly passes the test we store it as an asset and allow it to be loaded. If it fails the test we delete it. It might

[Mono-dev] Re: [Mono-devel-list] Limiting Memory Allocation

2006-01-18 Thread Jim Purbrick
Hi Ben/Everyone, --- Ben Maurer [EMAIL PROTECTED] wrote: Look at heap-prof. My profiler traps memory freed by the gc. This is currently what I'm using to measure the memory used by different scripts. I basically wrap calls to the scripts in calls to the profiler which turn on and off memory

[Mono-dev] Re: [Mono-devel-list] Limiting Memory Allocation

2006-01-18 Thread Jim Purbrick
Hi Ben/Everyone, --- Ben Maurer [EMAIL PROTECTED] wrote: Look at heap-prof. My profiler traps memory freed by the gc. This is currently what I'm using to measure the memory used by different scripts. I basically wrap calls to the scripts in calls to the profiler which turn on and off memory

Re: [Mono-dev] Re: [Mono-devel-list] Limiting Memory Allocation

2006-01-18 Thread Jim Purbrick
the memory allocated by the script itself, I think the best solution would be to explicitly generate code to track it, i.e. for each newobj or newarr IL opcode you emit, emit some statements to increase a counter or something. Zoltan On 1/18/06, Jim Purbrick

Re: [Mono-dev] Creating AppDomains From Embedded Mono

2006-01-12 Thread Jim Purbrick
(). Zoltan On 1/12/06, Jim Purbrick [EMAIL PROTECTED] wrote: Hi Robert, Setting MONO_CFG_DIR to C:\Apps\Mono-1.1.13\etc and MONO_PATH to C:\Apps\Mono-1.1.13\lib didn't seem to help. Calling mono_set_dirs(C:\\Apps\\Mono-1.1.13\\lib, C:\\Apps\\Mono-1.1.13\\etc) before

Re: [Mono-dev] Creating AppDomains From Embedded Mono

2006-01-11 Thread Jim Purbrick
Hi Robert/Lupus/Everyone, I've tried Robert's approach (which cleans my code up, but is vulnerable to changes in _MonoAppDomain as Paolo said), but I still get the same crash when making the mono_runtime_invoke() call to AppDomain.CreateDomain(). At this point I'm struggling with the limited

Re: [Mono-dev] Creating AppDomains From Embedded Mono

2006-01-11 Thread Jim Purbrick
it and it seems to work on linux, I will try to look into the windows problems shortly. Zoltan On 1/11/06, Jim Purbrick [EMAIL PROTECTED] wrote: Hi Robert/Lupus/Everyone, I've tried Robert's approach (which cleans my code up, but is vulnerable to changes

Re: [Mono-dev] Creating AppDomains From Embedded Mono

2006-01-11 Thread Jim Purbrick
, Cheers, Jim. --- Jim Purbrick [EMAIL PROTECTED] wrote: Thanks Zoltan, I've got it working on Linux too and it used to work on Windows until my hard drive died and I needed to reinstall. I can't think how my old and new Windows installations differ, so if you get it working I'll

RE: [Mono-dev] Problems Building Mono 1.1.12.1 on Windows

2006-01-10 Thread Jim Purbrick
Hi Jonathan (all), Do you have any anti-virus software installed? I (had) Norton installed and I could only build if Norton was shutoff. Bingo! I did have Norton 2005 AV installed and now I've got rid of it I'm not seeing the build process hang anymore. I would have spent ages fiddling with

[Mono-dev] Creating AppDomains From Embedded Mono

2006-01-10 Thread Jim Purbrick
Hi Everyone, I seem to have fixed my build problems: I ran make again without changing anything and managed to build the mono 1.1.13 tree in cygwin with the mono 1.1.13 windows installation. Slightly disconcerting as it crashed the last time I tried it... I can run the Second Life simulator

[Mono-dev] Accessing Loaded Assembly Data

2005-12-16 Thread Jim Purbrick
Hi everyone, I'm currently using Assembly.Load(byte[]) to load assemblies from memory. Is there a way to get the byte array back later using either the .NET or Mono embedding APIs? I don't want to have to keep a copy hanging around in memory if I can ask for the array back again. Merry

[Mono-dev] Saving And Loading Assemblies To/From Memory

2005-11-25 Thread Jim Purbrick
Hi, I'm currently using Assembly.Load(Byte[]) to load assemblies and wondered if there was a way to save assemblies back to byte arrays either using the framework or embedding APIs? Saving and loading assemblies to and from memory in this way would be much easier for me than having to use files

Re: [Mono-dev] Debugging Busted CIL

2005-10-04 Thread Jim Purbrick
Did you verify the assembly? Mono: pedump --verify code assembly I'm now getting an interesting error from pedump: Error: Incompatible type Managed Pointer in store at 0x029a What I'm trying to do is store the result of a ldflda instruction. The StackBehaviourPush of the ldflda

Re: [Mono-dev] Debugging Busted CIL

2005-10-04 Thread Jim Purbrick
Is is possible to store and load Managed Pointers in CIL? How? Sorry, should have googled a bit more before my last post. Looks like I can store a Managed Pointer in a local, but not a field :-( http://dotnet.di.unipi.it/EcmaSpec/PartitionIII/cont1.html#_Toc526908860 Looks like I won't be

Re: [Mono-dev] Debugging Busted CIL

2005-10-04 Thread Jim Purbrick
Looks like I can store a Managed Pointer in a local, but not a field :-( Right, storing in a field would have both security and performance effects in the GC, so it's not allowed. OK, to solve that problem it looks as though the best approach is to make sure the value of the field is

[Mono-dev] Debugging Busted CIL

2005-10-03 Thread Jim Purbrick
I'm currently trying to work out what is wrong with some assemblies I've generated and thought that people on the list might have some cunning techniques that I haven't thought of. Currently my process consists of running my app which embeds Mono, waiting for it to spit out an **ERROR**:Invalid

Re: [Mono-dev] Debugging Busted CIL

2005-10-03 Thread Jim Purbrick
Hi Robert, How are you generating the assemblies? Are this assemblies generated by MS tools? Mono doesn't support incremental assemblies generated by CSC. I'm compiling LSL to CIL, then using the mono ILasm compiler to generate assemblies. Did you verify the assembly? Mono: pedump

Re: [Mono-dev] What about the Windows setup of Mono?

2005-09-29 Thread Jim Purbrick
Hi Wade, I'd really like mono.dll and mono.lib files packaged with the Windows install so I can embed mono on Windows. Currently I have to use cygwin to build on Windows from source just to generate a dll and lib to link against (there may be an easier way to do this, please let me know).

Re: [Mono-dev] What about the Windows setup of Mono?

2005-09-29 Thread Jim Purbrick
Hi Kornél, These files could be included in the installer. Great! But how do you compile Mono to have .lib files? I get no .lib files when compiling Mono. Or do you use Visual C++ .NET? I build the DLL using GCC then use a batch file called genlib (which uses the VC tool dumpbin) to

[Mono-dev] Re: [Mono-devel-list] AOT + Embedding = ?

2005-09-26 Thread Jim Purbrick
Hi All, This is due to a problem in out embedding interface. It is now tracked as: http://bugzilla.ximian.com/show_bug.cgi?id=75194 I've now updated to 1.1.9 on Debian sarge and AOT assemblies seem to be looked for and loaded properly, thanks. However, I'm now oprofiling the server

Re: [Mono-devel-list] Preview of release notes.

2005-06-16 Thread Jim Purbrick
Visual Studio solution to build Mono runtime natively on Windows. This is useful if you are embedding the Mono runtime into your application and want to debug and single step inside Mono. Thank you so much for this! It's going to make my life a lot easier! Keep up all the great work

Re: [Mono-devel-list] AOT + Embedding = ?

2005-06-09 Thread Jim Purbrick
the runtime is able to find the AOT compiled assemblies /methods. Zoltan On 6/8/05, Jim Purbrick [EMAIL PROTECTED] wrote: Hi all, Is there a way to use AOT compilation when embedding mono (or find out if AOT compiled assemblies are being used)? I'm getting a performance

Re: [Mono-devel-list] Re: Assembly Unloading

2005-05-26 Thread Jim Purbrick
Hi Zoltan, Appdomains should be unloaded using mono_domain_unload (), not mono_domain_free (). mono_domain_unload() only seems to be declared and defined within appdomain.c, is there any reason for this, or could it be declared in appdomain.h so I can call it? When I removed all the calls

Re: [Mono-devel-list] merging two assemblies and related problems

2005-05-20 Thread Jim Purbrick
Hi Vladimir, --- Vladimir Vukicevic [EMAIL PROTECTED] wrote: 3) Use RAIL (http://rail.dei.uc.pt/). I'm currently using RAIL and Mono-1.1.7 on Windows to transform assemblies. I initially had some problems getting the test application running on Mono-1.1.4, but Zoltan fixed them. So, try

[Mono-devel-list] Assembly Unloading

2005-05-08 Thread Jim Purbrick
Hi Zoltan, Now that Sebastien has helped make the security situation clearer, I think unloading assemblies is (hopefully) the last big issue I need to resolve. I've had a look at mono_assembly_close and it looks like it might be OK to just call that to get rid of the assmembly for a script.

RE: [Mono-devel-list] Limiting Memory Allocation

2005-05-06 Thread Jim Purbrick
Hi Sebastien, (Apologies for any confusion, I'm rationalising the private and public conversations I've ended up having with Sebastien and the list) So my big return question is what's kind of environment will you be supporting ?. The more accurate your answer is, the more accurate mine

Re: [Mono-devel-list] Limiting Memory Allocation

2005-05-05 Thread Jim Purbrick
Even with CAS on Microsoft's .NET, the system isn't really geared to running the way you need to on a game server. No, it's not, but with Mono you get a very good virtual machine that (hopefully) just needs some panel beating in places to work in a game server. In contrast with the Java

Re: [Mono-devel-list] Limiting Memory Allocation

2005-05-05 Thread Jim Purbrick
--- Zoltan Varga [EMAIL PROTECTED] wrote: Hi, Keep in mind that mono currently doesn't support code access security (CAS), so running assemblies containing untrusted CIL code is not a very safe thing to do. Zoltan Is there

Re: [Mono-devel-list] Limiting Memory Allocation

2005-05-05 Thread Jim Purbrick
--- Jim Purbrick [EMAIL PROTECTED] wrote: Paolo was talking about DynamicMethod Lightweight Code Generation stuff as a potential solution to this problem, which I'm planing to look in to. Hmmm, I've had a look at this and I don't think DynamicMethod is going to be enough. Besides Richard's

Re: [Mono-devel-list] Limiting Memory Allocation

2005-05-04 Thread Jim Purbrick
--- Jim Purbrick [EMAIL PROTECTED] wrote: I've got the allocation tracking working with the profiling API, can work out how much memory a script has allocated and throw an exception from there when the limit is reached (admitedly after the allocation which breaks the limit). Is there a way

Re: [Mono-devel-list] Limiting Memory Allocation

2005-05-04 Thread Jim Purbrick
Hi Richard! Given that you are generating all the code from a source script at runtime, why don't you just inject code to monitor memory usage inline? Unless you are revising LSL (I'm a secondlife user) all data operations are value based, so it's pretty easy to see where memory is

Re: [Mono-devel-list] Limiting Memory Allocation

2005-05-04 Thread Jim Purbrick
--- Zoltan Varga [EMAIL PROTECTED] wrote: Hi, Keep in mind that mono currently doesn't support code access security (CAS), so running assemblies containing untrusted CIL code is not a very safe thing to do. You've both touched on the big issue

[Mono-devel-list] Passing Lists To Unmanaged Code

2005-04-15 Thread Jim Purbrick
I'm currently embedding mono in a virtual world to support user scripting. The managed scripts need to call library functions implemented in unmanaged code that take or return lists. Is it possible to pass lists across the managed/unmanaged boundary? If so, what's the best way to do it? A lot of

[Mono-devel-list] Saving And Loading Stacks (Embedding Mono in a Virtual World)

2005-03-21 Thread Jim Purbrick
--- Jim Purbrick [EMAIL PROTECTED] wrote: --- Willibald Krenn [EMAIL PROTECTED] wrote: Is it possible to save and load mono stacks? I don't think this will work. You'd have to guarantee that all code (JIT compiled methods) is at the same place, the methods are actually compiled

Re: [Mono-devel-list] Embedding Mono in a Virtual World

2005-03-18 Thread Jim Purbrick
--- Willibald Krenn [EMAIL PROTECTED] wrote: Is it possible to save and load mono stacks? I don't think this will work. You'd have to guarantee that all code (JIT compiled methods) is at the same place, the methods are actually compiled, all VMTs are correctly initialized, ... Hmm. I

Re: [Mono-devel-list] Embedding Mono in a Virtual World

2005-03-18 Thread Jim Purbrick
--- Rodrigo B. de Oliveira [EMAIL PROTECTED] wrote: You might be able to cook up something with serializable objects and lightweight threads based on generators (yield) But this is just food for though... Yes, this is the other option. You end up with something that looks like

Re: [Mono-devel-list] Embedding Mono in a Virtual World

2005-03-16 Thread Jim Purbrick
to different scripts. Once we can save and load stacks in order to migrate scripts we might be able to use that mechanism as the basis of user threading which would give us more control over script scheduling. Cheers, Jim. --- Paolo Molaro [EMAIL PROTECTED] wrote: On 02/11/05 Jim Purbrick wrote: I