Raised This Month: $51 Target: $400
 12% 

[CS:GO] File Upload/Download Protect [UPDATED 02.14.2013]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Zephyrus
Cool Pig B)
Join Date: Jun 2010
Location: Hungary
Old 10-28-2012 , 06:52   [CS:GO] File Upload/Download Protect [UPDATED 02.14.2013]
Reply With Quote #1

NOT NEEDED ANYMORE

Example output:



Install:
-Download the binary according to your platform and place it in your extensions folder
-Download the .txt and place it in your gamedata
-Create a blank file called fileprotect.autoload in your extensions folder

It won't tell you who uploaded the file (altho with more reverse-engineering I may be able to come up with a method to tell that) but at least it will protect against uploads and also log the blocked files. After spending hours this seemed to be the best way to do it as there's no function BEFORE the file is put in it's correct location to tell it's final path.

Credit goes to AzuiSleet for the IsValidFile function.

Changelog:
2012.10.28
-Code cleanup (already...), older version still works
2012.10.29
-Added protection against file downloads
2013.02.14
-Updated gamedata thanks to Peace-Maker
Attached Files
File Type: zip fileprotect_src.zip (10.0 KB, 920 views)
File Type: dll fileprotect.ext.2.csgo.dll (80.5 KB, 692 views)
File Type: so fileprotect.ext.2.csgo.so (190.0 KB, 869 views)
File Type: txt fileprotect.txt (789 Bytes, 770 views)
__________________
Taking private C++/PHP/SourcePawn requests, PM me.

Last edited by Zephyrus; 09-20-2013 at 07:21.
Zephyrus is offline
Zephyrus
Cool Pig B)
Join Date: Jun 2010
Location: Hungary
Old 10-28-2012 , 07:07   Re: [CS:GO] File Upload/Download Protect
Reply With Quote #2

-Reserved-
__________________
Taking private C++/PHP/SourcePawn requests, PM me.

Last edited by Zephyrus; 10-28-2012 at 07:25.
Zephyrus is offline
Zephyrus
Cool Pig B)
Join Date: Jun 2010
Location: Hungary
Old 10-29-2012 , 17:59   Re: [CS:GO] File Upload/Download Protect [UPDATED 10.29.2012]
Reply With Quote #3

The extension is considered done for now and fully working. By detouring CGameClient::FileRequested I would be able to tell who tried to download a specific file although unless I come up with something for uploads I won't do that.
__________________
Taking private C++/PHP/SourcePawn requests, PM me.
Zephyrus is offline
Century19
Junior Member
Join Date: Sep 2012
Old 10-30-2012 , 08:00   Re: [CS:GO] File Upload/Download Protect [UPDATED 10.29.2012]
Reply With Quote #4

AWESOME !!

Works flawlessly! Thank you so much
Century19 is offline
Sheepdude
SourceMod Donor
Join Date: Aug 2012
Location: Chicago
Old 10-31-2012 , 19:40   Re: [CS:GO] File Upload/Download Protect [UPDATED 10.29.2012]
Reply With Quote #5

Nice! It seems to work with CS:GO, although my logs are getting spammed with this message:

L 10/31/2012 - 11:10:10: [FileProtect] Downloading file 'downloads/1ab72a88.dat' has been blocked.
__________________
Sheepdude is offline
Zephyrus
Cool Pig B)
Join Date: Jun 2010
Location: Hungary
Old 11-01-2012 , 06:58   Re: [CS:GO] File Upload/Download Protect [UPDATED 10.29.2012]
Reply With Quote #6

Quote:
Originally Posted by Sheepdude View Post
Nice! It seems to work with CS:GO, although my logs are getting spammed with this message:

L 10/31/2012 - 11:10:10: [FileProtect] Downloading file 'downloads/1ab72a88.dat' has been blocked.
i will look into it altho this line:

PHP Code:
(len == 22 && strncmp(filename"downloads/"10) == && strncmp(filename len 4".dat"4) == 0
should allow such files rather than blocking them
__________________
Taking private C++/PHP/SourcePawn requests, PM me.
Zephyrus is offline
Sheepdude
SourceMod Donor
Join Date: Aug 2012
Location: Chicago
Old 11-01-2012 , 13:43   Re: [CS:GO] File Upload/Download Protect [UPDATED 10.29.2012]
Reply With Quote #7

Quote:
Originally Posted by Zephyrus View Post
i will look into it altho this line:

PHP Code:
(len == 22 && strncmp(filename"downloads/"10) == && [color=red]strncmp(filename len 4".dat"4) == 0)[/color
should allow such files rather than blocking them
I don't know the programming syntax, but for strncmp(filename + len - 4, ".dat", 4) == 0), shouldn't you use a substring compare instead? (i.e. strncmp(filename.substr(len - 4), ".dat", 4) == 0). Unless you're certain that "filename + len - 4" should return the last 4 characters of the filename string.
__________________

Last edited by Sheepdude; 11-01-2012 at 13:46.
Sheepdude is offline
Zephyrus
Cool Pig B)
Join Date: Jun 2010
Location: Hungary
Old 11-01-2012 , 14:00   Re: [CS:GO] File Upload/Download Protect [UPDATED 10.29.2012]
Reply With Quote #8

Quote:
Originally Posted by Sheepdude View Post
I don't know the programming syntax, but for strncmp(filename + len - 4, ".dat", 4) == 0), shouldn't you use a substring compare instead? (i.e. strncmp(filename.substr(len - 4), ".dat", 4) == 0). Unless you're certain that "filename + len - 4" should return the last 4 characters of the filename string.
strncmp takes a char pointer, filename is a char pointer as well, filename + len is the pointer to the null terminator and -4 should point to the dot character

btw i will check it out hopefully today, i just installed windows 8 and still have to download and install visual studio etc
__________________
Taking private C++/PHP/SourcePawn requests, PM me.

Last edited by Zephyrus; 11-01-2012 at 14:01.
Zephyrus is offline
Sheepdude
SourceMod Donor
Join Date: Aug 2012
Location: Chicago
Old 11-01-2012 , 14:12   Re: [CS:GO] File Upload/Download Protect [UPDATED 10.29.2012]
Reply With Quote #9

Ohh yes that makes a lot more sense now. Well if it's any help, the only file showing up in the logs as blocked is downloads/1ab72a88.dat, and not any of the other .dat files.
__________________
Sheepdude is offline
Sheepdude
SourceMod Donor
Join Date: Aug 2012
Location: Chicago
Old 02-04-2013 , 14:27   Re: [CS:GO] File Upload/Download Protect [UPDATED 10.29.2012]
Reply With Quote #10

This extension no longer works after the 1/23 cs:go update.

Code:
L 01/30/2013 - 20:57:25: SourceMod error session started
L 01/30/2013 - 20:57:25: Info (map "ar_lego_arena") (file "errors_20130130.log")
L 01/30/2013 - 20:57:25: [SM] Unable to load extension "fileprotect.ext": Failed to locate CheckReceivingList function.
L 01/30/2013 - 21:54:35: Error log file session closed.
__________________
Sheepdude is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:17.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode