![]() |
![]() |
bir3yk |
![]()
Post
#1
|
RCBot Fan ![]() ![]() ![]() ![]() Group: Members Posts: 107 Joined: 4-June 09 Member No.: 1,566 ![]() |
I compiled a linux RCBot2 0.5
1. Folder Structure : .../hl2 .../orangebox <-- srcds_run is here (for TF2 and Orange-Box games) .../orangebox/bin <-- HPB_bot2_i486.so files copied here .../rcbot2/ .../rcbot2/config/ .../rcbot2/profiles/ .../rcbot2/waypoints/ .../rcbot2/waypoints/orangebox/tf/ <-- waypoint and scripts files copied here .../steam 2. Edit .../rcbot2/config/bot_mods.ini mod = TF2 steamdir = orangebox gamedir = tf bot = TF2 3. Add ./srcds_run ..............+plugin_load ../bin/HPB_bot2 146 SVN revisions 119 SVN revisions RCbot2 0.52 121 SVN revisions 121 SVN revisions RCbot2 0.53 122 SVN revisions 122 SVN revisions 124 SVN revisions 124 SVN revisions 126 SVN revisions 126 SVN revisions 146 SVN revisions 146 SVN revisions |
![]() ![]() |
TesterYYY |
![]()
Post
#2
|
Member ![]() ![]() Group: Members Posts: 24 Joined: 25-January 13 Member No.: 2,251 ![]() |
Can somebody compile rcbot 0.71 for linux? I find it hard to compile it under linux... Manual how to compile under linux would be also good.
|
Cheeseh |
![]()
Post
#3
|
![]() Admin ![]() ![]() ![]() ![]() ![]() Group: Admin Posts: 3,066 Joined: 11-September 03 From: uk Member No.: 1 ![]() |
|
Ted |
![]()
Post
#4
|
Member ![]() ![]() Group: Members Posts: 13 Joined: 20-February 13 Member No.: 2,257 ![]() |
bir3yk is the guy we'd need to talk to but he hasn't been active for more than a year. I've managed to build and run the latest version on Ubuntu. Some changes had to be made to get it to build as the latest version of GCC is a bit more strict regarding syntax. I also discovered that the RunPlayeroveCommand detouring code for LINUX was causing a segmentation fault since the memory address passed to mprotect needs to be page aligned. After fixing that issue, I managed to add a bot, but it just stands around. Any idea what may be causing this? Also for the changes I made, should I send those to you as a diff or do you want the updated files? |
Cheeseh |
![]()
Post
#5
|
![]() Admin ![]() ![]() ![]() ![]() ![]() Group: Admin Posts: 3,066 Joined: 11-September 03 From: uk Member No.: 1 ![]() |
I've managed to build and run the latest version on Ubuntu. Some changes had to be made to get it to build as the latest version of GCC is a bit more strict regarding syntax. I also discovered that the RunPlayeroveCommand detouring code for LINUX was causing a segmentation fault since the memory address passed to mprotect needs to be page aligned. After fixing that issue, I managed to add a bot, but it just stands around. Any idea what may be causing this? Also for the changes I made, should I send those to you as a diff or do you want the updated files? I'd like the code you used for mprotect as i'm not sure how it works in linux As for bots standing around. Runplayermove hook is the most important function needed, so perhaps its not hooking to the correct address or it's an mprotect problem |
Ted |
![]()
Post
#6
|
Member ![]() ![]() Group: Members Posts: 13 Joined: 20-February 13 Member No.: 2,257 ![]() |
I'd like the code you used for mprotect as i'm not sure how it works in linux As for bots standing around. Runplayermove hook is the most important function needed, so perhaps its not hooking to the correct address or it's an mprotect problem CODE #include <sys/mman.h> #include <errno.h> #include <unistd.h> ..... #ifndef __linux__ VirtualProtect( &pdwNewInterface[vtable], 4, PAGE_EXECUTE_READWRITE, &dwOld ); #else // need page aligned address char *addr = reinterpret_cast<char *>(reinterpret_cast<DWORD>(&pdwNewInterface[vtable]) - reinterpret_cast<DWORD>(&pdwNewInterface[vtable]) % sysconf(_SC_PAGE_SIZE)); int len = sizeof(DWORD) + reinterpret_cast<DWORD>(&pdwNewInterface[vtable]) % sysconf(_SC_PAGE_SIZE); if (mprotect(addr, len, PROT_EXEC|PROT_READ|PROT_WRITE) == -1) { Warning("In VirtualTableHook while calling mprotect for write access: %s.\n", strerror(errno)); } else { #endif dwStor = pdwNewInterface[vtable]; *(DWORD*)&pdwNewInterface[vtable] = newInterface; #ifndef __linux__ VirtualProtect(&pdwNewInterface[vtable], 4, dwOld, &dwOld); #else if (mprotect(addr, len, PROT_EXEC|PROT_READ) == -1) { Warning("In VirtualTableHook while calling mprotect to remove write access: %s.\n", strerror(errno)); } } #endif |
![]() ![]() |
![]() |
Lo-Fi Version | Time is now: 20th August 2024 - 09:53 PM |