how to block "sm plugins" console commands in css v34?
|
|
aphrodit
|
Дата: Четверг, 05.10.2017, 08:56:19 | Сообщение # 1 |
|
Сообщений: 12
Репутация: 0 [ +/- ]
|
|
Hi how to block "sm plugins" console commands in css v34?
my sourcemod 1.4.2
Сообщение отредактировал aphrodit - Воскресенье, 08.10.2017, 09:22:01 |
|
| |
chilla_mytku
|
Дата: Суббота, 07.10.2017, 21:41:09 | Сообщение # 2 |
|
Сообщений: 83
Репутация: 0 [ +/- ]
|
|
Тоже интересно!
|
|
| |
tonline_kms65
|
Дата: Среда, 11.10.2017, 02:03:45 | Сообщение # 3 |
|
Сообщений: 215
Репутация: 3 [ +/- ]
|
|
Цитата aphrodit ( ) how to block "sm plugins" console commands in css v34?
Интересно, для какой цели? Если понять цель - можно наверно найти решение. Опять же если есть смысл.
|
|
| |
aphrodit
|
Дата: Среда, 11.10.2017, 11:36:29 | Сообщение # 4 |
|
Сообщений: 12
Репутация: 0 [ +/- ]
|
|
for more security my server information please and for dont show list plugins for all please write this plugin for me. tnx
|
|
| |
Nail
|
Дата: Четверг, 12.10.2017, 17:08:24 | Сообщение # 5 |
|
Сообщений: 38
Репутация: 8 [ +/- ]
|
|
You'll have to recompile sourcemod to achieve the goal. Edit sourcemod-master/core/logic/PluginSys.cpp this way:
Код rootmenu->AddRootConsoleCommand("plugins", "Manage Plugins", this); Change to:
Код //rootmenu->AddRootConsoleCommand("plugins", "Manage Plugins", this); and
Код rootmenu->RemoveRootConsoleCommand("plugins", this); Change to:
Код //rootmenu->RemoveRootConsoleCommand("plugins", this);
You may block "sm" command as well, to unlock it edit this file sourcemod-master/core/smn_console.cpp. Comment all if-blocks with "sm" and reregister the command via smx script to whatever action you want.
Сообщение отредактировал Nail - Четверг, 12.10.2017, 17:09:02 |
|
| |
aphrodit
|
Дата: Вторник, 17.10.2017, 05:34:45 | Сообщение # 6 |
|
Сообщений: 12
Репутация: 0 [ +/- ]
|
|
i can not find sourcemod-master 1.4.2 please give me a download link.
|
|
| |
Nail
|
Дата: Воскресенье, 22.10.2017, 17:31:34 | Сообщение # 7 |
|
Сообщений: 38
Репутация: 8 [ +/- ]
|
|
All the information You can find here: https://wiki.alliedmods.net/Building_SourceMod The most up-to-date Sourcemod and Metamod sources are here: https://github.com/alliedmodders Don't forget that on linux platforms SM SDK should be cloned recursively
Сообщение отредактировал Nail - Воскресенье, 22.10.2017, 17:32:43 |
|
| |
aphrodit
|
Дата: Воскресенье, 12.11.2017, 13:07:10 | Сообщение # 8 |
|
Сообщений: 12
Репутация: 0 [ +/- ]
|
|
i cant do it please Do It and upload for me thank you
|
|
| |
AdabraIM
|
Дата: Понедельник, 27.11.2017, 08:18:52 | Сообщение # 9 |
|
Сообщений: 32
Репутация: 0 [ +/- ]
|
|
Hi I have got the same problem and for my server security I want to do this... I couldnt do it myself please do it for us and upload it if possible! No one is willed to help me and you might be my last chance of help pleaseee Thanks!
|
|
| |
Nail
|
Дата: Понедельник, 27.11.2017, 18:26:32 | Сообщение # 10 |
|
Сообщений: 38
Репутация: 8 [ +/- ]
|
|
Wow, guys your avatars and styles of writing are so much alike, are you brothers? :) Seriously, I can't do it for you. Each new SM or MM version will require the extension to be recompiled. And it's good if you work in *unix environment couse it won't take that much time to ajust everithing, otherwise you have to have some sort of "virtual system" and it'll definitely require space on your hard drive... I used to use VmWare Workstation and it consumed about 20GB on my hard drive. At the moment I have no *unix system, have no time to set it up from scratch. And I'm definitely not ready to keep it and rebuild SM after each update. Ok, what I wonna tell you is that you should do it by yourself and it's your lucky day, couse I've got a special instruction for you.
Sorry it's written in bad english: d - user name Follow these steps: 1 and 4 (omite the others, the others are for SMMM extensions)
================== Rebuilding extensions ================================= Omit this instruction, unless you have the SDK environment set up
Move "extensions" to "/home/d/SDK/sourcemod/" The result should look AS this "/home/d/SDK/sourcemod/extensions/" Replace AMBuildScript file with a newer one Open CMD and set current directory to this: "/home/d/SDK/sourcemod/build" Reconfigure the projects: > python ../configure.py --sdks css build the projects > ambuild Copy the result "*.so" file to this folder: "addons/sourcemod/extensions"
================= Setting up the Environment and building extensions =========== Omit this instruction, unless you need to install/reinstall the source SDK environment
1) Build the SDK: https://wiki.alliedmods.net/Building_SourceMod Run CMD and set current directory for the SDK. "/home/d/SDK/" for instance.
>git clone --recursive https://github.com/alliedmodders/sourcemod >bash sourcemod/tools/checkout-deps.sh >cd ambuild >sudo python setup.py install
At this moment you have these folders in your SDK directory: "ambuild", "hl2sdk-*", "sourcemod", "mmsource-*" and may be "mysql-*"
2) Put your extensions into this folder: *SDK/sourcemod/extensions If you have problems, look at the example extensions located at this folder.
Fllow step 3 if your extension doesn't have ambuild configurations, omit it otherwise 3) You can see there are other extensions at "*SDK/sourcemod/extensions". "cstrike" extension has an AMBuilder script: "Extension/AMBuilder", copy it into yours extension folder, Open it and add all the *.cpp and *.c files into the "project.sources" block, and remove the old ones. Replace the extension name i.e. "cstrike" with whatever name you need and save the file. You can skip this step if the sources have a valid AMBuilder file.
Add your extension to the ambuild config: *SDK/sourcemod/AMBuildScript this way:
>BuildScripts = [ >#'loader/AMBuilder', >'extensions/YourExtension/AMBuilder', >]
4) It's time to build the extension now. From now on you may follow the "Rebuilding extensions" block as well. Set build derictory: >./SDK/sourcemod/build/
Make your choose, whether you need Release or Debug version:
Reconfiguration for RELEASE mode (fast): >python ../configure.py --sdks css
Reconfiguration for DEBUG mode (slow): >python ../configure.py --sdks css --enable-debug
To set another game, correct this part of the command "--sdks css" All the available game types are here: AMBuildScript -> PossibleSDKs.
Compiling: >ambuild
If it doesn't work, make sure that the AMBuilder is correct, i.e. it has all the *.cpp files of the project, and the file name of the extension isn't "game.cstrike.ext".
Update the extension signatures and offsets if necesarry. The relative gamedata are located here: "addons/sourcemod/gamedata"; - finding virtual offsets instruction https://wiki.alliedmods.net/Finding_virtual_offsets - finding virtual offsets forum https://forums.alliedmods.net/showthread.php?t=191171 - a useful video about signing by ProdigySim: https://www.youtube.com/watch?v=4T03pckoB5g
Read the information below if you still have problems or questions.
================== Extra information ================================= Building extensions: https://wiki.alliedmods.net/Building_sourcemod If you ran into problems, you can ask your questions here: https://forums.alliedmods.net/forumdisplay.php?f=75 If you get a message that one of the sdk headers is missing, add it's dir here AMBuildScript -> compiler.cxxincludes. If you want the compiler to ignore some bad warnings add this (I wouldn't recommend it though): AMBuildScript -> cxx.cxxflags -> '-Wno-error', (don't forget the comma);
Comment the extension path here: AMBuildScript -> BuildScripts to remove or disable some of the extensions; If you have problems with libstdc++, read this topic: https://forums.alliedmods.net/showthread.php?t=285307 ;)
================================ ================================= Yes, you can ask your questions here, And No, I won't answer PM questions.
P.S. don't forget to install gcc, g++ and the other shit that is required for everything to work... you know. Good luck, guys :)
Сообщение отредактировал Nail - Вторник, 28.11.2017, 17:25:16 |
|
| |
|
Nail
|
Дата: Среда, 29.11.2017, 20:40:35 | Сообщение # 12 |
|
Сообщений: 38
Репутация: 8 [ +/- ]
|
|
Well, you are right but not quite. It's a lot more complicated to write such plugin... but, as you have it written, it is a lot easier to correct the signatures, of course if you have DHook for you version of server. And you don't. I may assure you that it's hardly possible for you to rewrite this extension for old versions of MM and SM, couse it's huge and not well documented. Though you can write an extension.. it wouldn't take much time if you good at C++. So yo need: 1) Write an extenson with all the DETOUR's, VPHooks and whatever else you need... 2) Build it against actual (for you) versions of SM and MM and your engine version 3) Correct the signatures
For the first step try to build this extension: https://forums.alliedmods.net/showthread.php?t=159876 It does exactly what you need, but for other functions, which you will have to replace to the ones from your plugin. Second step is more complicated... not sure if ambuild is competable with v34 and old SDKs.. but you can use the MakeFile from the extension archive, it worked for me just fine a few years ago. And of course you can try to use my instruction for ambuild (previous message) if Makefile doesn't work for you. The last step is quite simple, at least for me :) it's described in "Extra information" in my previous post. You can try to find the signatures by yourself using the youtube instruction or ask somebody to do it for you. You can ask me, but I need server* and engine* binary files for windows and linux v34 (server_srv.so/dll....)
Your game version will never be updated by valve, I would recommend you to rebuild SM once and for all, it's 2 steps easier :). Going this way you don't need signatures and writing C++ code.
Сообщение отредактировал Nail - Среда, 29.11.2017, 20:47:17 |
|
| |
AdabraIM
|
Дата: Четверг, 30.11.2017, 06:25:20 | Сообщение # 13 |
|
Сообщений: 32
Репутация: 0 [ +/- ]
|
|
Oh thanks for these Info !!! But I cant to this part of your tutorial!: You may block "sm" command as well, to unlock it edit this file sourcemod-master/core/smn_console.cpp. Comment all if-blocks with "sm" and reregister the command via smx script to whatever action you want. can you explain it a little more? Or would it be possible to do this part for me ?(sorry for my rudeness )
|
|
| |
Nail
|
Дата: Четверг, 30.11.2017, 08:42:16 | Сообщение # 14 |
|
Сообщений: 38
Репутация: 8 [ +/- ]
|
|
Put // in front of the lines as it's shown in my first post.
I've just remembered another way to solve your problem. It's a dirty hack, but takes a few minutes to implement. 1) Open the SM binary file via Winhex or any other hex editor 2) Find all occasions of "plugins" and replace to another set of symbols which only you would know (may be not all, but only one of them, check it out). The result alignment should stay the same. So you can only replace chars, but you can't add or delete them. You can make the word shorter by replacing one of the symbols to a line break '\0' that is 0x00 in hex.
You now have "70 6C 75 67 69 6E 73 00" for "plugins". To make it "plugin" replace 73 to 00: "70 6C 75 67 69 6E 00 00" You may try to clear the whole line by setting it to zeros, but most likely it will get broken for you as well. To make it "plug123" set this: "70 6C 75 67 31 32 33 00" ...you got the point. Yo can check it here: https://hexed.it or in your hex editor.
Сообщение отредактировал Nail - Четверг, 30.11.2017, 09:11:01 |
|
| |
|