関数 428db0 2

; WM_USER のメッセージハンドラ( 主に WSAAsyncSelect 関係 )
; 呼び出し元は MFC っぽい
; void __thiscall
; ecx CConnections *
; @1 message( >= 1024 )
; @2 wparam
; @3 lparam
00428db0 55 push ebp
00428db1 8be9 mov ebp,ecx
00428db3 8b4c2408 mov ecx,[esp+0x8]
00428db7 81e900040000 sub ecx,0x400
00428dbd 894c2408 mov [esp+0x8],ecx
00428dc1 0f84f8000000 je image00400000+0x28ebf (00428ebf) ; @1 == 1024 -> 何もせずリターン
00428dc7 83f901 cmp ecx,0x1
00428dca 7515 jnz image00400000+0x28de1 (00428de1) ; @1 != 1025 ->
00428dcc 8b442410 mov eax,[esp+0x10]
00428dd0 8b4c240c mov ecx,[esp+0xc]
00428dd4 50 push eax
00428dd5 51 push ecx
00428dd6 8bcd mov ecx,ebp
00428dd8 e8631dffff call image00400000+0x1ab40 (0041ab40) ; ecx->xxx( @2, @3 );
00428ddd 5d pop ebp
00428dde c20c00 ret 0xc
; @1 != 1025
00428de1 83f902 cmp ecx,0x2
00428de4 7515 jnz image00400000+0x28dfb (00428dfb) ; @1 != 1026 ->
00428de6 8b542410 mov edx,[esp+0x10]
00428dea 8b44240c mov eax,[esp+0xc]
00428dee 52 push edx
00428def 50 push eax
00428df0 8bcd mov ecx,ebp
00428df2 e849dcffff call image00400000+0x26a40 (00426a40) ; ecx->xxx( @2, @3 );
00428df7 5d pop ebp
00428df8 c20c00 ret 0xc
; @1 != 1026
00428dfb 53 push ebx
00428dfc 8b5c2414 mov ebx,[esp+0x14] ; ebx <- @3
00428e00 56 push esi
00428e01 57 push edi
00428e02 33ff xor edi,edi
00428e04 8db508bc0000 lea esi,[ebp+0xbc08] ; CConnection の配列 + 1c
00428e0a eb04 jmp image00400000+0x28e10 (00428e10)
; 500 回繰り返す
00428e0c 8b4c2414 mov ecx,[esp+0x14] ; ecx <- ( @1 - 1024 )
;
00428e10 8a4671 mov al,[esi+0x71] ; al <- CConnection.8d
00428e13 84c0 test al,al
00428e15 0f848e000000 je image00400000+0x28ea9 (00428ea9)
00428e1b 8a466d mov al,[esi+0x6d] ; al <- CConnection.89
00428e1e 84c0 test al,al
00428e20 8b06 mov eax,[esi] ; eax <- CConnection.1c
00428e22 7409 jz image00400000+0x28e2d (00428e2d)
00428e24 8d8440e9030000 lea eax,[eax+eax*2+0x3e9] ; eax = eax * 3 + 1001
00428e2b eb04 jmp image00400000+0x28e31 (00428e31)
;
00428e2d 8d444001 lea eax,[eax+eax*2+0x1] ; eax = eax * 3 + 1
;
00428e31 3bc8 cmp ecx,eax
00428e33 750e jnz image00400000+0x28e43 (00428e43)
00428e35 8b4c2418 mov ecx,[esp+0x18] ; param...
00428e39 53 push ebx ; param...
00428e3a 51 push ecx ; param...
00428e3b 57 push edi ; param...
00428e3c 8bcd mov ecx,ebp ; param...
00428e3e e89d19ffff call image00400000+0x1a7e0 (0041a7e0) ; ecx( CConnections )->xxx( インデックス( 0..499 ), @2, @3 );
;
00428e43 8a466d mov al,[esi+0x6d] ; al <- CConnection.89
00428e46 84c0 test al,al
00428e48 8b06 mov eax,[esi] ; eax <- CConnection.1c
00428e4a 740a jz image00400000+0x28e56 (00428e56)
00428e4c 054e010000 add eax,0x14e ; eax = ( eax + 334 ) * 3
00428e51 8d0440 lea eax,[eax+eax*2] ; ...
00428e54 eb04 jmp image00400000+0x28e5a (00428e5a)
;
00428e56 8d444002 lea eax,[eax+eax*2+0x2] ; eax = eax * 3 + 2
;
00428e5a 39442414 cmp [esp+0x14],eax ; ( @1 - 1024 ) != eax
00428e5e 750e jnz image00400000+0x28e6e (00428e6e) ; ... ->
00428e60 8b542418 mov edx,[esp+0x18] ; param...
00428e64 53 push ebx ; param...
00428e65 52 push edx ; param...
00428e66 8d4ee4 lea ecx,[esi-0x1c] ; ecx( CConnection )->xxx( @2, @3 );
00428e69 e8f2aefdff call image00400000+0x3d60 (00403d60)
;
00428e6e 8a466d mov al,[esi+0x6d] ; al <- CConnection.89
00428e71 84c0 test al,al
00428e73 8b06 mov eax,[esi] ; eax <- CConnection.1c
00428e75 7409 jz image00400000+0x28e80 (00428e80)
00428e77 8d8440e8030000 lea eax,[eax+eax*2+0x3e8] ; eax = eax * 3 + 1000
00428e7e eb03 jmp image00400000+0x28e83 (00428e83)
;
00428e80 8d0440 lea eax,[eax+eax*2] ; eax *= 3
;
00428e83 39442414 cmp [esp+0x14],eax ; ( @1 - 1024 ) != eax
00428e87 7520 jnz image00400000+0x28ea9 (00428ea9) ; ... ->
00428e89 6683fb02 cmp bx,0x2 ; LOWORD( @3 ) != 2
00428e8d 750a jnz image00400000+0x28e99 (00428e99) ; ... ->
00428e8f 8d4ee4 lea ecx,[esi-0x1c] ; param...
00428e92 e8b9acfdff call image00400000+0x3b50 (00403b50) ; ecx( CConnection )->xxx();
00428e97 eb10 jmp image00400000+0x28ea9 (00428ea9)
;
00428e99 8a4664 mov al,[esi+0x64] ; al <- CConnection.80
00428e9c 84c0 test al,al
00428e9e 7509 jnz image00400000+0x28ea9 (00428ea9)
00428ea0 53 push ebx ; param...
00428ea1 57 push edi ; param...
00428ea2 8bcd mov ecx,ebp ; param...
00428ea4 e87721ffff call image00400000+0x1b020 (0041b020) ; ecx( CConnections )->recv する( インデックス( 0..499 ), @3 );
;
00428ea9 47 inc edi
00428eaa 81c628040000 add esi,0x428 ; 1064
00428eb0 81fff4010000 cmp edi,0x1f4
00428eb6 0f8c50ffffff jl image00400000+0x28e0c (00428e0c) ; 500 回繰り返す
00428ebc 5f pop edi
00428ebd 5e pop esi
00428ebe 5b pop ebx
; @1 == 1024
00428ebf 5d pop ebp
00428ec0 c20c00 ret 0xc

