関数 417ed0

しょぼい関数から攻めてくよ。今回は pre タグ使うと変な事になるので使いません。横に長過ぎるらしい。
; WSAGetLastError の戻り値を元に文字列を生成して何処かに出力する
; void __stdcall
; @1 WSAGetLastError の戻り値
00417ed0 8b4c2404 mov ecx,[esp+0x4] ; ecx <- @1
00417ed4 8d81ecd8ffff lea eax,[ecx-0x2714] ; eax = ecx - 10004
00417eda 81ec04010000 sub esp,0x104
00417ee0 83f859 cmp eax,0x59
00417ee3 0f873c010000 jnbe image00400000+0x18025 (00418025) ; eax > 89 -> default
00417ee9 0fb680ac804100 movzx eax,byte ptr [eax+0x4180ac]
00417ef0 ff24855c804100 jmp dword ptr [image00400000+0x1805c (0041805c)+eax*4]
; 10093 WSANOTINITIALISED
00417ef7 51 push ecx
00417ef8 8bcc mov ecx,esp
00417efa 89642404 mov [esp+0x4],esp
00417efe 6890af4600 push 0x46af90 ; "WSANOTINITIALISED: A successful WSAStartup call must occur before using this function. "
00417f03 e93b010000 jmp image00400000+0x18043 (00418043)
; 10050 WSAENETDOWN
00417f08 51 push ecx
00417f09 8bcc mov ecx,esp
00417f0b 89642404 mov [esp+0x4],esp
00417f0f 681cac4600 push 0x46ac1c ; "WSAENETDOWN: The network subsystem has failed. "
00417f14 e92a010000 jmp image00400000+0x18043 (00418043)
; 10013 WSAEACCES
00417f19 51 push ecx
00417f1a 8bcc mov ecx,esp
00417f1c 89642404 mov [esp+0x4],esp
00417f20 6858c94600 push 0x46c958 ; "WSAEACCES: The requested address is a broadcast address, but the appropriate flag was not set. Call setsockopt with the SO_BROADCAST parameter to allow the use of the broadcast address. "
00417f25 e919010000 jmp image00400000+0x18043 (00418043)
; 10004 WSAEINTR
00417f2a 51 push ecx
00417f2b 8bcc mov ecx,esp
00417f2d 89642404 mov [esp+0x4],esp
00417f31 68c0b64600 push 0x46b6c0 ; "WSAEINTR: A blocking Windows Sockets 1.1 call was canceled through WSACancelBlockingCall. "
00417f36 e908010000 jmp image00400000+0x18043 (00418043)
; 10036 WSAEINPROGRESS
00417f3b 51 push ecx
00417f3c 8bcc mov ecx,esp
00417f3e 89642404 mov [esp+0x4],esp
00417f42 6808af4600 push 0x46af08 ; "WSAEINPROGRESS: A blocking Windows Sockets 1.1 call is in progress, or the service provider is still processing a callback function. "
00417f47 e9f7000000 jmp image00400000+0x18043 (00418043)
; 10014 WSAEFAULT
00417f4c 51 push ecx
00417f4d 8bcc mov ecx,esp
00417f4f 89642404 mov [esp+0x4],esp
00417f53 68b8c34600 push 0x46c3b8 ; "WSAEFAULT: The buf parameter is not completely contained in a valid part of the user address space. "
00417f58 e9e6000000 jmp image00400000+0x18043 (00418043)
; 10052 WSAENETRESET
00417f5d 51 push ecx
00417f5e 8bcc mov ecx,esp
00417f60 89642404 mov [esp+0x4],esp
00417f64 68e0c24600 push 0x46c2e0 ; "WSAENETRESET: The connection has been broken due to the keep-alive activity detecting a failure while the operation was in progress. "
00417f69 e9d5000000 jmp image00400000+0x18043 (00418043)
; 10055 WSAENOBUFS
00417f6e 51 push ecx
00417f6f 8bcc mov ecx,esp
00417f71 89642404 mov [esp+0x4],esp
00417f75 68e8b54600 push 0x46b5e8 ; "WSAENOBUFS: No buffer space is available. "
00417f7a e9c4000000 jmp image00400000+0x18043 (00418043)
; 10057 WSAENOTCONN
00417f7f 51 push ecx
00417f80 8bcc mov ecx,esp
00417f82 89642404 mov [esp+0x4],esp
00417f86 68a0ac4600 push 0x46aca0 ; "WSAENOTCONN: The socket is not connected. "
00417f8b e9b3000000 jmp image00400000+0x18043 (00418043)
; 10038 WSAENOTSOCK
00417f90 51 push ecx
00417f91 8bcc mov ecx,esp
00417f93 89642404 mov [esp+0x4],esp
00417f97 68d4ae4600 push 0x46aed4 ; "WSAENOTSOCK: The descriptor is not a socket. "
00417f9c e9a2000000 jmp image00400000+0x18043 (00418043)
; 10045 WSAEOPNOTSUPP
00417fa1 51 push ecx
00417fa2 8bcc mov ecx,esp
00417fa4 89642404 mov [esp+0x4],esp
00417fa8 6858c84600 push 0x46c858 ; "WSAEOPNOTSUPP: MSG_OOB was specified, but the socket is not stream-style such as type SOCK_STREAM, OOB data is not supported in the communication domain associated with this socket, or the socket is unidirectional and supports only receive operations. "
00417fad e991000000 jmp image00400000+0x18043 (00418043)
; 10058 WSAESHUTDOWN
00417fb2 51 push ecx
00417fb3 8bcc mov ecx,esp
00417fb5 89642404 mov [esp+0x4],esp
00417fb9 68b8c74600 push 0x46c7b8 ; "WSAESHUTDOWN: The socket has been shut down; it is not possible to send on a socket after shutdown has been invoked with how set to SD_SEND or SD_BOTH. "
00417fbe e980000000 jmp image00400000+0x18043 (00418043)
; 10035 WSAEWOULDBLOCK
00417fc3 51 push ecx
00417fc4 8bcc mov ecx,esp
00417fc6 89642404 mov [esp+0x4],esp
00417fca 6858c74600 push 0x46c758 ; "WSAEWOULDBLOCK: The socket is marked as nonblocking and the requested operation would block. "
00417fcf eb72 jmp image00400000+0x18043 (00418043)
; 10040 WSAEMSGSIZE
00417fd1 51 push ecx
00417fd2 8bcc mov ecx,esp
00417fd4 89642404 mov [esp+0x4],esp
00417fd8 68d8c64600 push 0x46c6d8 ; "WSAEMSGSIZE: The socket is message oriented, and the message is larger than the maximum supported by the underlying transport. "
00417fdd eb64 jmp image00400000+0x18043 (00418043)
; 10065 WSAEHOSTUNREACH
00417fdf 51 push ecx
00417fe0 8bcc mov ecx,esp
00417fe2 89642404 mov [esp+0x4],esp
00417fe6 6880c64600 push 0x46c680 ; "WSAEHOSTUNREACH: The remote host cannot be reached from this host at this time. "
00417feb eb56 jmp image00400000+0x18043 (00418043)
; 10022 WSAEINVAL
00417fed 51 push ecx
00417fee 8bcc mov ecx,esp
00417ff0 89642404 mov [esp+0x4],esp
00417ff4 68e8c54600 push 0x46c5e8 ; "WSAEINVAL: The socket has not been bound with bind, or an unknown flag was specified, or MSG_OOB was specified for a socket with SO_OOBINLINE enabled. "
00417ff9 eb48 jmp image00400000+0x18043 (00418043)
; 10053 WSAECONNABORTED
00417ffb 51 push ecx
00417ffc 8bcc mov ecx,esp
00417ffe 89642404 mov [esp+0x4],esp
00418002 6808bf4600 push 0x46bf08 ; "WSAECONNABORTED: The virtual circuit was terminated due to a time-out or other failure. The application should close the socket as it is no longer usable. "
00418007 eb3a jmp image00400000+0x18043 (00418043)
; 10054 WSAECONNRESET
00418009 51 push ecx
0041800a 8bcc mov ecx,esp
0041800c 89642404 mov [esp+0x4],esp
00418010 68b0c44600 push 0x46c4b0 ; "WSAECONNRESET: The virtual circuit was reset by the remote side executing a hard or abortive close. For UPD sockets, the remote host was unable to deliver a previously sent UDP datagram and responded with a Port Unreachable ICMP packet. The application should close the socket as it is no longer usable. "
00418015 eb2c jmp image00400000+0x18043 (00418043)
; 10060 WSAETIMEDOUT
00418017 51 push ecx
00418018 8bcc mov ecx,esp
0041801a 89642404 mov [esp+0x4],esp
0041801e 6820c44600 push 0x46c420 ; "WSAETIMEDOUT: The connection has been dropped, because of a network failure or because the system on the other end went down without notice. "
00418023 eb1e jmp image00400000+0x18043 (00418043)
; default
00418025 51 push ecx ; param @1
00418026 8d4c2408 lea ecx,[esp+0x8]
0041802a 6810ac4600 push 0x46ac10 ; param "errno: %d"
0041802f 51 push ecx ; param buffer
00418030 e8c8320300 call image00400000+0x4b2fd (0044b2fd) ; sprintf
00418035 83c408 add esp,0x8
00418038 8d542408 lea edx,[esp+0x8]
0041803c 8bcc mov ecx,esp
0041803e 89642404 mov [esp+0x4],esp
00418042 52 push edx
;
00418043 e8489ffeff call image00400000+0x1f90 (00401f90)
00418048 e8e3c60100 call image00400000+0x34730 (00434730)
0041804d 83c404 add esp,0x4
00418050 81c404010000 add esp,0x104
00418056 c20400 ret 0x4

void __stdcall AnalyzeWSAGetLastError( unsigned long code )
{
char buffer[260];
const char *p;

switch( code )
{
case WSANOTINITIALISED :
p = "WSANOTINITIALISED ...";
break;
// ...
default :
::sprintf( buffer, "errno: %d", code );
p = buffer;
}

::401f90( p );
::434730();
}