pes-modding / sider7

https://mapote.com/doc/sider/
22 stars 5 forks source link

External binary execution (os.execute) #10

Open mochnaufals opened 1 month ago

mochnaufals commented 1 month ago

Hi, I just want to ask if it is possible to run os.execute command inside the .lua file. My original idea is for extending the capability of Sider by running ffplay.exe, so that it can play custom video without the need of converting video to .usm and reverse engineering the logic by PES. I found the current Intro Server by the community is great, however i see that the limitation is it's only applicable for replacing the current .usm file with other .usm file. So for another purpose, let say that we want to play some video in the middle of the match, it's not yet possible. So I think it's good if we can leverage external program to fill that purpose.

I just tried to use the os.execute command, but i found out that the 'execute' is not recognized, is it because it's purposely disabled for safety reason?

Thank you!

mochnaufals commented 1 month ago

I just read the sider.cpp and found out that the os library has been stripped-down, probably because of safety issue.

image

juce commented 3 weeks ago

you are correct, orginally it was an attempt to sandbox the environment. So that sider cannot do malicious things. That being said, there are other ways to do it (for example using "ffi" library that comes with LuaJIT), so sandboxing isn't really that effective in this case :)

i can add os.execute in the next release.