QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 777|回复: 1

linux下玩cs的cd解决方案,不知道old么?不过很管用

[复制链接]
发表于 2003-11-22 11:43:34 | 显示全部楼层 |阅读模式
I have seen a few people asking in CD IRC channel how to get CD working in WINE so they can play on linux. Here's how to do it:
You are going to create a linux library that will hook a function HL uses and load cd.dll from within hl itself, since WINE does not support the external dll loading API's that CD uses
First, create a file "cdlinux.c" with the following contents:

CODE        

#include<dlfcn.h>
char* (*p_GetCommandLineA)()=0;
int times=0;
char *GetCommandLineA() {
       if(!p_GetCommandLineA)
               p_GetCommandLineA=dlsym((void*)-1,"GetCommandLineA");
       times++;
       if(times==6)
               LoadLibraryA("C:\\Program Files\\Cheating-Death\\cd.dll");
       return (*p_GetCommandLineA)();
}
       

You may need to change the path in the LoadLibraryA line to wherever you installed your CD. Make sure you use \\ to seperate directories, NOT / or \
Now you compile this by doing
$ gcc -shared cdlinux.c -o cdlinux.so

Next go into your Half-Life directory, and create a file called "cdlinux.sh" with the following contents:

CODE        

#!/bin/sh
export LD_PRELOAD="/lib/libdl.so.2 /usr/lib/transgaming/winex/lib/libkernel32.so /path/to/your/cdlinux.so"
export LD_LIBRARY_PATH="/usr/lib/transgaming/winex/lib"
winex hl.exe -- $*
       

note these paths are for winex binary. If you are using wine or winex source you may need to change them to whatever they are for those(search for libkernel32.so and thats the directory to use)
Change the /path/to/your/cdlinux.so to where the cdlinux.so you created is
You will NOT use cdeath.exe AT ALL. Now when you want to use cd, simply run "sh cdlinux.sh", and CD will be loaded, and you can play on CD servers!
发表于 2003-11-22 19:08:50 | 显示全部楼层
先顶了,试试
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-11-3 04:28 , Processed in 0.041579 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表