Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Lua with LuaJIT and restrict loaded libraries for auto splitters #34

Merged
merged 8 commits into from
Apr 11, 2024

Conversation

wins1ey
Copy link
Owner

@wins1ey wins1ey commented Mar 22, 2024

Restrict the loaded libraries to only base, string, math and jit. This is based on information from:
http://lua-users.org/wiki/SandBoxes

TODO:

  • Further restrict the use of unsafe functions in the base library (e.g. setmetatable)
  • Test current auto splitters with the changes

@wins1ey wins1ey added enhancement New feature or request. auto splitting This is about the auto splitting implementation. labels Mar 22, 2024
@Loomeh
Copy link
Collaborator

Loomeh commented Mar 26, 2024

Tony Hawk's Underground seemed to not work. It first made me switch out some logic (I had to change the '&' to 'and' on line 18).

The timer started correctly (loading works too) but LAST didn't split (which is weird considering it printed out the debug message for splitting)

Process: THUGONE.exe
PID: 4508
Refresh rate: 120
Started Manhattan; splitting timer...

@wins1ey
Copy link
Owner Author

wins1ey commented Mar 26, 2024

The timer started correctly (loading works too) but LAST didn't split (which is weird considering it printed out the debug message for splitting)

Do you get the same issue with JSR? I quickly tested JSR and it was working as expected.
Perhaps this story_flags[1] = true is causing a problem and breaking the auto splitter?
What happens if you add another print statement after return true

@EXtremeExploit
Copy link
Collaborator

Tony Hawk's Underground seemed to not work. It first made me switch out some logic (I had to change the '&' to 'and' on line 18).
The & on that line is a bitwise operation, an "and" isnt the same logic, it will treat them like booleans

@wins1ey
Copy link
Owner Author

wins1ey commented Mar 27, 2024

The bit library is now available for auto splitters.
Lua BitOp
Lua BitOp API functions
local bit = require("bit") isn't needed because the library is already loaded by LAST.

@EXtremeExploit
Copy link
Collaborator

EXtremeExploit commented Mar 27, 2024

Just to have it in hand

Confirmed to work:

  • AmidEvil.lua
  • JSR.lua
  • MLP_AMBA.lua
  • mec.lua
  • mecadntp.lua
  • thug.lua

@wins1ey
Copy link
Owner Author

wins1ey commented Apr 11, 2024

I think mec.lua and mecadntp.lua should work exactly the same as before since the only breaking change found in the auto splitters was the change in bitwise operations.

I'm happy to merge this if either of you approve.

Copy link
Collaborator

@EXtremeExploit EXtremeExploit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just 1 small rename but other than that i see all is good, the change is fast

src/auto-splitter.c Outdated Show resolved Hide resolved
@wins1ey wins1ey merged commit 37411d8 into main Apr 11, 2024
2 checks passed
@wins1ey wins1ey deleted the luajit branch April 11, 2024 15:12
@Loomeh
Copy link
Collaborator

Loomeh commented Apr 13, 2024

Mirror's Edge Catalyst's auto splitter doesn't work. LAST complains about most of the readAddress variables returning the wrong return type (expected boolean).

Some logic seems to be working. It does print the debug message for loading, but nothing else works.

Also for Tony Hawk's Underground, it only started working after I switched from Wine Staging (8.21) to Proton Hotfix inside Lutris.

@wins1ey
Copy link
Owner Author

wins1ey commented Apr 13, 2024

Does #43 fix them?

Edit: Never mind, it doesn't

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto splitting This is about the auto splitting implementation. enhancement New feature or request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants