関数 403b50

; send する
; void __thiscall
; ecx CConnection *
00403b50 51 push ecx
00403b51 53 push ebx
00403b52 56 push esi
00403b53 8bd9 mov ebx,ecx
00403b55 8b7348 mov esi,[ebx+0x48] ; esi <- CConnection.48( send length )
00403b58 85f6 test esi,esi
00403b5a 57 push edi
00403b5b 0f84f2000000 je image00400000+0x3c53 (00403c53) ; CConnection.48( send length ) == 0 -> return
00403b61 8bbb9c000000 mov edi,[ebx+0x9c] ; edi <- CConnection.9c( socket )
00403b67 85ff test edi,edi
00403b69 0f84e4000000 je image00400000+0x3c53 (00403c53) ; CConnection.9c( socket ) == 0 -> return
00403b6f 8a8389000000 mov al,[ebx+0x89] ; al <- CConnection.89
00403b75 84c0 test al,al
00403b77 7531 jnz image00400000+0x3baa (00403baa) ; CConnection.89 != 0 ->
00403b79 a10485ec00 mov eax,[image00400000+0xac8504 (00ec8504)]
00403b7e 8a88f5370000 mov cl,[eax+0x37f5]
00403b84 84c9 test cl,cl
00403b86 7422 jz image00400000+0x3baa (00403baa)
00403b88 8b881c040900 mov ecx,[eax+0x9041c]
00403b8e 83f901 cmp ecx,0x1 ; if( ecx < 1 )
00403b91 7d05 jge image00400000+0x3b98 (00403b98) ; ecx = 1;
00403b93 b901000000 mov ecx,0x1 ; ...
;
00403b98 8b80d0330000 mov eax,[eax+0x33d0]
00403b9e 6bc00f imul eax,eax,0xf ; eax = eax * 15 / ecx;
00403ba1 99 cdq ; ...
00403ba2 f7f9 idiv ecx ; ...
00403ba4 3bf0 cmp esi,eax ; if( esi > eax )
00403ba6 7e02 jle image00400000+0x3baa (00403baa) ; esi = eax;
00403ba8 8bf0 mov esi,eax ; ...
;
00403baa 8b4340 mov eax,[ebx+0x40] ; eax <- CConnection.40( send buffer )
00403bad 6a00 push 0x0 ; param flag
00403baf 56 push esi ; param length
00403bb0 50 push eax ; param buffer
00403bb1 57 push edi ; param socket
00403bb2 c7432c00000000 mov dword ptr [ebx+0x2c],0x0 ; CConnection.2c <- 0
00403bb9 ff1500964600 call dword ptr [image00400000+0x69600 (00469600)] ; send
00403bbf 85c0 test eax,eax
00403bc1 0f848c000000 je image00400000+0x3c53 (00403c53) ; send() == 0 -> return
00403bc7 83f8ff cmp eax,0xffffffff
00403bca 755b jnz image00400000+0x3c27 (00403c27) ; send() != SOCKET_ERROR ->
00403bcc ff1510964600 call dword ptr [image00400000+0x69610 (00469610)] ; WSAGetLastError
00403bd2 8bf0 mov esi,eax
00403bd4 81fe33270000 cmp esi,0x2733
00403bda 7477 jz image00400000+0x3c53 (00403c53) ; WSAEWOULDBLOCK -> return
00403bdc 81fe46270000 cmp esi,0x2746
00403be2 7435 jz image00400000+0x3c19 (00403c19) ; WSAECONNRESET
00403be4 81fe45270000 cmp esi,0x2745
00403bea 742d jz image00400000+0x3c19 (00403c19) ; WSAECONNABORTED
00403bec 81fe49270000 cmp esi,0x2749
00403bf2 7425 jz image00400000+0x3c19 (00403c19) ; WSAENOTCONN
00403bf4 51 push ecx
00403bf5 8bcc mov ecx,esp
00403bf7 89642410 mov [esp+0x10],esp
00403bfb 68409c4600 push 0x469c40 ; "send() 失敗"
00403c00 e88be3ffff call image00400000+0x1f90 (00401f90)
00403c05 e8260b0300 call image00400000+0x34730 (00434730)
00403c0a 8b0d0485ec00 mov ecx,[image00400000+0xac8504 (00ec8504)]
00403c10 83c404 add esp,0x4
00403c13 56 push esi
00403c14 e8b7420100 call image00400000+0x17ed0 (00417ed0) ; WSAGetLastError の戻り値を元に文字列を生成して何処かに出力する
;
00403c19 6a00 push 0x0
00403c1b 8bcb mov ecx,ebx
00403c1d e83e000000 call image00400000+0x3c60 (00403c60)
00403c22 5f pop edi
00403c23 5e pop esi
00403c24 5b pop ebx
00403c25 59 pop ecx
00403c26 c3 ret
; != SOCKET_ERROR
00403c27 85c0 test eax,eax
00403c29 7e28 jle image00400000+0x3c53 (00403c53) ; send() == 0 -> return ###### 意味無い
00403c2b 8b4b48 mov ecx,[ebx+0x48] ; ecx <- CConnection.48( send length )
00403c2e 8b7b40 mov edi,[ebx+0x40] ; edi <- CConnection.40( send buffer )
00403c31 2bc8 sub ecx,eax ; memcpy( this->send_buffer, this->send_buffer + sent_length, sent_length );
00403c33 8bd1 mov edx,ecx ; ...
00403c35 c1e902 shr ecx,0x2 ; ...
00403c38 8d3407 lea esi,[edi+eax] ; ...
00403c3b f3a5 rep movsd ; ...
00403c3d 8bca mov ecx,edx ; ...
00403c3f 83e103 and ecx,0x3 ; ...
00403c42 f3a4 rep movsb ; ... ###### memmove の方が安全な気がしないでも無い
00403c44 294348 sub [ebx+0x48],eax ; CConnection.48( send length ) -= sent_length
00403c47 8b0d0485ec00 mov ecx,[image00400000+0xac8504 (00ec8504)]
00403c4d 0181f4330000 add [ecx+0x33f4],eax ; 総送信バイト数?
;
00403c53 5f pop edi
00403c54 5e pop esi
00403c55 5b pop ebx
00403c56 59 pop ecx
00403c57 c3 ret