CSGO: Bot waypoints real time manipulation

Please post any questions about developing your plugin here. Please use the search function before posting!
User avatar
khaimovmr
Member
Posts: 53
Joined: Fri Aug 25, 2017 3:15 am
Contact:

CSGO: Bot waypoints real time manipulation

Postby khaimovmr » Tue Mar 26, 2019 12:43 am

Hi, guys!

I have a goal to make bot run into the specific variable point of existent official map (de_dust2, for example).
Does anybody have any clues where to start digging for info on this?
User avatar
Ayuto
Project Leader
Posts: 2195
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Re: CSGO: Bot waypoints real time manipulation

Postby Ayuto » Sat Mar 30, 2019 10:35 am

There is CCSBot::MoveTo, which forces a bot to run to a specific point using either the fastest route or safest route.

I have some old code on my pastebin, which was working fine for CS:S:
qazuar
Junior Member
Posts: 16
Joined: Fri Jun 20, 2014 9:05 am

Re: CSGO: Bot waypoints real time manipulation

Postby qazuar » Mon Apr 29, 2019 4:18 pm

Would someone be able to help with a working example in cs:go?
User avatar
Ayuto
Project Leader
Posts: 2195
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Re: CSGO: Bot waypoints real time manipulation

Postby Ayuto » Mon Apr 29, 2019 8:27 pm

I have updated the code above to work with the latest SP version and added signatures for CS:S and CS:GO for Windows and Linux.
qazuar
Junior Member
Posts: 16
Joined: Fri Jun 20, 2014 9:05 am

Re: CSGO: Bot waypoints real time manipulation

Postby qazuar » Wed May 01, 2019 3:00 pm

This is great, thanks.

Although, todays update apparently changed the signature on windows.
User avatar
Ayuto
Project Leader
Posts: 2195
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Re: CSGO: Bot waypoints real time manipulation

Postby Ayuto » Wed May 01, 2019 4:30 pm

I absolutely hate CS:GO and its updates...

Updated the snippet with more future proof signatures.
User avatar
khaimovmr
Member
Posts: 53
Joined: Fri Aug 25, 2017 3:15 am
Contact:

Re: CSGO: Bot waypoints real time manipulation

Postby khaimovmr » Sat May 04, 2019 2:48 pm

Ayuto, thank you so much, man!
User avatar
khaimovmr
Member
Posts: 53
Joined: Fri Aug 25, 2017 3:15 am
Contact:

Re: CSGO: Bot waypoints real time manipulation

Postby khaimovmr » Thu May 09, 2019 12:50 am

Trying your solution right now, Ayuto - seems like it can not find "server_srv.so" on find_binary method execution:
```
L 05/09/2019 - 00:36:27: - sp.hooks.exceptions - EXCEPTION

[SP] Caught an Exception:
Traceback (most recent call last):
File "../addons/source-python/packages/source-python/plugins/command.py", line 162, in load_plugin
plugin = self.manager.load(plugin_name)
File "../addons/source-python/packages/source-python/plugins/manager.py", line 194, in load
plugin._load()
File "../addons/source-python/packages/source-python/plugins/instance.py", line 74, in _load
self.module = import_module(self.import_name)
File "../addons/source-python/plugins/field_training/field_training.py", line 39, in <module>
srv = memory.find_binary('server')

OSError: Unable to find ../bin/server_srv.so
```

I didn't find such file in the csgo installation directory.

Can you give some advice - where to dig on this matter?
User avatar
khaimovmr
Member
Posts: 53
Joined: Fri Aug 25, 2017 3:15 am
Contact:

Re: CSGO: Bot waypoints real time manipulation

Postby khaimovmr » Thu May 09, 2019 1:21 am

I've found the file `<csgo-install-folder>/csgo/server.so` and made a symlink for it `<csgo-install-folder>/csgo/server_srv.so`.
Got it working. Thanks again!
User avatar
khaimovmr
Member
Posts: 53
Joined: Fri Aug 25, 2017 3:15 am
Contact:

Re: CSGO: Bot waypoints real time manipulation

Postby khaimovmr » Thu Aug 03, 2023 4:05 pm

Hey, guys, can someone help me out with this thing?
I believe the game identifier have changed (at least for Linux).
I used this code from Ayuto's example above.

Syntax: Select all

IDENTIFIER = b'\x55\x89\xE5\x8B\x55\x0C\x8B\x45\x08\x8B\x0A\x89\x88\x2A\x2A\x2A\x2A\x8B\x4A\x04\x89\x88\x2A\x2A\x2A\x2A\x8B\x52\x08\x89\x90\x2A\x2A\x2A\x2A\x8B\x55\x10\x89\x90'
MoveTo = SRV[IDENTIFIER].make_function(
Convention.THISCALL,
[DataType.POINTER, DataType.POINTER, DataType.INT],
DataType.VOID
)


This code is giving me the exception:

Syntax: Select all

