I have a Java based TCP Client that talks to our production server, which I'm re-writing. The client has the server's IP & port hard coded. What I want to be able to do is change just the IP address in the client to 127.0.0.1 & I can use the same port number on my dev box. Here's the rub, I don't have all the source code, so I can't just recompile it. The guy who wrote it hasn't worked here for about four years and while I have his hard drive, I haven't been able to find a compiled loop back client (even though I found partial source code for it) or even all the source code for the production client. I suspect he wrote his code on a network drive and it's been lost through the intervening years.
Is there some way for me to decompile the client and recompile with that change? Hex or binary edit (I have no skill at either, I've just seen it done)? Maybe WinRAR since my understanding is that .jar files are just zipped files? Or, is there some way I could trap the outgoing TCP traffic from the client & re-route it to my dev box? I can't take down the production server to test, and without a modified client it's going to be difficult to ensure I'm emulating the production server responses to the client.
I found this SO article: Decompile & recompile single file from jar, however I don't understand the difference between disassembly & decompiling, but I have found the utility JD mentioned there.