How to change socket bind port of program? without source code.

Posted by hunmr on Stack Overflow See other posts from Stack Overflow or by hunmr
Published on 2011-01-01T05:46:14Z Indexed on 2011/01/01 5:53 UTC
Read the original article Hit count: 198

Filed under:
|
|
|

Hello everyone,

PROBLEM:

I have a program dummy.exe on windows. this program will bind to UDP port 5060, after started. but another program also want to bind port 5060.

WHAT I HAVE DONE:

  1. using windbg to start dummy.exe, and set breakpoint on ws2_32!bind
  2. when the breakpoint hit, i changed the parameter (port value) with command ew
  3. this dummy.exe will bind to the new port, and worked well.

QUESTION:

How can i do that easily? write a simple windows debugger?

Maybe i can hacking or modify the dummy.exe file, but how to do that?

what's your way to achieve this?

thanks

© Stack Overflow or respective owner

Related posts about Windows

Related posts about sockets