Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

Nmap

Questions and comments specific to a particular plugin should go here.
User avatar
topix
Experienced User
Posts: 441
Joined: Sat May 05, 2007 3:43 pm
Location: Germany
Contact:

Re: Nmap

Post by topix »

I've made the changes needed. Basically it's as simple as moving some lines. AddGrowableCol/AddGrowableRow has to be called after the widgets were added to the sizer. So instead of

Code: Select all

        Sizer = wx.GridBagSizer(5, 10)
        Sizer.AddGrowableCol(1)
        Sizer.AddGrowableRow(5, namedSizer.GetSize()[1])
        Sizer.AddGrowableRow(6, groupSizer.GetSize()[1])
        Sizer.Add(label_0, (0, 0), flag = wx.TOP|ACV)
        Sizer.Add(namedSizer, (5, 0),(1,2), flag = wx.EXPAND|wx.TOP|ACV)
        Sizer.Add(groupSizer, (6, 0),(1,2), flag = wx.EXPAND|wx.TOP|ACV)
it has to be

Code: Select all

        Sizer = wx.GridBagSizer(5, 10)
        Sizer.Add(label_0, (0, 0), flag = wx.TOP|ACV)
        Sizer.Add(namedSizer, (5, 0),(1,2), flag = wx.EXPAND|wx.TOP|ACV)
        Sizer.Add(groupSizer, (6, 0),(1,2), flag = wx.EXPAND|wx.TOP|ACV)
        Sizer.AddGrowableCol(1)
        Sizer.AddGrowableRow(5, namedSizer.GetSize()[1])
        Sizer.AddGrowableRow(6, groupSizer.GetSize()[1])
Attachments
__init__.py
Nmap plugin version 1.0.1 (same as 1.0 but with compatibility changes for EG 0.5)
(101.52 KiB) Downloaded 96 times
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: Nmap

Post by Pako »

topix wrote: Sat Nov 11, 2017 10:03 amI've made the changes needed.
Thank you for your support !

Pako
Tomkun
Posts: 22
Joined: Wed Sep 14, 2011 4:40 am

Re: Nmap

Post by Tomkun »

topix wrote: Sat Nov 11, 2017 10:03 am I've made the changes needed.
Works perfectly, thank you.

Edit:

Spoke too soon. Now the configuration dialog opens, but I am getting more errors.

Code: Select all

Error starting plugin: Nmap
Traceback (most recent call last) (0.5.0-rc4):
  File "H:\Home Theatre\EventGhost\eg\Classes\PluginInstanceInfo.py", line 192, in Start
    self.instance.__start__(*self.args)
  File "H:\Home Theatre\EventGhost\plugins\nMap\__init__.py", line 1652, in __start__
    if self.evtFilter[4]:
IndexError: list index out of range
User avatar
topix
Experienced User
Posts: 441
Joined: Sat May 05, 2007 3:43 pm
Location: Germany
Contact:

Re: Nmap

Post by topix »

I didn't had nmap installed and didn't click on all buttons :roll: but now it should do it's job. I installed nmap and did a short test with EG 0.4 and 0.5.
Attachments
__init__.py
Plugin: nmap 1.0.2
(fixes for EG 0.5)
(101.67 KiB) Downloaded 101 times
Tomkun
Posts: 22
Joined: Wed Sep 14, 2011 4:40 am

Re: Nmap

Post by Tomkun »

Thanks, but I'm still getting the exact same error with your new version.

Code: Select all

   Error starting plugin: Nmap
   Traceback (most recent call last) (0.5.0-rc4):
     File "H:\Home Theatre\EventGhost\eg\Classes\PluginInstanceInfo.py", line 192, in Start
       self.instance.__start__(*self.args)
     File "H:\Home Theatre\EventGhost\plugins\nMap\__init__.py", line 1652, in __start__
       if self.evtFilter[4]:
   IndexError: list index out of range
User avatar
topix
Experienced User
Posts: 441
Joined: Sat May 05, 2007 3:43 pm
Location: Germany
Contact:

Re: Nmap

Post by topix »

Hmm, strange. Can you remove the plugin from config tree, save config, restart EG and add the plugin again? If that doesn't help then replace lines 1652+1653 with this code:

Code: Select all

        try:
            if self.evtFilter[4]:
                self.TriggerEvent(self.text.dataUn)
        except IndexError:
            pass
Tomkun
Posts: 22
Joined: Wed Sep 14, 2011 4:40 am

Re: Nmap

Post by Tomkun »

I removed and reinstalled the plugin and it now works correctly. Unfortunately I lost all my configured devices and had to delete all the actions I had created with nMap, but at least now it works.

Thank you very much!
HTPCanwender
Experienced User
Posts: 89
Joined: Wed Feb 08, 2012 9:41 pm
Location: Germany

Re: Nmap

Post by HTPCanwender »

The Profile Manager does not open anymore. I get the following message:

