diff --git a/.gitignore b/.gitignore index 46e9cdd..65ff50e 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ *.user *.sln.docstates .idea/ +.idea/**/* # Build results @@ -131,4 +132,5 @@ $RECYCLE.BIN/ # Mac desktop service store files .DS_Store -_NCrunch* \ No newline at end of file +_NCrunch* +RobloxLegacy.exe \ No newline at end of file diff --git a/README.md b/README.md index 788f0fa..fd7df50 100644 --- a/README.md +++ b/README.md @@ -4,3 +4,9 @@ This is a C# application which automatically downloads the latest version of Rob ## Notice Currently, the application only allows you to run Roblox Studio. Because of Roblox's anticheat (aka Hyperion), we have not been able to get the client to work as of right now. + +## How to build +- Install Visual Studio 2015 and .NET SDK 8 +- Clone the repository +- Run the build.bat script +The built file will be located in the root of directory diff --git a/RobloxLegacy/AppData/StudioData.cs b/RobloxLegacy/AppData/StudioData.cs index aab88b6..17aaca9 100644 --- a/RobloxLegacy/AppData/StudioData.cs +++ b/RobloxLegacy/AppData/StudioData.cs @@ -16,7 +16,6 @@ public class StudioData : IAppData ["shaders.zip"] = "shaders/", ["ssl.zip"] = "ssl/", - ["Qml.zip"] = "Qml/", ["Plugins.zip"] = "Plugins/", ["StudioFonts.zip"] = "StudioFonts/", ["BuiltInPlugins.zip"] = "BuiltInPlugins/", diff --git a/RobloxLegacy/Installer.cs b/RobloxLegacy/Installer.cs new file mode 100644 index 0000000..e3bdc06 --- /dev/null +++ b/RobloxLegacy/Installer.cs @@ -0,0 +1,43 @@ +using System.Diagnostics; +using RobloxLegacy.Utilities; + +namespace RobloxLegacy; + +public class Installer +{ + private static readonly string InstallPath = Path.Combine( + Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), + "Roblox", "Versions" + ); + + private static void SetShortcuts(string filePath) + { + // create a shortcut on the desktop + Shortcut.Create( + "Launch Roblox", + filePath, + "Updater and patcher for roblox on legacy operating systems", + Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory) + ); + + // create a shortcut in the start menu + var startMenuPath = Path.Combine( + Environment.GetFolderPath(Environment.SpecialFolder.StartMenu), "Programs"); + Shortcut.Create( + "Roblox Legacy", + filePath, + "Updater and patcher for roblox on legacy operating systems", + startMenuPath + ); + } + + public static void DeployBootstrapper() + { + var bootstrapperPath = Process.GetCurrentProcess()?.MainModule?.FileName ?? throw new Exception("Could not find bootstrapper"); + var installPath = Path.Combine(InstallPath, "RobloxLegacy.exe"); + if(bootstrapperPath == installPath) // already installed + return; + File.Copy(bootstrapperPath, installPath, true); + SetShortcuts(installPath); + } +} \ No newline at end of file diff --git a/RobloxLegacy/Program.cs b/RobloxLegacy/Program.cs index d4d49a9..2ab4fd3 100644 --- a/RobloxLegacy/Program.cs +++ b/RobloxLegacy/Program.cs @@ -1,5 +1,9 @@ using RobloxLegacy; using RobloxLegacy.AppData; + +#if RELEASE + Installer.DeployBootstrapper(); +#endif using var manager = new VersionManager(new StudioData()); await manager.InstallPackage(); // update studio if needed diff --git a/RobloxLegacy/RobloxLegacy.csproj b/RobloxLegacy/RobloxLegacy.csproj index 043cdde..18ab570 100644 --- a/RobloxLegacy/RobloxLegacy.csproj +++ b/RobloxLegacy/RobloxLegacy.csproj @@ -5,6 +5,12 @@ net8.0-windows enable enable + RandomServer + icon.ico + + + + embedded @@ -12,4 +18,10 @@ + + + lptch.dll + + + diff --git a/RobloxLegacy/Utilities/BinaryPatcher.cs b/RobloxLegacy/Utilities/BinaryPatcher.cs new file mode 100644 index 0000000..1c36eb3 --- /dev/null +++ b/RobloxLegacy/Utilities/BinaryPatcher.cs @@ -0,0 +1,51 @@ +using System.Text; + +namespace RobloxLegacy.Utilities; + +public static class BinaryPatcher +{ + // this is insanely autistic + // if you have a better way of doing it let me know + public static void RenameImports(string filePath, List oldNames, string newName) + { + var exeBytes = File.ReadAllBytes(filePath); + foreach (var oldName in oldNames) + { + var oldNameBytes = Encoding.ASCII.GetBytes(oldName); + var newNameBytes = Encoding.ASCII.GetBytes(newName); + + var oldNameLength = oldNameBytes.Length; + var newNameLength = newNameBytes.Length; + + if (newNameLength > oldNameLength) + throw new Exception("New name cannot be longer than old name"); + + // scan the binary data for the old name + for (var i = 0; i < exeBytes.Length - oldNameLength; i++) + { + var match = true; + for (var j = 0; j < oldNameLength; j++) + { + if (exeBytes[i + j] != oldNameBytes[j]) + { + match = false; + break; + } + } + + if (match) // if a match is found, replace it + { + Array.Copy(newNameBytes, 0, exeBytes, i, newNameLength); + if (newNameLength < oldNameLength) + { + for (var j = newNameLength; j < oldNameLength; j++) + { + exeBytes[i + j] = 0; // set remaining bytes to 0 + } + } + } + } + } + File.WriteAllBytes(filePath, exeBytes); + } +} \ No newline at end of file diff --git a/RobloxLegacy/Utilities/Resource.cs b/RobloxLegacy/Utilities/Resource.cs new file mode 100644 index 0000000..d1c04c4 --- /dev/null +++ b/RobloxLegacy/Utilities/Resource.cs @@ -0,0 +1,23 @@ +using System.Reflection; + +namespace RobloxLegacy.Utilities; + +public class Resource(string name) +{ + private Stream? GetStream() + { + var assembly = Assembly.GetExecutingAssembly(); + return assembly.GetManifestResourceStream(name); + } + + public byte[]? GetBytes() + { + using var stream = GetStream(); + if (stream == null) + return null; + + using var ms = new MemoryStream(); + stream.CopyTo(ms); + return ms.ToArray(); + } +} \ No newline at end of file diff --git a/RobloxLegacy/Utilities/Shortcut.cs b/RobloxLegacy/Utilities/Shortcut.cs new file mode 100644 index 0000000..b36bbbb --- /dev/null +++ b/RobloxLegacy/Utilities/Shortcut.cs @@ -0,0 +1,50 @@ +using System.Runtime.InteropServices; +using System.Runtime.InteropServices.ComTypes; +using System.Text; + +namespace RobloxLegacy.Utilities; + +// https://stackoverflow.com/a/14632782 +public static class Shortcut +{ + + [ComImport] + [Guid("00021401-0000-0000-C000-000000000046")] + private class ShellLink + { + } + + [ComImport] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + [Guid("000214F9-0000-0000-C000-000000000046")] + private interface IShellLink + { + void GetPath([Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszFile, int cchMaxPath, out IntPtr pfd, int fFlags); + void GetIDList(out IntPtr ppidl); + void SetIDList(IntPtr pidl); + void GetDescription([Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszName, int cchMaxName); + void SetDescription([MarshalAs(UnmanagedType.LPWStr)] string pszName); + void GetWorkingDirectory([Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszDir, int cchMaxPath); + void SetWorkingDirectory([MarshalAs(UnmanagedType.LPWStr)] string pszDir); + void GetArguments([Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszArgs, int cchMaxPath); + void SetArguments([MarshalAs(UnmanagedType.LPWStr)] string pszArgs); + void GetHotkey(out short pwHotkey); + void SetHotkey(short wHotkey); + void GetShowCmd(out int piShowCmd); + void SetShowCmd(int iShowCmd); + void GetIconLocation([Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszIconPath, int cchIconPath, out int piIcon); + void SetIconLocation([MarshalAs(UnmanagedType.LPWStr)] string pszIconPath, int iIcon); + void SetRelativePath([MarshalAs(UnmanagedType.LPWStr)] string pszPathRel, int dwReserved); + void Resolve(IntPtr hwnd, int fFlags); + void SetPath([MarshalAs(UnmanagedType.LPWStr)] string pszFile); + } + + public static void Create(string name, string filePath, string description, string savePath) + { + var link = (IShellLink)new ShellLink(); + link.SetDescription(description); + link.SetPath(filePath); + var file = (IPersistFile)link; + file.Save(Path.Combine(savePath, $"{name}.lnk"), false); + } +} \ No newline at end of file diff --git a/RobloxLegacy/VersionManager.cs b/RobloxLegacy/VersionManager.cs index f11b32a..cd5ed84 100644 --- a/RobloxLegacy/VersionManager.cs +++ b/RobloxLegacy/VersionManager.cs @@ -19,6 +19,7 @@ public class VersionManager : IDisposable { private static readonly HttpClient Client = new(); private const string CdnUrl = "https://setup.rbxcdn.com"; + private const string DllName = "lptch.dll"; private string? _currentVersion; private readonly string _tempPath = Path.Combine(Path.GetTempPath(), $"RobloxLegacy.{Guid.NewGuid().ToString()}"); @@ -53,6 +54,21 @@ public class VersionManager : IDisposable var extractPath = Path.Combine(GetVersionPath(version), folder); fastZip.ExtractZip(tempFile, extractPath, null); } + + private void PatchStudio() + { + Logger.Info("Patching application..."); + var exePath = Path.Combine(GetVersionPath(_currentVersion), _appData.ExecutableName); + + // rename imports first + BinaryPatcher.RenameImports(exePath, ["KERNEL32.dll", "MFPlat.DLL"], DllName); + + // now we can write the dll to the folder + var dllContents = new Resource($"RobloxLegacy.{DllName}").GetBytes(); + if (dllContents == null) + throw new Exception("Failed to get dll resource"); + File.WriteAllBytesAsync(Path.Combine(GetVersionPath(_currentVersion), DllName), dllContents); + } public async Task InstallPackage() { @@ -63,7 +79,7 @@ public class VersionManager : IDisposable if (version.UploadHash == _currentVersion) return; - Logger.Info($"Installing {_appData.PackageName} version {version.Version}"); + Logger.Info($"Installing {_appData.PackageName} version {version.Version}..."); foreach (var file in _appData.PackageFiles) { try @@ -84,6 +100,10 @@ public class VersionManager : IDisposable _currentVersion = version.UploadHash; Registry.SaveVersion(_appData.PackageName, version.UploadHash); + + // need to patch the executable + if (_appData.PackageName == "WindowsStudio64") + PatchStudio(); } public void LaunchApp() diff --git a/RobloxLegacy/icon.ico b/RobloxLegacy/icon.ico new file mode 100644 index 0000000..6ec3042 Binary files /dev/null and b/RobloxLegacy/icon.ico differ diff --git a/RobloxWrapper/.gitignore b/RobloxWrapper/.gitignore new file mode 100644 index 0000000..74bed9d --- /dev/null +++ b/RobloxWrapper/.gitignore @@ -0,0 +1,402 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +# but not Directory.Build.rsp, as it configures directory-level build defaults +!Directory.Build.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.tlog +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio 6 auto-generated project file (contains which files were open etc.) +*.vbp + +# Visual Studio 6 workspace and project file (working project files containing files to include in project) +*.dsw +*.dsp + +# Visual Studio 6 technical files +*.ncb +*.aps + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# Visual Studio History (VSHistory) files +.vshistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd + +# VS Code files for those working on multiple tools +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +*.code-workspace + +# Local History for Visual Studio Code +.history/ + +# Windows Installer files from build outputs +*.cab +*.msi +*.msix +*.msm +*.msp + +# JetBrains Rider +*.sln.iml +build/**/* \ No newline at end of file diff --git a/RobloxWrapper/RobloxWrapper.sln b/RobloxWrapper/RobloxWrapper.sln new file mode 100644 index 0000000..de2d3b5 --- /dev/null +++ b/RobloxWrapper/RobloxWrapper.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.25420.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RobloxWrapper", "RobloxWrapper\RobloxWrapper.vcxproj", "{132718F4-8758-4DC0-B398-616F6081FB1B}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {132718F4-8758-4DC0-B398-616F6081FB1B}.Debug|x64.ActiveCfg = Debug|x64 + {132718F4-8758-4DC0-B398-616F6081FB1B}.Debug|x64.Build.0 = Debug|x64 + {132718F4-8758-4DC0-B398-616F6081FB1B}.Release|x64.ActiveCfg = Release|x64 + {132718F4-8758-4DC0-B398-616F6081FB1B}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/RobloxWrapper/RobloxWrapper/RobloxWrapper.vcxproj b/RobloxWrapper/RobloxWrapper/RobloxWrapper.vcxproj new file mode 100644 index 0000000..7e6e97e --- /dev/null +++ b/RobloxWrapper/RobloxWrapper/RobloxWrapper.vcxproj @@ -0,0 +1,159 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + {132718F4-8758-4DC0-B398-616F6081FB1B} + Win32Proj + RobloxWrapper + 8.1 + + + + DynamicLibrary + true + v140 + Unicode + + + DynamicLibrary + false + v140 + true + Unicode + + + DynamicLibrary + true + v140 + Unicode + + + DynamicLibrary + false + v140 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)\build\ + lptch + + + true + $(SolutionDir)\build\ + lptch + + + false + $(SolutionDir)\build\ + lptch + + + false + $(SolutionDir)\build\ + lptch + + + + NotUsing + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;ROBLOXWRAPPER_EXPORTS;%(PreprocessorDefinitions) + true + + + Windows + true + + + + + NotUsing + Level3 + Disabled + _DEBUG;_WINDOWS;_USRDLL;ROBLOXWRAPPER_EXPORTS;%(PreprocessorDefinitions) + true + + + Windows + true + + + + + Level3 + NotUsing + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;_USRDLL;ROBLOXWRAPPER_EXPORTS;%(PreprocessorDefinitions) + true + + + Windows + true + true + true + + + + + Level3 + NotUsing + MaxSpeed + true + true + NDEBUG;_WINDOWS;_USRDLL;ROBLOXWRAPPER_EXPORTS;%(PreprocessorDefinitions) + true + + + Windows + true + true + true + + + + + + + + + + \ No newline at end of file diff --git a/RobloxWrapper/RobloxWrapper/RobloxWrapper.vcxproj.filters b/RobloxWrapper/RobloxWrapper/RobloxWrapper.vcxproj.filters new file mode 100644 index 0000000..e67cb78 --- /dev/null +++ b/RobloxWrapper/RobloxWrapper/RobloxWrapper.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Source Files + + + Source Files + + + \ No newline at end of file diff --git a/RobloxWrapper/RobloxWrapper/kernel32.cpp b/RobloxWrapper/RobloxWrapper/kernel32.cpp new file mode 100644 index 0000000..a9728f8 --- /dev/null +++ b/RobloxWrapper/RobloxWrapper/kernel32.cpp @@ -0,0 +1,300 @@ +#include + +// this section is for windows 7 +// it will most likely get expanded in the future, but for now its fine + +// PrefetchVirtualMemory +extern "C" __declspec(dllexport) BOOL Ext_PrefetchVirtualMemory( + IN HANDLE hProcess, + IN ULONG_PTR NumberOfEntries, + IN PWIN32_MEMORY_RANGE_ENTRY VirtualAddresses, + IN ULONG Flags +) { + return FALSE; // no op because its such an useless api and nothing depends on it if it doesnt work lol +} +#pragma comment(linker, "/EXPORT:PrefetchVirtualMemory=Ext_PrefetchVirtualMemory") + +// other roblox studio k32 apis +#pragma comment(linker, "/EXPORT:AcquireSRWLockExclusive=kernel32.AcquireSRWLockExclusive") +#pragma comment(linker, "/EXPORT:AcquireSRWLockShared=kernel32.AcquireSRWLockShared") +#pragma comment(linker, "/EXPORT:AddVectoredExceptionHandler=kernel32.AddVectoredExceptionHandler") +#pragma comment(linker, "/EXPORT:AreFileApisANSI=kernel32.AreFileApisANSI") +#pragma comment(linker, "/EXPORT:CancelIo=kernel32.CancelIo") +#pragma comment(linker, "/EXPORT:CancelIoEx=kernel32.CancelIoEx") +#pragma comment(linker, "/EXPORT:CloseHandle=kernel32.CloseHandle") +#pragma comment(linker, "/EXPORT:CompareFileTime=kernel32.CompareFileTime") +#pragma comment(linker, "/EXPORT:CompareStringEx=kernel32.CompareStringEx") +#pragma comment(linker, "/EXPORT:ConvertFiberToThread=kernel32.ConvertFiberToThread") +#pragma comment(linker, "/EXPORT:ConvertThreadToFiberEx=kernel32.ConvertThreadToFiberEx") +#pragma comment(linker, "/EXPORT:CopyFileW=kernel32.CopyFileW") +#pragma comment(linker, "/EXPORT:CreateDirectoryW=kernel32.CreateDirectoryW") +#pragma comment(linker, "/EXPORT:CreateEventA=kernel32.CreateEventA") +#pragma comment(linker, "/EXPORT:CreateEventW=kernel32.CreateEventW") +#pragma comment(linker, "/EXPORT:CreateFiberEx=kernel32.CreateFiberEx") +#pragma comment(linker, "/EXPORT:CreateFileA=kernel32.CreateFileA") +#pragma comment(linker, "/EXPORT:CreateFileMappingW=kernel32.CreateFileMappingW") +#pragma comment(linker, "/EXPORT:CreateFileW=kernel32.CreateFileW") +#pragma comment(linker, "/EXPORT:CreateIoCompletionPort=kernel32.CreateIoCompletionPort") +#pragma comment(linker, "/EXPORT:CreateMutexA=kernel32.CreateMutexA") +#pragma comment(linker, "/EXPORT:CreateMutexExW=kernel32.CreateMutexExW") +#pragma comment(linker, "/EXPORT:CreateMutexW=kernel32.CreateMutexW") +#pragma comment(linker, "/EXPORT:GetPhysicallyInstalledSystemMemory=kernel32.GetPhysicallyInstalledSystemMemory") +#pragma comment(linker, "/EXPORT:CreateNamedPipeW=kernel32.CreateNamedPipeW") +#pragma comment(linker, "/EXPORT:CreateProcessA=kernel32.CreateProcessA") +#pragma comment(linker, "/EXPORT:CreateProcessW=kernel32.CreateProcessW") +#pragma comment(linker, "/EXPORT:CreateSemaphoreA=kernel32.CreateSemaphoreA") +#pragma comment(linker, "/EXPORT:CreateSemaphoreExW=kernel32.CreateSemaphoreExW") +#pragma comment(linker, "/EXPORT:CreateSemaphoreW=kernel32.CreateSemaphoreW") +#pragma comment(linker, "/EXPORT:CreateThread=kernel32.CreateThread") +#pragma comment(linker, "/EXPORT:CreateToolhelp32Snapshot=kernel32.CreateToolhelp32Snapshot") +#pragma comment(linker, "/EXPORT:CreateWaitableTimerA=kernel32.CreateWaitableTimerA") +#pragma comment(linker, "/EXPORT:DebugBreak=kernel32.DebugBreak") +#pragma comment(linker, "/EXPORT:DecodePointer=kernel32.DecodePointer") +#pragma comment(linker, "/EXPORT:DeleteCriticalSection=kernel32.DeleteCriticalSection") +#pragma comment(linker, "/EXPORT:DeleteFiber=kernel32.DeleteFiber") +#pragma comment(linker, "/EXPORT:DeleteFileA=kernel32.DeleteFileA") +#pragma comment(linker, "/EXPORT:DeleteFileW=kernel32.DeleteFileW") +#pragma comment(linker, "/EXPORT:DeviceIoControl=kernel32.DeviceIoControl") +#pragma comment(linker, "/EXPORT:DuplicateHandle=kernel32.DuplicateHandle") +#pragma comment(linker, "/EXPORT:EncodePointer=kernel32.EncodePointer") +#pragma comment(linker, "/EXPORT:EnterCriticalSection=kernel32.EnterCriticalSection") +#pragma comment(linker, "/EXPORT:FileTimeToSystemTime=kernel32.FileTimeToSystemTime") +#pragma comment(linker, "/EXPORT:FindClose=kernel32.FindClose") +#pragma comment(linker, "/EXPORT:FindFirstFileA=kernel32.FindFirstFileA") +#pragma comment(linker, "/EXPORT:FindFirstFileExW=kernel32.FindFirstFileExW") +#pragma comment(linker, "/EXPORT:FindFirstFileW=kernel32.FindFirstFileW") +#pragma comment(linker, "/EXPORT:FindNLSStringEx=kernel32.FindNLSStringEx") +#pragma comment(linker, "/EXPORT:FindNextFileA=kernel32.FindNextFileA") +#pragma comment(linker, "/EXPORT:FindNextFileW=kernel32.FindNextFileW") +#pragma comment(linker, "/EXPORT:FindResourceExW=kernel32.FindResourceExW") +#pragma comment(linker, "/EXPORT:FindResourceW=kernel32.FindResourceW") +#pragma comment(linker, "/EXPORT:FlushFileBuffers=kernel32.FlushFileBuffers") +#pragma comment(linker, "/EXPORT:FlushInstructionCache=kernel32.FlushInstructionCache") +#pragma comment(linker, "/EXPORT:FlushViewOfFile=kernel32.FlushViewOfFile") +#pragma comment(linker, "/EXPORT:FormatMessageA=kernel32.FormatMessageA") +#pragma comment(linker, "/EXPORT:FormatMessageW=kernel32.FormatMessageW") +#pragma comment(linker, "/EXPORT:FreeEnvironmentStringsW=kernel32.FreeEnvironmentStringsW") +#pragma comment(linker, "/EXPORT:FreeLibrary=kernel32.FreeLibrary") +#pragma comment(linker, "/EXPORT:GetACP=kernel32.GetACP") +#pragma comment(linker, "/EXPORT:GetCommandLineW=kernel32.GetCommandLineW") +#pragma comment(linker, "/EXPORT:GetConsoleMode=kernel32.GetConsoleMode") +#pragma comment(linker, "/EXPORT:GetCurrentDirectoryW=kernel32.GetCurrentDirectoryW") +#pragma comment(linker, "/EXPORT:GetCurrentProcess=kernel32.GetCurrentProcess") +#pragma comment(linker, "/EXPORT:GetCurrentProcessId=kernel32.GetCurrentProcessId") +#pragma comment(linker, "/EXPORT:GetCurrentProcessorNumber=kernel32.GetCurrentProcessorNumber") +#pragma comment(linker, "/EXPORT:GetCurrentThread=kernel32.GetCurrentThread") +#pragma comment(linker, "/EXPORT:GetCurrentThreadId=kernel32.GetCurrentThreadId") +#pragma comment(linker, "/EXPORT:GetDiskFreeSpaceA=kernel32.GetDiskFreeSpaceA") +#pragma comment(linker, "/EXPORT:GetDiskFreeSpaceExA=kernel32.GetDiskFreeSpaceExA") +#pragma comment(linker, "/EXPORT:GetDiskFreeSpaceExW=kernel32.GetDiskFreeSpaceExW") +#pragma comment(linker, "/EXPORT:GetDiskFreeSpaceW=kernel32.GetDiskFreeSpaceW") +#pragma comment(linker, "/EXPORT:GetEnvironmentStringsW=kernel32.GetEnvironmentStringsW") +#pragma comment(linker, "/EXPORT:GetEnvironmentVariableA=kernel32.GetEnvironmentVariableA") +#pragma comment(linker, "/EXPORT:GetEnvironmentVariableW=kernel32.GetEnvironmentVariableW") +#pragma comment(linker, "/EXPORT:GetExitCodeProcess=kernel32.GetExitCodeProcess") +#pragma comment(linker, "/EXPORT:GetExitCodeThread=kernel32.GetExitCodeThread") +#pragma comment(linker, "/EXPORT:GetFileAttributesA=kernel32.GetFileAttributesA") +#pragma comment(linker, "/EXPORT:GetFileAttributesExW=kernel32.GetFileAttributesExW") +#pragma comment(linker, "/EXPORT:GetFileAttributesW=kernel32.GetFileAttributesW") +#pragma comment(linker, "/EXPORT:GetFileInformationByHandleEx=kernel32.GetFileInformationByHandleEx") +#pragma comment(linker, "/EXPORT:GetFileSize=kernel32.GetFileSize") +#pragma comment(linker, "/EXPORT:GetFileSizeEx=kernel32.GetFileSizeEx") +#pragma comment(linker, "/EXPORT:GetFileTime=kernel32.GetFileTime") +#pragma comment(linker, "/EXPORT:GetFileType=kernel32.GetFileType") +#pragma comment(linker, "/EXPORT:GetFinalPathNameByHandleW=kernel32.GetFinalPathNameByHandleW") +#pragma comment(linker, "/EXPORT:GetFullPathNameA=kernel32.GetFullPathNameA") +#pragma comment(linker, "/EXPORT:GetFullPathNameW=kernel32.GetFullPathNameW") +#pragma comment(linker, "/EXPORT:GetLastError=kernel32.GetLastError") +#pragma comment(linker, "/EXPORT:GetLocalTime=kernel32.GetLocalTime") +#pragma comment(linker, "/EXPORT:GetModuleFileNameA=kernel32.GetModuleFileNameA") +#pragma comment(linker, "/EXPORT:GetModuleFileNameW=kernel32.GetModuleFileNameW") +#pragma comment(linker, "/EXPORT:GetModuleHandleA=kernel32.GetModuleHandleA") +#pragma comment(linker, "/EXPORT:GetModuleHandleExW=kernel32.GetModuleHandleExW") +#pragma comment(linker, "/EXPORT:GetModuleHandleW=kernel32.GetModuleHandleW") +#pragma comment(linker, "/EXPORT:GetNativeSystemInfo=kernel32.GetNativeSystemInfo") +#pragma comment(linker, "/EXPORT:GetOverlappedResult=kernel32.GetOverlappedResult") +#pragma comment(linker, "/EXPORT:GetProcAddress=kernel32.GetProcAddress") +#pragma comment(linker, "/EXPORT:GetProcessAffinityMask=kernel32.GetProcessAffinityMask") +#pragma comment(linker, "/EXPORT:GetProcessHandleCount=kernel32.GetProcessHandleCount") +#pragma comment(linker, "/EXPORT:GetProcessHeap=kernel32.GetProcessHeap") +#pragma comment(linker, "/EXPORT:GetProcessTimes=kernel32.GetProcessTimes") +#pragma comment(linker, "/EXPORT:GetQueuedCompletionStatus=kernel32.GetQueuedCompletionStatus") +#pragma comment(linker, "/EXPORT:GetStartupInfoW=kernel32.GetStartupInfoW") +#pragma comment(linker, "/EXPORT:GetStdHandle=kernel32.GetStdHandle") +#pragma comment(linker, "/EXPORT:GetStringTypeExW=kernel32.GetStringTypeExW") +#pragma comment(linker, "/EXPORT:GetSystemDirectoryA=kernel32.GetSystemDirectoryA") +#pragma comment(linker, "/EXPORT:GetSystemInfo=kernel32.GetSystemInfo") +#pragma comment(linker, "/EXPORT:GetSystemPowerStatus=kernel32.GetSystemPowerStatus") +#pragma comment(linker, "/EXPORT:GetSystemTime=kernel32.GetSystemTime") +#pragma comment(linker, "/EXPORT:GetSystemTimeAsFileTime=kernel32.GetSystemTimeAsFileTime") +#pragma comment(linker, "/EXPORT:GetTempPathA=kernel32.GetTempPathA") +#pragma comment(linker, "/EXPORT:GetTempPathW=kernel32.GetTempPathW") +#pragma comment(linker, "/EXPORT:GetThreadId=kernel32.GetThreadId") +#pragma comment(linker, "/EXPORT:GetTickCount=kernel32.GetTickCount") +#pragma comment(linker, "/EXPORT:GetVersion=kernel32.GetVersion") +#pragma comment(linker, "/EXPORT:GetVersionExA=kernel32.GetVersionExA") +#pragma comment(linker, "/EXPORT:GetVolumeNameForVolumeMountPointW=kernel32.GetVolumeNameForVolumeMountPointW") +#pragma comment(linker, "/EXPORT:GetVolumePathNameW=kernel32.GetVolumePathNameW") +#pragma comment(linker, "/EXPORT:GlobalAlloc=kernel32.GlobalAlloc") +#pragma comment(linker, "/EXPORT:GlobalFree=kernel32.GlobalFree") +#pragma comment(linker, "/EXPORT:GlobalLock=kernel32.GlobalLock") +#pragma comment(linker, "/EXPORT:GlobalMemoryStatusEx=kernel32.GlobalMemoryStatusEx") +#pragma comment(linker, "/EXPORT:GlobalUnlock=kernel32.GlobalUnlock") +#pragma comment(linker, "/EXPORT:HeapAlloc=kernel32.HeapAlloc") +#pragma comment(linker, "/EXPORT:HeapCompact=kernel32.HeapCompact") +#pragma comment(linker, "/EXPORT:HeapCreate=kernel32.HeapCreate") +#pragma comment(linker, "/EXPORT:HeapDestroy=kernel32.HeapDestroy") +#pragma comment(linker, "/EXPORT:HeapFree=kernel32.HeapFree") +#pragma comment(linker, "/EXPORT:HeapReAlloc=kernel32.HeapReAlloc") +#pragma comment(linker, "/EXPORT:HeapSize=kernel32.HeapSize") +#pragma comment(linker, "/EXPORT:HeapValidate=kernel32.HeapValidate") +#pragma comment(linker, "/EXPORT:InitOnceBeginInitialize=kernel32.InitOnceBeginInitialize") +#pragma comment(linker, "/EXPORT:InitOnceComplete=kernel32.InitOnceComplete") +#pragma comment(linker, "/EXPORT:InitializeConditionVariable=kernel32.InitializeConditionVariable") +#pragma comment(linker, "/EXPORT:InitializeCriticalSection=kernel32.InitializeCriticalSection") +#pragma comment(linker, "/EXPORT:InitializeCriticalSectionAndSpinCount=kernel32.InitializeCriticalSectionAndSpinCount") +#pragma comment(linker, "/EXPORT:InitializeCriticalSectionEx=kernel32.InitializeCriticalSectionEx") +#pragma comment(linker, "/EXPORT:InitializeSListHead=kernel32.InitializeSListHead") +#pragma comment(linker, "/EXPORT:InitializeSRWLock=kernel32.InitializeSRWLock") +#pragma comment(linker, "/EXPORT:InterlockedPopEntrySList=kernel32.InterlockedPopEntrySList") +#pragma comment(linker, "/EXPORT:InterlockedPushEntrySList=kernel32.InterlockedPushEntrySList") +#pragma comment(linker, "/EXPORT:IsDebuggerPresent=kernel32.IsDebuggerPresent") +#pragma comment(linker, "/EXPORT:IsProcessorFeaturePresent=kernel32.IsProcessorFeaturePresent") +#pragma comment(linker, "/EXPORT:K32GetModuleFileNameExW=kernel32.K32GetModuleFileNameExW") +#pragma comment(linker, "/EXPORT:K32GetProcessImageFileNameA=kernel32.K32GetProcessImageFileNameA") +#pragma comment(linker, "/EXPORT:K32GetProcessMemoryInfo=kernel32.K32GetProcessMemoryInfo") +#pragma comment(linker, "/EXPORT:LCMapStringW=kernel32.LCMapStringW") +#pragma comment(linker, "/EXPORT:LeaveCriticalSection=kernel32.LeaveCriticalSection") +#pragma comment(linker, "/EXPORT:LoadLibraryA=kernel32.LoadLibraryA") +#pragma comment(linker, "/EXPORT:LoadLibraryExA=kernel32.LoadLibraryExA") +#pragma comment(linker, "/EXPORT:LoadLibraryExW=kernel32.LoadLibraryExW") +#pragma comment(linker, "/EXPORT:LoadLibraryW=kernel32.LoadLibraryW") +#pragma comment(linker, "/EXPORT:LoadResource=kernel32.LoadResource") +#pragma comment(linker, "/EXPORT:LocalAlloc=kernel32.LocalAlloc") +#pragma comment(linker, "/EXPORT:LocalFree=kernel32.LocalFree") +#pragma comment(linker, "/EXPORT:LockFile=kernel32.LockFile") +#pragma comment(linker, "/EXPORT:LockFileEx=kernel32.LockFileEx") +#pragma comment(linker, "/EXPORT:LockResource=kernel32.LockResource") +#pragma comment(linker, "/EXPORT:MapViewOfFile=kernel32.MapViewOfFile") +#pragma comment(linker, "/EXPORT:MoveFileExA=kernel32.MoveFileExA") +#pragma comment(linker, "/EXPORT:MoveFileExW=kernel32.MoveFileExW") +#pragma comment(linker, "/EXPORT:MultiByteToWideChar=kernel32.MultiByteToWideChar") +#pragma comment(linker, "/EXPORT:OpenEventA=kernel32.OpenEventA") +#pragma comment(linker, "/EXPORT:OpenProcess=kernel32.OpenProcess") +#pragma comment(linker, "/EXPORT:OpenSemaphoreW=kernel32.OpenSemaphoreW") +#pragma comment(linker, "/EXPORT:OpenThread=kernel32.OpenThread") +#pragma comment(linker, "/EXPORT:OutputDebugStringA=kernel32.OutputDebugStringA") +#pragma comment(linker, "/EXPORT:OutputDebugStringW=kernel32.OutputDebugStringW") +#pragma comment(linker, "/EXPORT:PostQueuedCompletionStatus=kernel32.PostQueuedCompletionStatus") +#pragma comment(linker, "/EXPORT:Process32First=kernel32.Process32First") +#pragma comment(linker, "/EXPORT:Process32Next=kernel32.Process32Next") +#pragma comment(linker, "/EXPORT:QueryPerformanceCounter=kernel32.QueryPerformanceCounter") +#pragma comment(linker, "/EXPORT:QueryPerformanceFrequency=kernel32.QueryPerformanceFrequency") +#pragma comment(linker, "/EXPORT:QueueUserAPC=kernel32.QueueUserAPC") +#pragma comment(linker, "/EXPORT:RaiseException=kernel32.RaiseException") +#pragma comment(linker, "/EXPORT:ReadConsoleA=kernel32.ReadConsoleA") +#pragma comment(linker, "/EXPORT:ReadConsoleW=kernel32.ReadConsoleW") +#pragma comment(linker, "/EXPORT:ReadDirectoryChangesW=kernel32.ReadDirectoryChangesW") +#pragma comment(linker, "/EXPORT:ReadFile=kernel32.ReadFile") +#pragma comment(linker, "/EXPORT:ReleaseMutex=kernel32.ReleaseMutex") +#pragma comment(linker, "/EXPORT:ReleaseSRWLockExclusive=kernel32.ReleaseSRWLockExclusive") +#pragma comment(linker, "/EXPORT:ReleaseSRWLockShared=kernel32.ReleaseSRWLockShared") +#pragma comment(linker, "/EXPORT:ReleaseSemaphore=kernel32.ReleaseSemaphore") +#pragma comment(linker, "/EXPORT:RemoveDirectoryW=kernel32.RemoveDirectoryW") +#pragma comment(linker, "/EXPORT:RemoveVectoredExceptionHandler=kernel32.RemoveVectoredExceptionHandler") +#pragma comment(linker, "/EXPORT:ResetEvent=kernel32.ResetEvent") +#pragma comment(linker, "/EXPORT:ResumeThread=kernel32.ResumeThread") +#pragma comment(linker, "/EXPORT:RtlAddFunctionTable=kernel32.RtlAddFunctionTable") +#pragma comment(linker, "/EXPORT:RtlCaptureContext=kernel32.RtlCaptureContext") +#pragma comment(linker, "/EXPORT:RtlCaptureStackBackTrace=kernel32.RtlCaptureStackBackTrace") +#pragma comment(linker, "/EXPORT:RtlDeleteFunctionTable=kernel32.RtlDeleteFunctionTable") +#pragma comment(linker, "/EXPORT:RtlLookupFunctionEntry=kernel32.RtlLookupFunctionEntry") +#pragma comment(linker, "/EXPORT:RtlVirtualUnwind=kernel32.RtlVirtualUnwind") +#pragma comment(linker, "/EXPORT:SetConsoleMode=kernel32.SetConsoleMode") +#pragma comment(linker, "/EXPORT:SetEndOfFile=kernel32.SetEndOfFile") +#pragma comment(linker, "/EXPORT:SetEnvironmentVariableA=kernel32.SetEnvironmentVariableA") +#pragma comment(linker, "/EXPORT:SetErrorMode=kernel32.SetErrorMode") +#pragma comment(linker, "/EXPORT:SetEvent=kernel32.SetEvent") +#pragma comment(linker, "/EXPORT:SetFileAttributesW=kernel32.SetFileAttributesW") +#pragma comment(linker, "/EXPORT:SetFilePointer=kernel32.SetFilePointer") +#pragma comment(linker, "/EXPORT:SetFilePointerEx=kernel32.SetFilePointerEx") +#pragma comment(linker, "/EXPORT:SetFileTime=kernel32.SetFileTime") +#pragma comment(linker, "/EXPORT:SetLastError=kernel32.SetLastError") +#pragma comment(linker, "/EXPORT:SetNamedPipeHandleState=kernel32.SetNamedPipeHandleState") +#pragma comment(linker, "/EXPORT:SetSearchPathMode=kernel32.SetSearchPathMode") +#pragma comment(linker, "/EXPORT:SetThreadAffinityMask=kernel32.SetThreadAffinityMask") +#pragma comment(linker, "/EXPORT:SetThreadPriority=kernel32.SetThreadPriority") +#pragma comment(linker, "/EXPORT:SetUnhandledExceptionFilter=kernel32.SetUnhandledExceptionFilter") +#pragma comment(linker, "/EXPORT:SetWaitableTimer=kernel32.SetWaitableTimer") +#pragma comment(linker, "/EXPORT:SizeofResource=kernel32.SizeofResource") +#pragma comment(linker, "/EXPORT:Sleep=kernel32.Sleep") +#pragma comment(linker, "/EXPORT:SleepConditionVariableCS=kernel32.SleepConditionVariableCS") +#pragma comment(linker, "/EXPORT:SleepEx=kernel32.SleepEx") +#pragma comment(linker, "/EXPORT:SwitchToFiber=kernel32.SwitchToFiber") +#pragma comment(linker, "/EXPORT:SystemTimeToFileTime=kernel32.SystemTimeToFileTime") +#pragma comment(linker, "/EXPORT:TerminateProcess=kernel32.TerminateProcess") +#pragma comment(linker, "/EXPORT:TerminateThread=kernel32.TerminateThread") +#pragma comment(linker, "/EXPORT:TlsAlloc=kernel32.TlsAlloc") +#pragma comment(linker, "/EXPORT:TlsFree=kernel32.TlsFree") +#pragma comment(linker, "/EXPORT:TlsGetValue=kernel32.TlsGetValue") +#pragma comment(linker, "/EXPORT:TlsSetValue=kernel32.TlsSetValue") +#pragma comment(linker, "/EXPORT:TransactNamedPipe=kernel32.TransactNamedPipe") +#pragma comment(linker, "/EXPORT:TryEnterCriticalSection=kernel32.TryEnterCriticalSection") +#pragma comment(linker, "/EXPORT:UnhandledExceptionFilter=kernel32.UnhandledExceptionFilter") +#pragma comment(linker, "/EXPORT:UnlockFile=kernel32.UnlockFile") +#pragma comment(linker, "/EXPORT:UnlockFileEx=kernel32.UnlockFileEx") +#pragma comment(linker, "/EXPORT:UnmapViewOfFile=kernel32.UnmapViewOfFile") +#pragma comment(linker, "/EXPORT:VerSetConditionMask=kernel32.VerSetConditionMask") +#pragma comment(linker, "/EXPORT:VerifyVersionInfoA=kernel32.VerifyVersionInfoA") + + + +// this api is evil so we have to change how it works +// why is it evil you may ask + +// +//bool sub_145255E30() +//{ +// ULONGLONG v0; // rax +// ULONGLONG v1; // rax +// DWORDLONG v2; // rax +// struct _OSVERSIONINFOEXW VersionInformation; // [rsp+20h] [rbp-128h] BYREF +// +// VersionInformation.dwOSVersionInfoSize = 284; +// memset(&VersionInformation.dwBuildNumber, 0, 264); +// VersionInformation.wServicePackMinor = 0; +// *(_DWORD*)&VersionInformation.wSuiteMask = 0; +// v0 = VerSetConditionMask(0, 2u, 3u); +// v1 = VerSetConditionMask(v0, 1u, 3u); +// v2 = VerSetConditionMask(v1, 0x20u, 3u); +// *(_QWORD*)&VersionInformation.dwMajorVersion = 10; +// VersionInformation.wServicePackMajor = 0; +// return VerifyVersionInfoW(&VersionInformation, 0x23u, v2); +// + +extern "C" __declspec(dllexport) BOOL Ext_VerifyVersionInfoW( + IN LPOSVERSIONINFOEXW lpVersionInformation, + IN DWORD dwTypeMask, + IN DWORDLONG dwlConditionMask +) { + return TRUE; +} + + +#pragma comment(linker, "/EXPORT:VerifyVersionInfoW=Ext_VerifyVersionInfoW") +#pragma comment(linker, "/EXPORT:VirtualAlloc=kernel32.VirtualAlloc") +#pragma comment(linker, "/EXPORT:VirtualFree=kernel32.VirtualFree") +#pragma comment(linker, "/EXPORT:VirtualProtect=kernel32.VirtualProtect") +#pragma comment(linker, "/EXPORT:VirtualQuery=kernel32.VirtualQuery") +#pragma comment(linker, "/EXPORT:WaitForMultipleObjects=kernel32.WaitForMultipleObjects") +#pragma comment(linker, "/EXPORT:WaitForMultipleObjectsEx=kernel32.WaitForMultipleObjectsEx") +#pragma comment(linker, "/EXPORT:WaitForSingleObject=kernel32.WaitForSingleObject") +#pragma comment(linker, "/EXPORT:WaitForSingleObjectEx=kernel32.WaitForSingleObjectEx") +#pragma comment(linker, "/EXPORT:WaitNamedPipeW=kernel32.WaitNamedPipeW") +#pragma comment(linker, "/EXPORT:WakeAllConditionVariable=kernel32.WakeAllConditionVariable") +#pragma comment(linker, "/EXPORT:WakeConditionVariable=kernel32.WakeConditionVariable") +#pragma comment(linker, "/EXPORT:WideCharToMultiByte=kernel32.WideCharToMultiByte") +#pragma comment(linker, "/EXPORT:WriteFile=kernel32.WriteFile") +#pragma comment(linker, "/EXPORT:lstrcpyW=kernel32.lstrcpyW") +#pragma comment(linker, "/EXPORT:lstrcpynW=kernel32.lstrcpynW") +#pragma comment(linker, "/EXPORT:lstrlenW=kernel32.lstrlenW") diff --git a/RobloxWrapper/RobloxWrapper/mfplat.cpp b/RobloxWrapper/RobloxWrapper/mfplat.cpp new file mode 100644 index 0000000..550cf55 --- /dev/null +++ b/RobloxWrapper/RobloxWrapper/mfplat.cpp @@ -0,0 +1,29 @@ +#include +#include +#include + +extern "C" __declspec(dllexport) HRESULT Ext_MFCreateDXGIDeviceManager( + OUT UINT* resetToken, + OUT IMFDXGIDeviceManager** ppDeviceManager +) { + return S_OK; +} + +extern "C" __declspec(dllexport) HRESULT Ext_MFCreateDXGISurfaceBuffer( + IN REFIID riid, + IN IUnknown * punkSurface, + IN UINT uSubresourceIndex, + IN BOOL fBottomUpWhenLinear, + OUT IMFMediaBuffer * *ppBuffer +) { + return S_OK; +} + +#pragma comment(linker, "/EXPORT:MFCreateAlignedMemoryBuffer=mfplat.MFCreateAlignedMemoryBuffer") +#pragma comment(linker, "/EXPORT:MFCreateDXGIDeviceManager=Ext_MFCreateDXGIDeviceManager") +#pragma comment(linker, "/EXPORT:MFCreateDXGISurfaceBuffer=Ext_MFCreateDXGISurfaceBuffer") +#pragma comment(linker, "/EXPORT:MFCreateMediaType=mfplat.MFCreateMediaType") +#pragma comment(linker, "/EXPORT:MFCreateMemoryBuffer=mfplat.MFCreateMemoryBuffer") +#pragma comment(linker, "/EXPORT:MFCreateSample=mfplat.MFCreateSample") +#pragma comment(linker, "/EXPORT:MFStartup=mfplat.MFStartup") +#pragma comment(linker, "/EXPORT:MFTEnumEx=mfplat.MFTEnumEx") \ No newline at end of file diff --git a/build.bat b/build.bat new file mode 100644 index 0000000..ca91c8d --- /dev/null +++ b/build.bat @@ -0,0 +1,7 @@ +@echo off +set DOTNET_EnableWriteXorExecute=0 +call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" +msbuild RobloxWrapper\RobloxWrapper.sln /p:Configuration=Release +dotnet publish --configuration Release -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -p:CopyOutputSymbolsToPublishDirectory=false --self-contained +copy .\RobloxLegacy\bin\Release\net8.0-windows\win-x64\publish\RobloxLegacy.exe .\ +pause \ No newline at end of file