December 14, 2017, 09:35:22 PM

Author Topic: Noclip skill  (Read 832 times)

Offline C h a p e z

  • Level 1 Trained Beginner
  • *
  • Posts: 24
  • Country: dk
  • Legion Gaming WCS <3
Noclip skill
« on: January 31, 2017, 11:23:34 PM »
I was wondering if it is possible to remove the godmode on noclip skills o_O

I tried this by myself, but it doesn´t work

Code: [Select]
[[skill1]]
setting             = "es_xset wcs_time 1;es_xset wcs_duration 2|es_xset wcs_time 2;es_xset wcs_duration 3|es_xset wcs_time 3;es_xset wcs_duration 4|es_xset wcs_time 4;es_xset wcs_duration 5"
cmd                 = "es playerset noclip server_var(wcs_userid) 1;es_delayed server_var(wcs_time) es playerset noclip server_var(wcs_userid) 0;es wcs_setfx god server_var(wcs_userid) 0"
sfx                 = ""


Offline 2569123

  • Level 5 Trained Intermediate
  • *****
  • Posts: 111
  • <3 WCS :)
Re: Noclip skill
« Reply #1 on: February 01, 2017, 10:06:39 AM »
don't use server_var(wcs_userid)
try event_var(userid) insteard it

Offline Teller

  • Level 7 Expert
  • *****
  • Posts: 261
  • Country: dk
  • #FIXYOURRACE
Re: Noclip skill
« Reply #2 on: February 01, 2017, 10:48:38 AM »
Godmode is sort of a built-in function when it comes to NoClip, so you cant remove it

This is the best wcs server i've ever seen.
Check it out ! http://warcraft-source.com/board/index.php?topic=16799.0

Offline Eareland

  • Level 7 Expert
  • *****
  • Posts: 700
  • Country: fi
  • Most honest is to be without a word of a lie
    • FSSM
Re: Noclip skill
« Reply #3 on: February 02, 2017, 02:04:10 PM »
Godmode is sort of a built-in function when it comes to NoClip, so you cant remove it

This.

Forget the idea.


Offline Ayuto

  • Level 1 Trained Beginner
  • *
  • Posts: 25
  • Country: de
    • Source.Python
Re: Noclip skill
« Reply #4 on: February 02, 2017, 08:09:34 PM »
Actually, it's possible.  :)

This is a proof of concept made with Source.Python.
Code: [Select]
from players.entity import Player
from core import PLATFORM
from core import SOURCE_ENGINE_BRANCH

NOP = 0x90

if PLATFORM != 'linux':
    raise ValueError('POC only for Linux.')

if SOURCE_ENGINE_BRANCH != 'css':
    raise ValueError('POC only for CS:S.')

player = Player(1)
if player.is_fake_client():
    raise ValueError('POC only for humans.')


ptr = player.on_take_damage + 399
ptr.unprotect(2)

# OP codes before patch
"""
0F B6 93 52 01 00 00        movzx   edx, byte ptr [ebx+152h]; Get player move type
83 FA 08                    cmp     edx, 8                  ; Check if it's MOVETYPE_NOCLIP
74 81                       jz      short loc_591CE2        ; Jump to label, which does some cleanup and returns to the caller
"""

ptr.set_uchar(NOP, 0)
ptr.set_uchar(NOP, 1)

# OP codes after patch
"""
0F B6 93 52 01 00 00        movzx   edx, byte ptr [ebx+152h]
83 FA 08                    cmp     edx, 8                  ; We could actually NOP this as well, but it's not needed
90                          nop
90                          nop
"""

Offline Manifest

  • Moderator
  • Level 7 Expert
  • *****
  • Posts: 760
  • Country: dk
  • Working on a new server
Re: Noclip skill
« Reply #5 on: February 02, 2017, 08:15:39 PM »
Actually, it's possible.  :)

This is a proof of concept made with Source.Python.

It is true this is possible, however the version he is using right now is the ES:P version, and if you install source python which is a criteria in order for the code you just posted to work, then it will cause way more havoc on the server due to a lot of errors occuring.

It should also be doable using SourcePawn which would be the way to go for this version, in order to avoid the issues with having ESS and SourcePython installed on the same server.


Sincerely
- Manifest
"BRAVORA: Bruh it is fucking operation crystal night when you are approving races."

Offline Muerte

  • Administrator
  • Level 7 Expert
  • *****
  • Posts: 1801
  • Country: be
    • Fortitude
Re: Noclip skill
« Reply #6 on: February 02, 2017, 08:16:27 PM »
Not to mention it should be possible with ES:P too, right?
Anyways why you all code so late? Or early? Don't you guys sleep at all?
Sleep? What's that? Just put a wire up your arse and charge while you code during the night. Doesn't all do that, or is it just me??

Offline Manifest

  • Moderator
  • Level 7 Expert
  • *****
  • Posts: 760
  • Country: dk
  • Working on a new server
Re: Noclip skill
« Reply #7 on: February 02, 2017, 08:17:50 PM »
Not to mention it should be possible with ES:P too, right?

I lack the understanding of the ES:P if it had to be done it would be utilizing the python part. Which is something that I do not know much of, but I have not seen anybody do it before. I highly doubt it, but maybe.

"BRAVORA: Bruh it is fucking operation crystal night when you are approving races."

