stubert Posted July 21, 2005 Share Posted July 21, 2005 in the .net environment, how do you include precompiled object files? like in unix we have .o files which can be pre compiled and then included in a makefile but how do you tell a .net soultion to include pre-made .obj files? the reason i ask this is cause i'm working on a meathod to catch wallhackers/aimbotters etc and it requires C++, and to get that to workin the jk3 library you need to precompile the C++ object then include it in the final build the anti cheat thing is also probably a good idea to share around with the modders, as long as the source isn't released publicly becase then it will be subject to hacking Link to comment Share on other sites More sharing options...
stubert Posted July 22, 2005 Author Share Posted July 22, 2005 i can make full C++ calls from jk3 source now \o/ Link to comment Share on other sites More sharing options...
razorace Posted July 22, 2005 Share Posted July 22, 2005 I've been a bit wary about doing C++ calls in the .dll code because you have to have a method that works with your windows compiler and your linux compiler. Let us know if you've come up with a method that works for both. Link to comment Share on other sites More sharing options...
stubert Posted July 22, 2005 Author Share Posted July 22, 2005 i have to bulld a static .lib written in C++ the main header for the lib looks like this #ifndef CPP_H #define CPP_H #ifdef __cplusplus extern "C" { #endif void test_pp(void); #ifdef __cplusplus } #endif #endif this is included in the buld for cgame and the c++ lib in cgame i include this in cg_local.h and it's one of the headers in the lib void test_pp() looks like this in the lib #include <stdio.h> #include <stdlib.h> #include "CPP.h" extern "C" void Com_Printf( const char *msg, ... ); extern "C" void test_pp(void) { Com_Printf("this is a msg from c++!"); } to create a static lib, in .net go to new project -> win32 project then in the wizard that comes up click applications settings and check static .lib then go into proteries of cgame, go to linker->inpuit and add the .lib name to the "additional depenancies" list you will also need to put it in one of the .lib paths that .net looks for in tools->options->projects->VC++ directories (show directories for library files) now you'll be able to add a consolecommand call to test_pp() in cgame and see the message written in the C++ modules this guide also helps to do further stuff http://www.parashift.com/c++-faq-lite/mixing-c-and-cpp.html#faq-32.6 Link to comment Share on other sites More sharing options...
stubert Posted July 22, 2005 Author Share Posted July 22, 2005 btw, bow to me now Link to comment Share on other sites More sharing options...
razorace Posted July 22, 2005 Share Posted July 22, 2005 Neat, has anyone tried with the Linux compiles yet? Link to comment Share on other sites More sharing options...
stubert Posted July 22, 2005 Author Share Posted July 22, 2005 in linux you just make a .o with GCC and then copy it to your build directory and add it to your makefile Link to comment Share on other sites More sharing options...
razorace Posted July 23, 2005 Share Posted July 23, 2005 Well, I mean, has anyone actually tested that one with the linux compiling? I'm concerned that it might be unstable. Link to comment Share on other sites More sharing options...
stubert Posted July 23, 2005 Author Share Posted July 23, 2005 it's all the same machine code in the end Link to comment Share on other sites More sharing options...
razorace Posted July 23, 2005 Share Posted July 23, 2005 In theory, yes, but this isn't something that .dll support of JKA was designed for. There could be stability issues or maybe slowdown. I'm just a bit paranoid about these sort of things. Link to comment Share on other sites More sharing options...
stubert Posted July 24, 2005 Author Share Posted July 24, 2005 it still doesn't matter, the dll is stored as assembler no matter what fear not, all will be well Link to comment Share on other sites More sharing options...
Wudan Posted July 24, 2005 Share Posted July 24, 2005 Shouldn't cause any slow-down at all. Link to comment Share on other sites More sharing options...
ensiform Posted July 24, 2005 Share Posted July 24, 2005 exactly Link to comment Share on other sites More sharing options...
Wudan Posted July 26, 2005 Share Posted July 26, 2005 I am curious though, how much power this gives me - I'm guessing I'd be able to get information about the OpenGL context, and then start pushing polygons to it with this code - isn't that a potential security issue? Link to comment Share on other sites More sharing options...
stubert Posted July 26, 2005 Author Share Posted July 26, 2005 i am setting up a way to use this to query windows for the name of each file in memory and their path then i'm going to find their md5 sums and check that against a list of know wallhacks and such but, we still don't have the names of what void functions are in the .exe but i supposse you could find a way to use regular opengl calls wudan: security issue for who =p Link to comment Share on other sites More sharing options...
CortoCG Posted July 26, 2005 Share Posted July 26, 2005 A national security issue of utmost importance =P. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.