Traceback (most recent call last):
File "../addons/source-python/packages/source-python/plugins/command.py", line 164, in load_plugin
plugin = self.manager.load(plugin_name)
File "../addons/source-python/packages/source-python/plugins/manager.py", line 209, in load
plugin._load()
File "../addons/source-python/packages/source-python/plugins/instance.py", line 74, in _load
self.module = import_module(self.import_name)
File "../addons/source-python/plugins/field_training/field_training.py", line 9, in <module>
import field_training.ft_command_handlers
File "../addons/source-python/plugins/field_training/ft_command_handlers.py", line 17, in <module>
import field_training.ft_utils as ftu
File "../addons/source-python/plugins/field_training/ft_utils.py", line 81, in <module>
MoveTo = SRV[IDENTIFIER].make_function(

ValueError: Could not find signature: 5589e58b550c8b45088b0a89882a2a2a2a8b4a0489882a2a2a2a8b520889902a2a2a2a8b55108990
cssbestrpg
Senior Member
Posts: 309
Joined: Sun May 17, 2020 7:56 am
Location: Finland
Contact:

Re: CSGO: Bot waypoints real time manipulation

Postby cssbestrpg » Thu Aug 03, 2023 4:13 pm

khaimovmr wrote:Hey, guys, can someone help me out with this thing?
I believe the game identifier have changed (at least for Linux).
I used this code from Ayuto's example above.

Syntax: Select all

IDENTIFIER = b'\x55\x89\xE5\x8B\x55\x0C\x8B\x45\x08\x8B\x0A\x89\x88\x2A\x2A\x2A\x2A\x8B\x4A\x04\x89\x88\x2A\x2A\x2A\x2A\x8B\x52\x08\x89\x90\x2A\x2A\x2A\x2A\x8B\x55\x10\x89\x90'
MoveTo = SRV[IDENTIFIER].make_function(
Convention.THISCALL,
[DataType.POINTER, DataType.POINTER, DataType.INT],
DataType.VOID
)


This code is giving me the exception:

Syntax: Select all

Traceback (most recent call last):
File "../addons/source-python/packages/source-python/plugins/command.py", line 164, in load_plugin
plugin = self.manager.load(plugin_name)
File "../addons/source-python/packages/source-python/plugins/manager.py", line 209, in load
plugin._load()
File "../addons/source-python/packages/source-python/plugins/instance.py", line 74, in _load
self.module = import_module(self.import_name)
File "../addons/source-python/plugins/field_training/field_training.py", line 9, in <module>
import field_training.ft_command_handlers
File "../addons/source-python/plugins/field_training/ft_command_handlers.py", line 17, in <module>
import field_training.ft_utils as ftu
File "../addons/source-python/plugins/field_training/ft_utils.py", line 81, in <module>
MoveTo = SRV[IDENTIFIER].make_function(

ValueError: Could not find signature: 5589e58b550c8b45088b0a89882a2a2a2a8b4a0489882a2a2a2a8b520889902a2a2a2a8b55108990


Hi, it shows the signature is outdated, but unfortunaly i have co clue how get signature
User avatar
L'In20Cible
Project Leader
Posts: 1534
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Re: CSGO: Bot waypoints real time manipulation

Postby L'In20Cible » Thu Aug 03, 2023 6:14 pm

Code: Select all

// CCSBot::MoveTo (CSGO/Linux)

\x55\x89\xE5\x8B\x55\x0C\x8B\x45\x08\xF3\x0F\x10\x02\xF3\x0F\x11\x80\x2A\x2A\x2A\x2A\xF3\x0F\x10\x42\x04\xF3\x0F\x11\x80\x2A\x2A\x2A\x2A\xF3\x0F\x10\x42\x08\x8B\x55\x10\xF3\x0F\x11\x80\x2A\x2A\x2A\x2A\x89\x90\x2A\x2A\x2A\x2A\x8D\x90\x2A\x2A\x2A\x2A\x89\x55\x0C\x5D\xE9\x2A\x2A\x2A\x2A
For future reference, it's the first call above the following string:

Image

Code: Select all

.text:00DD0770                                                 sub_DD0770      proc near               ; CODE XREF: sub_DB3F00+2CE↑p
.text:00DD0770                                                                                         ; sub_DB3F00+86D↑p ...
.text:00DD0770
.text:00DD0770                                                 arg_0           = dword ptr  8
.text:00DD0770                                                 arg_4           = dword ptr  0Ch
.text:00DD0770                                                 arg_8           = dword ptr  10h
.text:00DD0770
.text:00DD0770                                                 ; __unwind {
.text:00DD0770 55                                                              push    ebp
.text:00DD0771 89 E5                                                           mov     ebp, esp
.text:00DD0773 8B 55 0C                                                        mov     edx, [ebp+arg_4]
.text:00DD0776 8B 45 08                                                        mov     eax, [ebp+arg_0]
.text:00DD0779 F3 0F 10 02                                                     movss   xmm0, dword ptr [edx]
.text:00DD077D F3 0F 11 80 50 3D 00 00                                         movss   dword ptr [eax+3D50h], xmm0
.text:00DD0785 F3 0F 10 42 04                                                  movss   xmm0, dword ptr [edx+4]
.text:00DD078A F3 0F 11 80 54 3D 00 00                                         movss   dword ptr [eax+3D54h], xmm0
.text:00DD0792 F3 0F 10 42 08                                                  movss   xmm0, dword ptr [edx+8]
.text:00DD0797 8B 55 10                                                        mov     edx, [ebp+arg_8]
.text:00DD079A F3 0F 11 80 58 3D 00 00                                         movss   dword ptr [eax+3D58h], xmm0
.text:00DD07A2 89 90 5C 3D 00 00                                               mov     [eax+3D5Ch], edx
.text:00DD07A8 8D 90 4C 3D 00 00                                               lea     edx, [eax+3D4Ch]
.text:00DD07AE 89 55 0C                                                        mov     [ebp+arg_4], edx
.text:00DD07B1 5D                                                              pop     ebp
.text:00DD07B2 E9 A9 F2 FF FF                                                  jmp     sub_DCFA60
.text:00DD07B2                                                 ; } // starts at DD0770
.text:00DD07B2                                                 sub_DD0770      endp

Return to “Plugin Development Support”

Who is online

Users browsing this forum: Bing [Bot] and 11 guests