Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ mono_crash.*
#[Oo]bj/
#[Ll]og/
#[Ll]ogs/
Debug.zip
Release.zip

# Visual Studio 2015/2017 cache/options directory
.vs/
Expand Down
15 changes: 11 additions & 4 deletions FlashpointSecurePlayer/CustomSecurityManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,9 @@ int InternetInterfaces.IInternetSecurityManager.GetSecuritySite(out IntPtr pSite
}

int InternetInterfaces.IInternetSecurityManager.MapUrlToZone([MarshalAs(UnmanagedType.LPWStr)] string pwszUrl, ref uint pdwZone, uint dwFlags) {
pdwZone = 0;
return INET_E_DEFAULT_ACTION;
// behave like local intranet
pdwZone = 1;
return S_OK;
}

int InternetInterfaces.IInternetSecurityManager.GetSecurityId([MarshalAs(UnmanagedType.LPWStr)] string pwszUrl, [MarshalAs(UnmanagedType.LPArray)] byte[] pbSecurityId, ref uint pcbSecurityId, uint dwReserved) {
Expand All @@ -77,7 +78,6 @@ int InternetInterfaces.IInternetSecurityManager.ProcessUrlAction([MarshalAs(Unma
dwAction == URLACTION_HTML_MIXED_CONTENT || // block HTTPS content on HTTP websites for Flashpoint Proxy
dwAction == URLACTION_CLIENT_CERT_PROMPT || // don't allow invalid certificates
dwAction == URLACTION_AUTOMATIC_ACTIVEX_UI || // do not display the install dialog for ActiveX Controls
dwAction == URLACTION_ALLOW_RESTRICTEDPROTOCOLS || // use same settings for every protocol
dwAction == URLACTION_ALLOW_APEVALUATION || // the phishing filter is not applicable to this application
dwAction == URLACTION_LOWRIGHTS || // turn off Protected Mode
dwAction == URLACTION_ALLOW_ACTIVEX_FILTERING) { // don't allow ActiveX filtering
Expand All @@ -90,14 +90,20 @@ int InternetInterfaces.IInternetSecurityManager.ProcessUrlAction([MarshalAs(Unma
return S_OK;
}

pPolicy = 0x00010000;

if (dwAction == 0x00002007) { // undocumented action: permissions for components with manifests
return S_OK;
}

pPolicy = URLPOLICY_ALLOW;

if ((dwAction >= URLACTION_DOWNLOAD_MIN && dwAction <= URLACTION_DOWNLOAD_MAX) || // allow downloading ActiveX Controls, scripts, etc.
(dwAction >= URLACTION_ACTIVEX_MIN && dwAction <= URLACTION_ACTIVEX_MAX) || // allow ActiveX Controls
(dwAction >= URLACTION_SCRIPT_MIN && dwAction <= URLACTION_SCRIPT_MAX) || // allow scripts
(dwAction >= URLACTION_HTML_MIN && dwAction <= URLACTION_HTML_MAX) || // allow forms, fonts, meta elements, etc.
(dwAction >= URLACTION_JAVA_MIN && dwAction <= URLACTION_JAVA_MAX) || // allow Java applets
dwAction == URLACTION_COOKIES || // allow all cookies, which are not in fact dangerous and are in fact harmless plaintext files that don't have any code in them
dwAction == URLACTION_COOKIES || // allow all cookies
dwAction == URLACTION_COOKIES_SESSION ||
dwAction == URLACTION_COOKIES_THIRD_PARTY ||
dwAction == URLACTION_COOKIES_SESSION_THIRD_PARTY ||
Expand All @@ -108,6 +114,7 @@ int InternetInterfaces.IInternetSecurityManager.ProcessUrlAction([MarshalAs(Unma
dwAction == URLACTION_DOTNET_USERCONTROLS || // allow .NET user controls
dwAction == URLACTION_FEATURE_DATA_BINDING || // allow databinding
dwAction == URLACTION_FEATURE_CROSSDOMAIN_FOCUS_CHANGE || // allow crossdomain
dwAction == URLACTION_ALLOW_RESTRICTEDPROTOCOLS || // allow active content regardless of if the protocol is restricted
dwAction == URLACTION_ALLOW_AUDIO_VIDEO || // allow audio and video always
dwAction == URLACTION_ALLOW_AUDIO_VIDEO_PLUGINS ||
dwAction == URLACTION_ALLOW_CROSSDOMAIN_DROP_WITHIN_WINDOW || // allow crossdomain, again
Expand Down
23 changes: 18 additions & 5 deletions FlashpointSecurePlayer/EnvironmentVariables.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@

namespace FlashpointSecurePlayer {
class EnvironmentVariables : Modifications {
const string COMPATIBILITY_LAYER = "__COMPAT_LAYER";

public EnvironmentVariables(Form Form) : base(Form) { }

new public void Activate(string name) {
public void Activate(string name, string server, string applicationMutexName) {
base.Activate(name);
ModificationsElement modificationsElement = GetModificationsElement(true, Name);
EnvironmentVariablesElement environmentVariablesElement = null;
Expand All @@ -27,15 +29,28 @@ public EnvironmentVariables(Form Form) : base(Form) { }
throw new EnvironmentVariablesFailedException();
}

string compatibilityLayer = null;

try {
Environment.SetEnvironmentVariable(environmentVariablesElement.Name, RemoveVariablesFromValue(environmentVariablesElement.Value) as string);
} catch (ArgumentNullException) {
compatibilityLayer = Environment.GetEnvironmentVariable(COMPATIBILITY_LAYER);
} catch (ArgumentException) {
throw new EnvironmentVariablesFailedException();
} catch (SecurityException) {
throw new TaskRequiresElevationException();
}

try {
Environment.SetEnvironmentVariable(environmentVariablesElement.Name, RemoveVariablesFromValue(environmentVariablesElement.Value) as string);
} catch (ArgumentException) {
throw new EnvironmentVariablesFailedException();
} catch (SecurityException) {
throw new TaskRequiresElevationException();
}

if (environmentVariablesElement.Name == COMPATIBILITY_LAYER && String.IsNullOrEmpty(compatibilityLayer) && !String.IsNullOrEmpty(server)) {
RestartApplication(false, Form, applicationMutexName);
throw new InvalidModificationException();
}
}
}

Expand All @@ -58,8 +73,6 @@ public EnvironmentVariables(Form Form) : base(Form) { }

try {
Environment.SetEnvironmentVariable(environmentVariablesElement.Name, null);
} catch (ArgumentNullException) {
throw new EnvironmentVariablesFailedException();
} catch (ArgumentException) {
throw new EnvironmentVariablesFailedException();
} catch (SecurityException) {
Expand Down
6 changes: 3 additions & 3 deletions FlashpointSecurePlayer/FlashpointSecurePlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public partial class FlashpointSecurePlayer : Form {
private readonly ModeTemplates ModeTemplates;
private readonly EnvironmentVariables EnvironmentVariables;
private readonly DownloadsBefore DownloadsBefore;
private readonly RegistryBackup RegistryBackup;
private readonly RegistryBackups RegistryBackup;
private readonly SingleInstance SingleInstance;
string ModificationsName = ACTIVE_EXE_CONFIGURATION_NAME;
bool RunAsAdministratorModification = false;
Expand All @@ -42,7 +42,7 @@ public FlashpointSecurePlayer() {
ModeTemplates = new ModeTemplates(this);
EnvironmentVariables = new EnvironmentVariables(this);
DownloadsBefore = new DownloadsBefore(this);
RegistryBackup = new RegistryBackup(this);
RegistryBackup = new RegistryBackups(this);
SingleInstance = new SingleInstance(this);
}

Expand Down Expand Up @@ -181,7 +181,7 @@ private async Task ActivateModificationsAsync(string commandLine, ErrorDelegate

if (modificationsElement.EnvironmentVariables.Count > 0) {
try {
EnvironmentVariables.Activate(ModificationsName);
EnvironmentVariables.Activate(ModificationsName, Server, APPLICATION_MUTEX_NAME);
} catch (EnvironmentVariablesFailedException) {
errorDelegate(Properties.Resources.EnvironmentVariablesFailed);
} catch (System.Configuration.ConfigurationErrorsException) {
Expand Down
2 changes: 1 addition & 1 deletion FlashpointSecurePlayer/FlashpointSecurePlayer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
<Compile Include="RunAsAdministrator.cs" />
<Compile Include="SingleInstance.cs" />
<Compile Include="ProcessSync.cs" />
<Compile Include="RegistryBackup.cs" />
<Compile Include="RegistryBackups.cs" />
<Compile Include="Server.cs">
<SubType>Form</SubType>
</Compile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
<flashpointSecurePlayer>
<modifications>
<modification name="activex\abcisland\abcisland.dll">
<environmentVariables>
<environmentVariable name="__COMPAT_LAYER" value="Win2000Sp2" />
</environmentVariables>
<registryBackups binaryType="SCS_32BIT_BINARY">
<registryBackup type="VALUE" keyName="HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\ATLBOXWORDCTL.ATLBOXWORDCTLATTRIB.1"
valueName="" value="AtlBoxWordCtlAttrib Class" valueKind="String" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
<flashpointSecurePlayer>
<modifications>
<modification name="activex\mjolauncher2\mjolauncher.dll">
<environmentVariables>
<environmentVariable name="__COMPAT_LAYER" value="Win2000Sp2" />
</environmentVariables>
<registryBackups binaryType="SCS_32BIT_BINARY">
<registryBackup type="VALUE" keyName="HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\MJOLAUNCHER.MJLAUNCHERCTRL.1"
valueName="" value="MJLauncherCtrl Class" valueKind="String" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
<flashpointSecurePlayer>
<modifications>
<modification name="activex\raptisoftgameloader\rsgameloader.dll">
<environmentVariables>
<environmentVariable name="__COMPAT_LAYER" value="Win2000Sp2" />
</environmentVariables>
<registryBackups binaryType="SCS_32BIT_BINARY">
<registryBackup type="VALUE" keyName="HKEY_LOCAL_MACHINE\SOFTWARE\CLASSES\RSGAMELOADER.RSGAMELOADERCTRL.1"
valueName="" value="CRSGameLoaderCtrl Object" valueKind="String" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<modeTemplates>
<softwareModeTemplate hideWindow="true">
<regexes>
<regex name="(.+)" replace="Java\JDK_1.8.0_181\bin\appletviewer.exe -J-Dhttp.proxyHost=127.0.0.1 -J-Dhttp.proxyPort=8888 -J-Dhttps.proxyHost=127.0.0.1 -J-Dhttps.proxyPort=8888 $1" />
<regex name="^\s*(?:(&quot;[^\\&quot;]*(?:\\&quot;[^\\&quot;]*)*&quot;?)\s*(.*)$)?([^\\&quot;\s]*(?:\\&quot;[^\\&quot;\s]*)*)\s*(.*)$" replace="Java\JDK_1.8.0_181\bin\appletviewer.exe -J-Dhttp.proxyHost=127.0.0.1 -J-Dhttp.proxyPort=22500 -J-Dhttps.proxyHost=127.0.0.1 -J-Dhttps.proxyPort=22500 -J-Dftp.proxyHost=127.0.0.1 -J-Dftp.proxyPort=22500 -J-DsocksProxyHost=127.0.0.1 -J-DsocksProxyPort= -J-Xbootclasspath/a:..\jre\lib\deploy.jar;..\jre\lib\javaws.jar;..\jre\lib\plugin.jar $2$4 $1$3" />
</regexes>
</softwareModeTemplate>
</modeTemplates>
Expand Down
6 changes: 3 additions & 3 deletions FlashpointSecurePlayer/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -546,10 +546,10 @@ public DownloadBeforeElementCollection DownloadsBefore {

public class RegistryBackupElementCollection : ModificationsConfigurationElementCollection {
public class RegistryBackupElement : ConfigurationElement {
[ConfigurationProperty("type", DefaultValue = RegistryBackup.TYPE.KEY, IsRequired = false)]
public RegistryBackup.TYPE Type {
[ConfigurationProperty("type", DefaultValue = global::FlashpointSecurePlayer.RegistryBackups.TYPE.KEY, IsRequired = false)]
public RegistryBackups.TYPE Type {
get {
return (RegistryBackup.TYPE)base["type"];
return (RegistryBackups.TYPE)base["type"];
}

set {
Expand Down
4 changes: 2 additions & 2 deletions FlashpointSecurePlayer/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.1.0")]
[assembly: AssemblyFileVersion("1.0.1.0")]
[assembly: AssemblyVersion("1.0.2.0")]
[assembly: AssemblyFileVersion("1.0.2.0")]
[assembly: NeutralResourcesLanguage("en")]

9 changes: 3 additions & 6 deletions FlashpointSecurePlayer/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Flashpoint Secure Player 1.0.1
# Flashpoint Secure Player 1.0.2
This application attempts to solve common compatibility or portability issues posed by browser plugins on Windows for the purpose of playback in BlueMaxima's Flashpoint.

It is compatible with Windows 7, Windows 8, Windows 8.1 and Windows 10, and requires .NET Framework 4.5. If you are on Windows 8.1 or Windows 10, or if you are on Windows 7/8 and have updates enabled, you already have .NET Framework 4.5. Otherwise, you may [download .NET Framework 4.5.](http://www.microsoft.com/en-us/download/details.aspx?id=30653)
Expand All @@ -9,7 +9,7 @@ It is driven by a model consisting of two concepts: Modes and Modifications. The

Presently, there are three Modes (ActiveX Mode, Server Mode, and Software Mode) and six Modifications (Run As Administrator, Mode Templates, Environment Variables, Downloads Before, Registry Backups, and Single Instance.)

This application has bugs. Help me find them! See the [Known Issues](#known-issues) below, and if you've found a bug that isn't listed, report anything unusual as an issue.
This application has bugs. Help me find them! If you've found a bug, report anything unusual as an issue.

# Modes
The Mode determines what action Flashpoint Secure Player will perform after all of the Modifications are made. For example, the end goal may be to open a browser, or a specific software. The Mode to use is not optional. If it is not set, an error will occur. Modes are exclusive - there may only be one set at a time.
Expand Down Expand Up @@ -154,7 +154,7 @@ With the "Miniclip" Modification Name specified, all URLs passed into Server Mod

The Software Mode Template works identically to the Server Mode Template in that it provides the ability to replace the command line passed in with regexes. The Software Mode Template also has an additional attribute, `hideWindow`, which causes the window of the software to be hidden. This is ideal for hiding console windows for softwares that have them.

For example, a practical use of the Software Mode Template would be to create a `modification` element that always ensures the use of important Java options.
For example, a practical use of the Software Mode Template would be to create a `modification` element that always ensures the use of important Java options. Note that this example is simplified from the real Java configuration file for the purpose of demonstration.

```
<modification name="java">
Expand Down Expand Up @@ -354,9 +354,6 @@ You may notice that because the Flashpoint Secure Player is effectively capable
- Generally speaking, more specific error reporting would be nice.
- Old CPU Simulator integration?

# <a name="known-issues"></a>Known Issues
- The compatibility layers have no effect when using Server Mode.

# Questions And Answers
**Is there is Linux version?**

Expand Down
Loading