Offline Ayuto

  • Level 1 Trained Beginner
  • *
  • Posts: 25
  • Country: de
    • Source.Python
Re: Noclip skill
« Reply #8 on: February 02, 2017, 08:24:12 PM »
Well, it's a proof of concept and it's meant to show that it's possible. I'm not sure if Sourcemod has the capabilities to patch bytes. If not, you will need a Sourcemod extension. However, it's also feasible with SPE, which can be loaded together with Sourcemod.

Offline Manifest

  • Moderator
  • Level 7 Expert
  • *****
  • Posts: 760
  • Country: dk
  • Working on a new server
Re: Noclip skill
« Reply #9 on: February 02, 2017, 09:10:01 PM »
I know it was proof of concept, but it was posted here in the ES:PY section so he wont really be able to use it sadly. However I wish eventscripts and source python was able to get along, as it would provide a whole new world of features for CS:S aswell :-)
"BRAVORA: Bruh it is fucking operation crystal night when you are approving races."

Offline Ayuto

  • Level 1 Trained Beginner
  • *
  • Posts: 25
  • Country: de
    • Source.Python
Re: Noclip skill
« Reply #10 on: February 02, 2017, 10:54:51 PM »
Okay, I felt kinda challenged, so here is a pure Python version, which is completely independent from ES or SP. It's only using Python's built-in ctypes module, so you could probably even load it from a Python interpreter on your operating system (after updating the path to the engine_srv.so).  ;D
Code: [Select]
from ctypes import *

NOP = 0x90
PROT_READ = 0x1
PROT_WRITE = 0x2
PROT_EXEC = 0x4
PROT_ALL = PROT_READ|PROT_WRITE|PROT_EXEC
PAGE_SIZE = 4096

# Helpers
def get_ptr(ptr, offset=0):
    assert ptr != 0
    return c_void_p.from_address(ptr+offset).value
   
def set_uchar(ptr, value, offset=0):
    assert ptr != 0
    c_ubyte.from_address(ptr+offset).value = value
   
def get_virtual_func(ptr, index):
    vtable = get_ptr(ptr)
    assert vtable != 0
    return get_ptr(vtable, index * 4)
   
# Get engine pointer
engine_lib = CDLL('bin/engine_srv.so')
CreateInterface = engine_lib.CreateInterface
CreateInterface.restype = c_uint32
arg1 = c_char_p('VEngineServer023')
engine_ptr = CreateInterface(arg1, None)
assert engine_ptr != 0

# Get virtual edict_t* IVEngineServer::PEntityOfEntIndex(int)
PEntityOfEntIndex = CFUNCTYPE(c_void_p, c_void_p, c_int)(
    get_virtual_func(engine_ptr, 19))

# Get player with index 1 -- make sure it exists on the server!
edict_ptr = PEntityOfEntIndex(engine_ptr, 1)
assert edict_ptr != 0

# Get m_pUnk
entity_ptr = get_ptr(edict_ptr, 12)
assert entity_ptr != 0

# Get virtual void CCSPlayer::OnTakeDamage(CTakeDamageInfo const&)
patch_loc = get_virtual_func(entity_ptr, 63) + 399

# Get mprotect
libc = CDLL("libc.so.6")
mprotect = libc.mprotect
mprotect.argtypes = [c_void_p, c_size_t, c_int]

# Add write permissions
if mprotect(patch_loc & ~(PAGE_SIZE-1), PAGE_SIZE, PROT_ALL):
    raise ValueError('Failed to set permissions.')

# Patch bytes
set_uchar(patch_loc, NOP, 0)
set_uchar(patch_loc, NOP, 1)

Offline Muerte

  • Administrator
  • Level 7 Expert
  • *****
  • Posts: 1801
  • Country: be
    • Fortitude
Re: Noclip skill
« Reply #11 on: February 03, 2017, 12:20:47 AM »
Hahaha Ayuto, how is that possible.
That is taking things to a whole new level.
Anyways why you all code so late? Or early? Don't you guys sleep at all?
Sleep? What's that? Just put a wire up your arse and charge while you code during the night. Doesn't all do that, or is it just me??

Offline Predz

  • Moderator
  • Level 7 Expert
  • *****
  • Posts: 548
  • Country: england
  • Warcraft: GO Co-Lead Programmer
Re: Noclip skill
« Reply #12 on: February 06, 2017, 05:48:50 PM »
Lol Ayuto what have you been drinking? xD

Using this patch would make noclip constantly have this change, wouldn't it? If so, do you reckon it would be reliable to do this inside a PreHook and then revert the changes on PostHook, as highly likely people would not want this constantly.

If I am misunderstanding something please correct me :)
« Last Edit: February 06, 2017, 10:34:21 PM by Predz »

Offline Ayuto

  • Level 1 Trained Beginner
  • *
  • Posts: 25
  • Country: de
    • Source.Python
Re: Noclip skill
« Reply #13 on: February 07, 2017, 10:17:28 PM »
Yes, the change would be constantly. So, you always get damage in noclip mode. A hook "could" be used to disable damage on demand, but it's much easier to enable godmode when you are in noclip mode.

Offline 2569123

  • Level 5 Trained Intermediate
  • *****
  • Posts: 111
  • <3 WCS :)
Re: Noclip skill
« Reply #14 on: February 10, 2017, 11:58:12 AM »
nice to meet you here)