一直不知到chrome是用什么函数发包的解决思路

一直不知到chrome是用什么函数发包的
有人能解答吗?困扰我长时间了
------解决思路----------------------
不太明白你啥意思,你是指发的网络包?
------解决思路----------------------
winapi,详见chrome->net->socketstream
------解决思路----------------------
引用:
winapi,详见chrome->net->socketstream


引用:
Quote: 引用:

不太明白你啥意思,你是指发的网络包?

对呀,你知道吗?

在Windows下,应该是用socket接口了。
------解决思路----------------------
应该就是socket
------解决思路----------------------
引用:
不是socket,不信你去跟踪一下...

除了socket还有别的可以用吗?这是开源的,看一眼代码不就知道了。
一直不知到chrome是用什么函数发包的解决思路
------解决思路----------------------
来位大神普及下有多少种发包方式。
------解决思路----------------------
不用socket那用什么了,linux,windows也好,网络通信都要用socket
------解决思路----------------------
引用:
那我为什么bp不了socket函数呢?bp send bp recv....chrome甚至都没有调用socket库。

我贴的代码没看到吗?而且socket就只有send,就没有sendto了?为什么就是不去看代码呢
int TCPClientSocketLibevent::InternalWrite(IOBuffer* buf, int buf_len) {
  int nwrite;
  if (use_tcp_fastopen_ && !tcp_fastopen_connected_) {
    // We have a limited amount of data to send in the SYN packet.
    int kMaxFastOpenSendLength = 1420;

    buf_len = std::min(kMaxFastOpenSendLength, buf_len);

    int flags = 0x20000000;  // Magic flag to enable TCP_FASTOPEN
    nwrite = HANDLE_EINTR(sendto(socket_,
                                 buf->data(),
                                 buf_len,
                                 flags,
                                 current_ai_->ai_addr,
                                 static_cast<int>(current_ai_->ai_addrlen)));
    tcp_fastopen_connected_ = true;

    if (nwrite < 0) {
      // Non-blocking mode is returning EINPROGRESS rather than EAGAIN.
      if (errno == EINPROGRESS)
         errno = EAGAIN;

      // Unlike "normal" nonblocking sockets, the data is already queued,
      // so tell the app that we've consumed it.
      return buf_len;
    }
  } else {
    nwrite = HANDLE_EINTR(write(socket_, buf->data(), buf_len));
  }
  return nwrite;
}

------解决思路----------------------

一直不知到chrome是用什么函数发包的解决思路
看好了,这是在最新代码上做的搜索

引用:
Quote: 引用:

Quote: 引用:

那我为什么bp不了socket函数呢?bp send bp recv....chrome甚至都没有调用socket库。

我贴的代码没看到吗?而且socket就只有send,就没有sendto了?为什么就是不去看代码呢
int TCPClientSocketLibevent::InternalWrite(IOBuffer* buf, int buf_len) {
  int nwrite;
  if (use_tcp_fastopen_ && !tcp_fastopen_connected_) {
    // We have a limited amount of data to send in the SYN packet.
    int kMaxFastOpenSendLength = 1420;

    buf_len = std::min(kMaxFastOpenSendLength, buf_len);

    int flags = 0x20000000;  // Magic flag to enable TCP_FASTOPEN
    nwrite = HANDLE_EINTR(sendto(socket_,
                                 buf->data(),
                                 buf_len,
                                 flags,
                                 current_ai_->ai_addr,
                                 static_cast<int>(current_ai_->ai_addrlen)));
    tcp_fastopen_connected_ = true;

    if (nwrite < 0) {
      // Non-blocking mode is returning EINPROGRESS rather than EAGAIN.
      if (errno == EINPROGRESS)
         errno = EAGAIN;

      // Unlike "normal" nonblocking sockets, the data is already queued,
      // so tell the app that we've consumed it.
      return buf_len;
    }
  } else {
    nwrite = HANDLE_EINTR(write(socket_, buf->data(), buf_len));
  }
  return nwrite;
}




这位大哥我看到了。
你的源码是不是最新版的?
去下载最新版的浏览器调试一下试试看到底有没有send。谢谢

------解决思路----------------------
引用:
Quote: 引用:

Quote: 引用:

那我为什么bp不了socket函数呢?bp send bp recv....chrome甚至都没有调用socket库。

我贴的代码没看到吗?而且socket就只有send,就没有sendto了?为什么就是不去看代码呢
int TCPClientSocketLibevent::InternalWrite(IOBuffer* buf, int buf_len) {
  int nwrite;
  if (use_tcp_fastopen_ && !tcp_fastopen_connected_) {
    // We have a limited amount of data to send in the SYN packet.
    int kMaxFastOpenSendLength = 1420;

    buf_len = std::min(kMaxFastOpenSendLength, buf_len);

    int flags = 0x20000000;  // Magic flag to enable TCP_FASTOPEN
    nwrite = HANDLE_EINTR(sendto(socket_,
                                 buf->data(),
                                 buf_len,
                                 flags,
                                 current_ai_->ai_addr,
                                 static_cast<int>(current_ai_->ai_addrlen)));
    tcp_fastopen_connected_ = true;

    if (nwrite < 0) {
      // Non-blocking mode is returning EINPROGRESS rather than EAGAIN.
      if (errno == EINPROGRESS)
         errno = EAGAIN;

      // Unlike "normal" nonblocking sockets, the data is already queued,
      // so tell the app that we've consumed it.
      return buf_len;
    }
  } else {
    nwrite = HANDLE_EINTR(write(socket_, buf->data(), buf_len));
  }
  return nwrite;
}




这位大哥我看到了。
你的源码是不是最新版的?
去下载最新版的浏览器调试一下试试看到底有没有send。谢谢



而且我说了,用的sendto不是send
------解决思路----------------------
windows平台下, 如果是应用层, 那么肯定只有一些windows api给你用如send, sendto,wsasend,WSASendto等, 别无它法.
如果ring0层, 那还有其它实现方式, 比如使用winpcap驱动等第三方驱动,或者自己实现的驱动来直接操作网卡发送.

------解决思路----------------------
引用:
Quote: 引用:

windows平台下, 如果是应用层, 那么肯定只有一些windows api给你用如send, sendto,wsasend,WSASendto等, 别无它法.
如果ring0层, 那还有其它实现方式, 比如使用winpcap驱动等第三方驱动,或者自己实现的驱动来直接操作网卡发送.



chrome好像也没有加载驱动啊,不过它的进程好多,每开一个跟随4、5个同名进程


前面都给出了源码了.  chrome就是使用的系统API得嘛, 你不能只bp send, 我上面说的函数你都下过断点吗.

chrome属性多进程浏览器, 所以每个页面, 扩展程序, flash等等都是独立进程运行, 以保证浏览器的稳定,
------解决思路----------------------
引用:
Quote: 引用:

Quote: 引用:

windows平台下, 如果是应用层, 那么肯定只有一些windows api给你用如send, sendto,wsasend,WSASendto等, 别无它法.
如果ring0层, 那还有其它实现方式, 比如使用winpcap驱动等第三方驱动,或者自己实现的驱动来直接操作网卡发送.



chrome好像也没有加载驱动啊,不过它的进程好多,每开一个跟随4、5个同名进程


前面都给出了源码了.  chrome就是使用的系统API得嘛, 你不能只bp send, 我上面说的函数你都下过断点吗.

chrome属性多进程浏览器, 所以每个页面, 扩展程序, flash等等都是独立进程运行, 以保证浏览器的稳定,


是的,只attach父进程是没用用的,chrome都是靠ipc来调用页面下载,渲染,甚至ui消息的