mirror of
https://github.com/fadden/6502bench.git
synced 2024-12-01 22:50:35 +00:00
a395909574
Added a project with a few bad address region definitions, and one to exercise the security sandbox. Also, fiddled with the documentation a little.
48 lines
1.4 KiB
C#
48 lines
1.4 KiB
C#
// Copyright 2021 faddenSoft. All Rights Reserved.
|
|
// See the LICENSE.txt file for distribution terms (Apache 2.0).
|
|
|
|
using System;
|
|
//using System.Collections.Generic;
|
|
using System.IO;
|
|
|
|
using PluginCommon;
|
|
|
|
namespace FunkyTest {
|
|
/// <summary>
|
|
/// Extension script that tries to violate the security sandbox.
|
|
/// </summary>
|
|
public class BadExt: MarshalByRefObject, IPlugin {
|
|
private IApplication mAppRef;
|
|
private byte[] mFileData;
|
|
|
|
public string Identifier {
|
|
get {
|
|
return "Bad test";
|
|
}
|
|
}
|
|
|
|
public void Prepare(IApplication appRef, byte[] fileData, AddressTranslate addrTrans) {
|
|
mAppRef = appRef;
|
|
mFileData = fileData;
|
|
|
|
mAppRef.DebugLog("BadTest(id=" + AppDomain.CurrentDomain.Id + "): prepare()");
|
|
|
|
// The behavior should be either "found" or "not found" depending on whether or
|
|
// not the security sandbox is enabled. The output is visible in the analyzer
|
|
// output window.
|
|
mAppRef.DebugLog("Testing file access...");
|
|
string testDir = @"C:\";
|
|
if (Directory.Exists(testDir)) {
|
|
mAppRef.DebugLog("Found " + testDir);
|
|
} else {
|
|
mAppRef.DebugLog("No such file " + testDir);
|
|
}
|
|
}
|
|
|
|
public void Unprepare() {
|
|
mAppRef = null;
|
|
mFileData = null;
|
|
}
|
|
}
|
|
}
|