19.08.2010, 03:04
Quote:
Some of the code in there looks a lot like the code from YSF - given the number of times you mentioned it I assume you know about it. Anyway, my point is that YSF has both Windows and Linux code and can call into the server properly (although the addresses need updating).
I have also removed a large amount of inline ASM and replaced it with standard C as they removed inline assembly in the 64bit version of the Visual Studio compiler. For some bizzare reason my server is not responding at the moment, but when it's back I suggest you have a look at how I do it. For example the C++ code to call a random address as an object method is something like: Код:
*((CClass *)RANDOM_VARIABLE).(*METHOD_ADDRESS)(parameters); Edit: I found the information: http://mdzahidh.wordpress.com/2008/0...thod-pointers/ The way I did it, as you don't really have the class data, is to define a fake class like so: Код:
class CFake { } typedef int (CFake::*ZeroParMethod_t)(); // Actually - casting to a method pointer is not quite this easy. ZeroParMethod_t OnGameModeInit = (ZeroParMethod_t)0x0045E360; CFake * pGameMode = *(CFake **)0xFFFFFFFF; Код:
(pGameMode->*OnGameModeInit)(); |