View previous topic :: View next topic |
Author |
Message |
CodeReaver Newbie cheater Reputation: 0
Joined: 19 Apr 2005 Posts: 24
|
Posted: Thu Sep 15, 2016 9:22 am Post subject: Problems with lua libraries in VS 2015 |
|
|
I'm writing a plugin using Visual Studio 2015 and since I want to be thorough, I'm supporting the 32 bit version as well as the 64 bit.
Dark Byte told me that current versions of Cheat Engine use lua 5.3 and gave me an example that included lua53-64, but when I tried to use the 32 bit counterpart from CE's GitHub page, Visual Studio tells me I'm compiling with the 64 bit library with my 32 bit project configuration. I might need to double check that's not just a mistake in my pragma comments, although I'm pretty sure I did that already. I think there was also an error that said the library was built with a different version of VS.
As an attempt at solution, I grabbed the latest binaries from lua's official website and made sure it was a version that best matched my VS version. In order to check it really was correct, I tried using the 64 bit library from the lua site, but when I do that, the plugin stops working and I get an access violation as soon as the plugin tries using lua.
Can anyone tell me what I might be doing wrong?
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 465
Joined: 09 May 2003 Posts: 25570 Location: The netherlands
|
|
Back to top |
|
|
CodeReaver Newbie cheater Reputation: 0
Joined: 19 Apr 2005 Posts: 24
|
Posted: Thu Sep 15, 2016 10:24 am Post subject: |
|
|
Are those two separate things to try?
I guess if I paste the dlls into my own project to reference that would make things easier for anyone trying to build from the source code, and then of course there's be no need to paste back to the plugins folder as CE will already have loaded them. I'm trying to avoid absolute paths so people can compile without having to update the references.
The lua project was built with VS 2013, and I definitely saw some error mentioning versions of VS. Maybe I just need to grab that project and upgrade it to VS 2015.
BTW, do my findings in that thread about the linker address map sound correct to you? (The part about the table object not being exposed to Lua.) Would exposing FindNextSymbolFromBase to lua be something you could do in future? I mean as a member of that symbollist class I'd been working with.
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 465
Joined: 09 May 2003 Posts: 25570 Location: The netherlands
|
Posted: Thu Sep 15, 2016 10:59 am Post subject: |
|
|
Just make sure you do not rename the .dll files. The dll's initialize some data like critical sections, and renaming them will cause them to be loaded standalone again.
The same reason why you should not embed the lua code inside your plugin, but use a dynamic link approach
(In worst case scenario, you can always look up the address of the used lua library and use getprocaddress to get the exports...)
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
CodeReaver Newbie cheater Reputation: 0
Joined: 19 Apr 2005 Posts: 24
|
Posted: Sat Sep 17, 2016 5:23 pm Post subject: |
|
|
Thanks DarkByte, that worked great! I don't think I even need to tell VS where the dlls are as long as the import libs are there. It seems to find them without any problem once I copy the plugin to CE's folder. I'm pretty certain these are just linking information now, as they got much smaller once I downloaded the project.
I got myself a GitHub account in the process, which I'd been meaning to do for a while.
I'll host the project there, since I think it would be a useful example to have for VS 2015.
|
|
Back to top |
|
|
|