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
6 changes: 3 additions & 3 deletions ModAPI Installers/GameVersion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace ModAPI_Installers
public enum GameVersionType
{
/// <summary>3.0.0.2818 (July 2009) installed from disc, with patch 5.1</summary>
Disc,
Disk,
/// <summary>3.0.0.2818 (July 2009) installed from Origin, with patch 5.1, requires ModAPI Fix</summary>
Origin,
/// <summary>3.1.0.22 (March 2017) installed from Origin, requires ModAPI Fix</summary>
Expand All @@ -33,7 +33,7 @@ public static class GameVersion


public static int[] ExecutableSizes = {
/* DISC*/ 24909584,
/* DISK*/ 24909584,
/* ORIGIN */ 31347984,
/* ORIGIN_P */ 24898224,
/* EA_OCT24 */ 24906040,
Expand Down Expand Up @@ -95,7 +95,7 @@ public static GameVersionType DetectVersion(string path)

public static string GetNewDLLName(GameVersionType type)
{
if (type == GameVersionType.Disc)
if (type == GameVersionType.Disk)
return "SporeModAPI.disk.dll";
else if ((type == GameVersionType.Origin) ||
(type == GameVersionType.Origin_Patched) ||
Expand Down
96 changes: 40 additions & 56 deletions Spore ModAPI Launcher/GameVersionSelector.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions Spore ModAPI Launcher/GameVersionSelector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,15 @@ public GameVersionSelector()
InitializeComponent();
}

private void btnDisc_Click(object sender, EventArgs e)
private void btnDisk_Click(object sender, EventArgs e)
{
SelectedVersion = GameVersionType.Disc;
SelectedVersion = GameVersionType.Disk;
this.Close();
}

private void btnOrigin_Click(object sender, EventArgs e)
{
SelectedVersion = GameVersionType.Origin;
this.Close();
}

Expand All @@ -36,11 +42,5 @@ private void btnSteam_Click(object sender, EventArgs e)

this.Close();
}

private void btnEAApp_Click(object sender, EventArgs e)
{
SelectedVersion = GameVersionType.Origin;
this.Close();
}
}
}
6 changes: 3 additions & 3 deletions Spore ModAPI Launcher/Injector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public static IntPtr InjectDLL(PROCESS_INFORMATION pi, string dllPath)
return new IntPtr((Int64)thread_result);
}

public static void SetInjectionData(PROCESS_INFORMATION pi, IntPtr hDLLInjectorHandle, bool is_disc_spore, List<string> dlls)
public static void SetInjectionData(PROCESS_INFORMATION pi, IntPtr hDLLInjectorHandle, bool is_disk_spore, List<string> dlls)
{
IntPtr hLocalDLLInjectorHandle = NativeMethods.LoadLibraryEx("ModAPI.DLLInjector.dll", IntPtr.Zero, LoadLibraryFlags.DONT_RESOLVE_DLL_REFERENCES);
IntPtr SetInjectDataPtr = GetProcAddress(hLocalDLLInjectorHandle, "SetInjectionData");
Expand All @@ -134,7 +134,7 @@ public static void SetInjectionData(PROCESS_INFORMATION pi, IntPtr hDLLInjectorH

IntPtr hProc = NativeMethods.OpenProcess(NativeMethods.AccessRequired, false, pi.dwProcessId); //Open the process with all access

int total_alloc_size = 1 + 4; //1 byte for if we are disc spore, 4 bytes for number of strings
int total_alloc_size = 1 + 4; //1 byte for if we are disk spore, 4 bytes for number of strings
foreach (string dll in dlls)
{
total_alloc_size += 4 + Encoding.Unicode.GetByteCount(dll); //4 bytes for string length + string
Expand All @@ -151,7 +151,7 @@ public static void SetInjectionData(PROCESS_INFORMATION pi, IntPtr hDLLInjectorH
//write injection data
var bytes = new byte[total_alloc_size];
int byte_offset = 0;
bytes[byte_offset++] = (byte)(is_disc_spore ? 1 : 0);
bytes[byte_offset++] = (byte)(is_disk_spore ? 1 : 0);
foreach (byte b in BitConverter.GetBytes((uint)dlls.Count))
bytes[byte_offset++] = b;

Expand Down
12 changes: 6 additions & 6 deletions Spore ModAPI Launcher/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions Spore ModAPI Launcher/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,16 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="VersionButton_Disc_Icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\VersionButton_Disc_Icon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="VersionButton_Origin1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\VersionButton_Origin.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="VersionButton_Steam_GOG_Icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\VersionButton_Steam_GOG_Icon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="VersionButton_Steam_GoG1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\VersionButton_Steam_GoG.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="VersionButton_Disk3" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\VersionButton_Disk.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Spore_ModAPI_Launcher" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Spore ModAPI Launcher.manifest;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="VersionButton_EAApp_Icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\VersionButton_EAApp_Icon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>
3 changes: 0 additions & 3 deletions Spore ModAPI Launcher/Spore ModAPI Launcher.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,6 @@
</ItemGroup>
<ItemGroup>
<Content Include="lH5AxkU.ico" />
<None Include="Resources\VersionButton_EAApp_Icon.png" />
<None Include="Resources\VersionButton_Steam_GoG_Icon.png" />
<None Include="Resources\VersionButton_Disc_Icon.png" />
<None Include="app.config" />
<None Include="packages.config" />
<None Include="Resources\VersionButton_Disk.png" />
Expand Down