From: brutus <mad...@gm...> - 2003-10-15 22:43:45
|
hello all. some time ago someone asks for winsock examples, so i tried to port some of my old tasm code to nasm, but i cant't manage to get it working. as far as i noticed i've got at least 3 problems: * 01 * while debuging, OllyDbg[1] remarks that my entry point is outside the codesegment and complains about beeing outside the code segment when i set breakpoints. don't know what this is all about. seems that everything works fine none the less. i got the same errors with a small hello-world-box program, i wrote to test this. * 02 * another strange one: the message box that is used to display the error messages don't have a titlebar or border or anything. just a grey background the text and the ok button. this happens no matter, which position in the code the message box is called. if i use a wrong ip addresse to generate an error f.e. the message box is also displayed this wired way. * 03 * the connect call returns -1 (SOCKET_ERROR) to indicate an error. WSAGetLastError() returns 0x271E (10014d) = WSAEFAULT(win), EFAULT(bsd) and i realy don't know why. judging by the return values and the OllyDbg sessions, the initializing of WSA, the socket creation and the setting of the sockaddr_in structure are working fine. here's a dump of the sockaddr_in structure: ... 0040218A 00 00 00 00 4C 00 00 00 ....L... 00402192 02 00 00 07 7F 00 00 01 .... 0040219A 00 00 00 00 00 00 00 00 ........ 004021A2 00 00 00 00 00 00 00 00 ........ ... 0040218E = socket handle 0000 004C 00402192 = sockaddr_in structure word: addresse family, word: port, dword: ip (127.0.0.1) and 8 zero bytes i work under winxp and use nasm -f obj echoclient.asm to assemble and alink -c -oPE echoclient.obj to link. so, hope to hear from you guys/gals. later brutus [1] http://home.t-online.de/home/Ollydbg/ |