[ANN] CPB - Quickly access C variables and functions from LUA

Started by
13 comments, last by Toes 19 years, 1 month ago
CPB is a simple, fast, and powerful binding library for LUA. Its goal is to allow seamless access to your C variables and functions from LUA with minimal effort. CPB is integrated in to your program with exactly 1 line of C code. luaopen_CPB(lua_State* L); Add in the CPB library code, recompile and you will then be able to access every C variable and function in your program from your LUA scripts. CPB offers several key features that differ from existing LUA all current binding libraries. * CPB eliminates the need to maintain bindings in your code or in a configuration file. It figures everything out from your exe without requiring any modifications to existing code or creation of definition files. * CPB works at run time on a binary level with your program. It has access to everything in your executable. It doesn’t matter how few or many C variables and functions you want to export. Any additions and changes to your program are automatically handled. * You have full control over what to expose to the script or not. Configure exactly what variables and function to bind from LUA by name with a single function. * CPB is extremely fast and very memory efficient. Bindings are just in time compiled specifically for each function signature and only binding’s that are requested will be created You can get detailed information and a download for the library from here. http://www.thomasandamy.com/projects/CPB Thomas [Edited by - Toes on March 17, 2005 8:24:08 PM]
Advertisement
It looks like a very interesting project, but am I right in saying it only supports MS Visual Studio.NET projects?
It will support any form of windows exe. It's not exclusive to .net.

sounds strange! "works at run time on a binary level with your program", that requires all function and variable names to be stored in the executeable, that is reverse engineers heaven and definately prohibitive for any comercial project that is not open-source anyway!!!
Quote:Original post by Toes
It will support any form of windows exe. It's not exclusive to .net.


Quote:Link in the following MSVC.net Library files



diaguids.lib (Release DIA GUIDS)

diaguidsd.lib (Debug DIA GUIDS)

comsupp.lib



diaguids are library files that are deployed with the DIASDK on MSVC.net. Not everyone installs it so I’ve included them with the CPB source files



Ensure the following DLL is in your runtime directory

msdia71.dll



To run the demo application you may need to first register the msdia71.dll (Microsoft Debug Interface Access). On the command prompt type "regsvr32.exe msdia71.dll" in the runtime directory.



Again this should be deployed with MSVC.net with the DIASDK. Not everyone installs it so I’ve also included it with the distribution.



Under project properties ensure that Linker->Debugging->GenerateDebugInfo is set to Yes (/DEBUG) and the debug info type is Program Database. You will need to enable this for both your debug and release builds. While you compile your program you should see a file called “yourprogramname.pdb” CPD uses this data file to generate binding data for your.


I would say it is rather Visual Studio .NET centric. The .PDB file format is Visual Studio specific and the format changed from 6.0 to .NET.
I found that as well. It cannot be used without VS.NET. It won't even compile as it needs headers that apparently are only available with VS.NET.
A shame because this seems interesting. Are you sure this is the only way to get the debug information required for this to work ? Aren't there any GNU tools that can do this ?
There are GNU tools that do this. No one's stepped up to do a port though. ;) The command line version of the .net compiler is free now days.

A version that allows you to ship it without the PDB file should be done in a few more days. So after building your initial bindings you can export a custom data file that doesn't have your symbol data.

Thomas
Well this is all good, but if it's possible to port that will be best, as many people will want it for MAC and Linux as well, and to avoid the MS compiler. I have the Visual C++ Toolkit 2003 which is what I assume you speak of, but it seems to be missing parts of the "DIA SDK" I would need to test any of this out. So how might we do this with only GNU tools? How much of this may need to be rewritten? Also..is this any faster than using the LUA-C api? (I'd assume it to be)
I've included all the DIA SDK components in the download, you may need to add it to your project. You can always download it separately from MS if you want.

It's just as fast to using LUA-C API directly.
Hello yes that was my point, you really can't download the header files from microsoft. At least I have yet to find it on their site. I think you only get it when you buy MSVC.NET ? Since you distribute the DIA DLL's already would it be ok to add the header files to your project download? And how might we create a .PDB file without a copy of VC.NET ? Sorry for all the questions but I'm only familiar with the GNU tools..

This topic is closed to new replies.

Advertisement