rapid7/meterpreter — pull request #56 by OJ (2013-11-25 07:12:10+00:00)
Title: Command dispatcher fixes, code tidying, POSIX tweaks and more

Sorry about the size of this PR. There's a lot of general reformatting and stuff in here. I was doing it while researching POSIX bugs in particular.

This PR contains an important fix for the way that command overloading is handled. I believe this resolves issues with things such as port forwarding and route handling, particularly on Windows. There are still known issues with POSIX, but that's for ongoing investigations.

PR highlights:

* Fixing of command overloads. This means that overloaded commands still get run first before before the overloads.
* Changed the POSIX macros to `break` instead of `abort` or `exit`. In the words of @jlee-r7 "I can't be any worse". This was killing things in a few cases such as attempting to bind to address that aren't present on the box.
* Default to `0.0.0.0` when failing to bind to the specified IP.

The big thing is the port forwarding and routing now works in windows. Give it a crack!