Hi all, i am writing a Wireshark listener in Lua which needs to process a XML file before registering the listener. For parsing the XML file I used LuaExpat (lxp) and tried the parsing functionality in the Lua interpreter 1 which runs fine. Unfortunately, when Wireshark tries to execute the script it fails:
I am running Wireshark version 1.10 on Windows 7 64bit. Any ideas? Thanks! Jonas asked 16 Sep '13, 05:41 johannes24 |
One Answer:
Get a copy of lxp.dll from the link below.
Then copy lxp.dll to the directory C:\Program Files\Wireshark\, or any of the other directories where Wireshark tried to find it (see your output above). UPDATE These are your options:
Regards answered 16 Sep '13, 06:36 Kurt Knochner ♦ edited 17 Sep '13, 03:23 showing 5 of 11 show 6 more comments |
Hi Kurt, thanks for your reply. I tried your suggestion but unfortunately Wireshak can't execute my script:
tshark: Lua: Error during loading: error loading module 'lxp' from file '.\lxp.dll': %1 ist keine zulΣssige Win32-Anwendung.
In case you don't understand German, it means: %1 is not a valid Win32 application.
Do you have any further ideas? Thanks!
I also tried setting the environment variables LUA_PATH and LUA_CPATHS like my Lua interpreter shows their values:
But this results in the same error like copying lxp.dll to the wireshark directory.
Unfortunately, I don't have an answer yet. But maybe this is a 32/64bit problem?
The Lua interpreter I used is from 1. Thanks, Jo
Never mind, I was able to read it (I'm from Munich) ;-)
However, I don't know why it rejects the DLL. Can you please post a small lua script that makes use of the library? I will then try to run it on my system.
Could well be.
--sample.lua
do local lxp = require("lxp") -- crashes
local function init_listener() local tap = Listener.new(nil, "eth")
end
-- Initialize the listener init_listener() end -- do
Afterwards, I run the above Lua script using either tshark or wireshark:
tshark.exe -i 1 -q -Xlua_script:sample.lua
it works on WinXP 32 Bit. It fails to load the DLL on Win7 64Bit.
If you load the DLL into Dependency Walker, you'll find that it's a 32 Bit DLL.
So, if you want to use that library in a 64 Bit OS (and/or Wireshark), you need a 64 Bit version of the DLL or create one yourself.
Maybe it helps to install a 32 Bit version of Wireshark on your 64 Bit OS. I have not tried that.
The bittedness of the DLL must match the bittedness of Wireshark. You can only run 32 bit apps on a 32 bit OS, you can user either on a 64 bit OS, but DLL's must match the program that's loading them.
32 bit Wireshark runs perfectly well on a 64 bit OS.
I did not know that this feature/characteristic was called bittedness. Do you know where that comes from?
I think I made it up :-) Or I might have come across it somewhere else, anyway that's the term we use in my day job.
Ok, thank you all for your help and suggestions. I just switched to the 32bit version of Wireshark and all works fine.
Thanks again for troubleshooting! Have a nice day! Jo
@johannes24, if an answer has solved your issue, please accept the answer for the benefit of other users by clicking the checkmark icon next to the answer. Please read the FAQ for more information.