Hi, I write client&server on masm. But I have some question. How do I start the server in the background? Should I be using the CreateProcess function?

http://pastebin.com/jDucFXra

I opened my server in OllyDBG and saw that bind function returns FFFFFF...h (-1d), although the program does not issue an error.

Please help. Where's my error?
Posted on 2011-10-13 15:58:51 by Omenus
You can't use CreateProcess until you have an application running, which means you already have a process, lol.
No, there is no background, you just don't create, or don't SHOW, the application window on a windows OS. There is more, you can do networking via Services, but this is not what you asked, and let's keep it simple and make it work, then move on to something else huh.
Posted on 2011-10-14 06:13:59 by Homer
I forgot to ask why the server needs to be "invisible" in the first place, and didn't mention the tray or anything, I blame it on Friday.
And the bug? HTONS what that doing? and why? and what are you shoving?
Answer these to yourself the answer will stare you in the eye ok :)

Have a nice day :)
Posted on 2011-10-14 06:15:26 by Homer
Virus'/Trojans shouldn't be easily discovered, Homer.

C:\VirLog.txt ? poor choice...
Posted on 2011-10-14 06:26:25 by JimmyClif
No this don't virus. This just winsock example.
Ok Homer The htons - function converts a u_short from host to TCP/IP network byte order (which is big-endian).
http://msdn.microsoft.com/en-us/library/windows/desktop/ms738557%28v=vs.85%29.aspx

I want the program to not close after opening. And it closes because bind function returns an error (-1e) to register them. So I want to know why the port is not binded and where I was wrong.

C:\VirLog.txt

So funny)) :lol:
Posted on 2011-10-14 14:29:44 by Omenus
Posted on 2011-10-14 14:43:27 by Omenus
Most professional programmers I know use either Windbg for Windows or gdb on Linux.  Not a knock again Oleh ( a very talented individual ) or his debugger but whenever I see a newly registered user on this forum discussing his debugger usage the first thing that comes to mind is wannabe newbie cracker...  Maybe it's just me...
Posted on 2011-10-14 20:11:39 by p1ranha
No choice of debugger private matter. Windbg Softice or IDA or what's the difference than to debug your program.
Posted on 2011-10-15 00:44:26 by Omenus
I repeat, the problem is how you are storing the result from htons !!
I can't help you more without knowing more about your intended application.
Posted on 2011-10-15 04:06:32 by Homer
Ok Homer The htons - function converts a u_short from host to TCP/IP network byte order (which is big-endian).
http://msdn.microsoft.com/en-us/library/windows/desktop/ms738557%28v=vs.85%29.aspx


I repeated
Posted on 2011-10-15 13:38:25 by Omenus
Sorry but as a right? :shock:
??
Thats right :
invoke htons, 5000


But port don't binded ..... And Error WSAENOTSOCK.
Posted on 2011-10-15 16:12:58 by Omenus
Thats because you stored a 16 bit value using a 32 bit register(!) and trashed the socketaddress structure.
Posted on 2011-10-15 17:55:07 by Homer
Thanks Homer. I am finished my program! This be very hard!! 8) 8)
Posted on 2011-10-17 13:09:50 by Omenus
Everything is hard until you do it once.
Then it is easy.
Strange, but true.
Posted on 2011-11-03 02:32:20 by Homer