void __thiscall CConnections::WM_USER( unsigned long message, unsigned long wparam, unsigned long lparam )
{
unsigned long i, j;
CConnection *pC;

message -= 1024;

switch( message )
{
case 0 :
return;
case 1 :
this->41ab40( wparam, lparam );
return;
case 2 :
this->426a40( wparam, lparam );
return;
}

for( i = 0, pC = this->pCs; i != 500; i++, pC++ )
if( pC->8d )
{
if( pC->89 )
j = pC->1c * 3 + 1001; // 1010, 1013, 1016, ...
else
j = pC->1c * 3 + 1; // 10, 13, 16, ...

if( message == j )
this->41a7e0( i, wparam, lparam );

if( pC->89 )
j = ( pC->1c + 334 ) * 3; // 1011, 1014, 1017, ...
else
j = pC->1c * 3 + 2; // 11, 14, 17, ...

if( message == j )
pC->403d60( wparam, lparam );

if( pC->89 )
j = pC->1c * 3 + 1000; // 1009, 1012, 1015, ...
else
j = pC->1c * 3; // 9, 12, 15, ...

if( message == j )
if( LOWORD( lparam ) == 2 ) // FD_WRITE
pC->403b50();
else if( !pC->80 )
this->41b020( i, lparam ); // recv
}
}