Is there any LUA API available through which i can get information like where Wireshark is installed in my machine, Which version of wireshark installed etc. from registry or from anwhere? I need it because i have developed my own plugin in lua and i am using wireshark installed path upto C:\ProgramFiles\Wireshark in to that plugin. asked 07 Jul '15, 20:41 ankit |
One Answer:
The Wireshark version you can get through the global function " I don't believe there's a way to get the Wireshark path directly/only, but it's likely the first portion of the string returned with the global function " But why do you need the path exactly? I ask because if there's some good reason, then we can add it into the Lua API. Usually, though, people don't need it for Lua plugins. answered 07 Jul '15, 22:22 Hadriel I developed my whole plugin in structured way grouped some files into some folders and to traverse that folders i added dofile("path_to_wireshark_folder.."myfile.lua") in my_plugin_main.lua file. It is working fine with my environment. because i have manually given path_to_wireshark_folder = "C:\ProgramFiles\Wireshark" in my_plugin_main.lua But Now, I need to generalize this plugin so that it can run in any person's machine and todo that i need the wireshark installation path where wireshark is installed into other person's enviornment. (07 Jul '15, 22:57) ankit You shouldn't need to do that. Are they Lua modules? Or are they stand-alone scripts? How are you loading your main Lua file? Through (07 Jul '15, 23:39) Hadriel it is foolish to ask but i am unable to use existing global functions.I tried to use as mentioned in below image and I am getting error like "attempt to index global 'Dir'(nil value) If something is wrong can anyone tell me how to use global functions? (08 Jul '15, 00:05) ankit It's not a global function of Lua the language - it's a global function within Wireshark's Lua environment. So using ZeroBraneStudio to run the Lua script won't work. (08 Jul '15, 07:16) Hadriel I suppose I should mention this requires running Wireshark 1.12.x or 1.99.x. The (08 Jul '15, 09:48) Hadriel my main.lua file is under C:\ProgramFiles\Wireshark\plugin\1.12.6\ directory and my code is under C:\Programfiles\Wireshark\MYLUA ... under MYLUA folder there are some subfolder into which there are some lua scripts so to call this scripts from my_main.lua i did dofile(...) and as you suggested for Dir.global_config_path() It is working fine. thanks @hadriel (09 Jul '15, 01:55) ankit showing 5 of 6 show 1 more comments |
I.e., you want the installation directory of Wireshark? What would your Lua plugin use this for?