17:53:53 Traceback (most recent call last) (WIP-2018.06.03-12.44.49):
17:53:53 File "wx\_core.pyc", line 16766, in <lambda>
17:53:53 File "C:\Program Files (x86)\EventGhost\plugins\Nmap\__init__.py", line 406, in ShowProfileDialog
17:53:53 max = 99,
17:53:53 File "C:\Program Files (x86)\EventGhost\eg\Classes\SpinIntCtrl.py", line 58, in __init__
17:53:53 **kwargs
17:53:53 File "C:\Program Files (x86)\EventGhost\eg\Classes\SpinNumCtrl.py", line 115, in __init__
17:53:53 raise MaxValueError(value, max_val)
17:53:53 MaxValueError: The set value 15 is higher then the maximum of 99

Is it a problem with the WIP Version of EG? I am using the Nmap plugin 1.02
User avatar
kgschlosser
Site Admin
Posts: 5190
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Nmap

Post by kgschlosser »

I will take a look at the plugin code as well as the spinnumctrl in EG and see what is going on. we have been fighting issues with this control to find the best possible way to handle problems with it. the problems are in the core of wxPython and a bug report was submitted 10 years ago about this problem and it is still not foxed even in the latest beta builds they have. every time we think we are good to go with the fix. it breaks something else we didn't account for.
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
Posts: 5190
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Nmap

Post by kgschlosser »

well this is a very very very strange issue

the lines of code that trigger that exception read as follows

Code: Select all

            if value > max_val:
                raise MaxValueError(value, max_val)


the set max value is 99 and the set value is 15. so according to this logic it should have never passed. Unless the data being passed is in fact not an integer but it is a string instead. which would be the fault of the plugin.

if you modify line 404 of the plugins __init__.py file from

Code: Select all

            data[0][1],

to

Code: Select all

            int(data[0][1]),

be sure to preserve the spacking before the text.
see if that solves the issue.
If you like the work I have been doing then feel free to Image
HTPCanwender
Experienced User
Posts: 89
Joined: Wed Feb 08, 2012 9:41 pm
Location: Germany

Re: Nmap

Post by HTPCanwender »

After replacing the variable for the security factor in line 404

data[0][1],
with
int(data[0][1]),

i got a similar message for the scanning period

06:42:49 Traceback (most recent call last) (WIP-2018.06.03-12.44.49):
06:42:49 File "wx\_core.pyc", line 16766, in <lambda>
06:42:49 File "C:\Program Files (x86)\EventGhost\plugins\Nmap\__init__.py", line 415, in ShowProfileDialog
06:42:49 max = 600,
06:42:49 File "C:\Program Files (x86)\EventGhost\eg\Classes\SpinIntCtrl.py", line 58, in __init__
06:42:49 **kwargs
06:42:49 File "C:\Program Files (x86)\EventGhost\eg\Classes\SpinNumCtrl.py", line 115, in __init__
06:42:49 raise MaxValueError(value, max_val)
06:42:49 MaxValueError: The set value 30 is higher then the maximum of 600

So I replaced in line 413

data[0][2],
with
int(data[0][2]),

Now the profile manager is ok. I have attached the modyfied plugin as version 1.0.3
Attachments
__init__.py
Nmap 1.0.3
(101.78 KiB) Downloaded 62 times
User avatar
kgschlosser
Site Admin
Posts: 5190
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Nmap

Post by kgschlosser »

check that out!

Good deal. I thought i was going mental with this SpinNumCtrl. Then again one would think that the author would be passing the proper data type to the SpinNumCtrl. The error didn't show before because the person that wrote the control was doing type conversions in it (which shouldn't be done) in order to work around a bug.

The issue with the way they did it was it would only fix the bug when using the eg.SpinNumCtrl and not if a user directly accessed the underlying control in wxPython. The correct way was to monkey patch the underlying control so it would work as advertised if it was used directly or through the use of eg.SpinNumCtrl. when topic2k and I put this into place we were able to remove all of the code in eg.SpinNumCtrl that was associated with working around the problem. I guess we removed a type conversion that was in that work around that allowed this plugin to work.

Sorry for the inconvenience. and TY for repairing the plugin and posting an updated version of it.
If you like the work I have been doing then feel free to Image
Tomkun
Posts: 22
Joined: Wed Sep 14, 2011 4:40 am

Re: Nmap

Post by Tomkun »

Would someone be kind enough to post a version that is working with the latest Eventghost and Windows 10? All the links are dead it seems.
User avatar
kgschlosser
Site Admin
Posts: 5190
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Nmap

Post by kgschlosser »

See if this will work for ya.
Attachments
Nmap-1.0.1.egplugin
(24.17 KiB) Downloaded 28 times
If you like the work I have been doing then feel free to Image
Tomkun
Posts: 22
Joined: Wed Sep 14, 2011 4:40 am

Re: Nmap

Post by Tomkun »

Thank you very much. I shall test it asap.
Post Reply