Garry's Mod

Garry's Mod

31 ratings
Find files in Workshop addons!
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Tool
File Size
Posted
Updated
2.619 KB
5 May, 2017 @ 10:16am
7 Jul, 2017 @ 2:19pm
8 Change Notes ( view )

Subscribe to download
Find files in Workshop addons!

In 2 collections by Cédric GÉRILLE [GiletJaune]
Dev Tests Mohamed
50 items
.bsp editing helpers
10 items
Description
This tool allows you to search for files in all GMA addons in your game or in your server.
It will browse subscribed as well as auto-downloaded addons!
Addons do not have to be mounted.
On Source dedicated servers, there must be at least 1 player for the search to proceed.
Warning: newly uploaded add-ons are stored outside of the Garry's Mod base folder, so they cannot be accessed from Lua. This means that the lookup will not happen in these add-ons.

Warning: This does not work for newer add-ons that are stored uncompressed in steamapps\workshop\content\4000\ (with the .gma extension), because they are out of reach from the filesystem accessible to Lua.

Instructions
Type find_file_in_gma in the console and read the instructions!

Using cases
- A file is contained in a Workshop addon but you do not know which.
- An addon has been removed from the Workshop and you need to find it, maybe to extract it.

Lua functions
find_file_in_gma.scanAddon( gmaName, toLower, maxHeaderSize, tableToFill, isFirst, shouldYield )
return : (table) table with found files, stored as theTable[fileName]=true gmaName : (string) path to .gma file relative to garrysmod/ folder (ignoring mounting) (optional arguments) toLower : (bool) convert filenames to lowercase maxHeaderSize: (number) bytes to read at the beginning of the .gma file tableToFill : (table) if provided, this is the table that will be filled with found files (arguments only for use in a coroutine) isFirst : (bool) true if single GMA or for the first element of a loop, false otherwise shouldYield : (bool) true if using a coroutine, false otherwise
15 Comments
Cédric GÉRILLE [GiletJaune]  [author] 11 May, 2017 @ 9:12am 
Absolutely, it is for what it is. :steammocking: Finding a file in more than 10 addons is still a hell with gmad.exe anyway.
Cédric GÉRILLE [GiletJaune]  [author] 11 May, 2017 @ 9:10am 
I join multiple servers, and my auto-download addons folder has 1800+ GMA files. So yeah, wanting to find a lost map, I definitely could not use gmad.exe.
Cédric GÉRILLE [GiletJaune]  [author] 11 May, 2017 @ 9:04am 
Not over 1900 addons just to find 1 single file, you dumb.
jahpeg 11 May, 2017 @ 6:26am 
You can just use gmad.exe.
Cédric GÉRILLE [GiletJaune]  [author] 9 May, 2017 @ 7:34pm 
It is supposed to be a genuine 404 error. :steammocking:
taro 9 May, 2017 @ 7:33pm 
Cool.
Btw, is your profile pic supposed to be a 404 icon?
Cédric GÉRILLE [GiletJaune]  [author] 9 May, 2017 @ 7:26pm 
:steamhappy: Well, it's complicated because it's always possible to kind of hide or obfuscate Lua code.
You just gave me an idea though: making a backdoor finder. Well, not really powerful, but I can capture HTTP requests, RCon password changes in Lua, access password changes in Lua.
taro 9 May, 2017 @ 7:04pm 
Is it possible for you to make a command that looks inside .luas and checks specific parts of the code w/regular expression so for example you can check if one of the addons you have installed gives special stuff to specific steam ids?
Or a command that shows all addons that contain scripts.
I know this makes me sound like I'm some paranoic retard that thinks that every addon in the workshop has a backdoor, but it would be a great addition to this nonetheless.

Anyways, thanks for making this, can't think of a use for it currently, but oh well
Cédric GÉRILLE [GiletJaune]  [author] 9 May, 2017 @ 3:36pm 
Thanks, I appreciate. :extralife:
Alphagen 9 May, 2017 @ 3:17pm 
-rep for the dev, racism lol.