Comments (4)
maybe you can show how that would look like for one function?
from cod4x_server.
void (*Com_Printf)(const char * fmt, ...) = (void(*)(const char *, ...)0x12345678;
Where 0x12345678 is an address in lnxded binary.
Variable Com_Printf
(also called function pointer or functor) at a compilation will became a function with next body: jmp dword ptr [0x12345678]
. Exactly the same we can see in .asm files.
Here's pseudo assembler code will be generated for Com_Printf("test format %d\n", 0x123);
:
push 0x123; push "test format %d\n"; call Com_Printf => jmp 0x12345678 => (original function) => (return back to Com_Printf call).
Obviously, this will work only for __cdecl functions because stack is cleared after original function code. Variadic arguments in declaration always means this is __cdecl function, for other, you must include prologue and epilogue where you will reserve and clear function stack, or save\restore registers (used for IDA's __usercall, __stdcall, __thiscall) etc.
from cod4x_server.
I can convert assembly code into functors and update compiler script if you want.
from cod4x_server.
Whop, one more reason to get rid of nasm #76
from cod4x_server.
Related Issues (20)
- Cod4 Mod FF Compiler Issue HOT 1
- .ff different from server help HOT 3
- Server received signal: Segmentation fault HOT 2
- Problems with downloads HOT 15
- problem starting bots with my mod HOT 19
- CL_CGameNeedsServerComand:a reliable command was cycled out HOT 4
- [BUG] AmbientPlay is crap since 20.X HOT 12
- problem with compiling cod4x server in linux debian. HOT 5
- [request] The need of stock asset registration skip HOT 2
- Demo Recording Filename HOT 6
- Torjan - Can't be false positive? HOT 2
- Impure client detected! Invalid .IWD files referenced! HOT 3
- Error HOT 1
- Implement NAT Hole punching HOT 7
- Find game files (main, zone) from current working directory rather than where the binary is HOT 1
- Multiple Steamid same playerid HOT 7
- Impure client detected HOT 4
- Compile errors HOT 2
- cannot execute: required file not found debug HOT 4
- kill then start server causes "Warning: NET_IP4Socket: bind: Address already in use" HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cod4x_server.