Assembly Code of File sub_403E06


    sub_403B4C proc near ; CODE XREF: sub_403E06 + 37Cp var_8C4 = byte ptr - 8C4h var_6C4 = dword ptr - 6C4h var_640 = byte ptr - 640h var_53C = byte ptr - 53Ch var_330 = dword ptr - 330h var_32C = dword ptr - 32Ch var_31C = dword ptr - 31Ch var_318 = dword ptr - 318h var_314 = byte ptr - 314h var_211 = byte ptr - 211h var_210 = byte ptr - 210h var_10C = byte ptr - 10Ch var_10B = byte ptr - 10Bh var_10A = byte ptr - 10Ah var_8 = byte ptr - 8 var_4 = dword ptr - 4 arg_0 = dword ptr 8 arg_4 = dword ptr 0Ch arg_8 = dword ptr 10h arg_C = dword ptr 14h arg_10 = dword ptr 18h push ebp mov ebp, esp sub esp, 8C4h push ebx push esi push edi push 41h xor eax, eax pop ecx lea edi, [ ebp + var_210 ] rep stosd mov eax, [ ebp + arg_8 ] xor esi, esi cmp byte ptr [ eax ], 2Fh mov [ ebp + var_4 ], esi push eax jz short loc_403B7A push offset aS_6 ; \"\\%s\" jmp short loc_403B82 ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - loc_403B7A: ; CODE XREF: sub_403B4C + 25j mov byte ptr [ eax ], 5Ch push offset aS_1 ; \"%s\" loc_403B82: ; CODE XREF: sub_403B4C + 2Cj lea eax, [ ebp + var_10C ] push eax call sub_412BB5 lea eax, [ ebp + var_10C ] add esp, 0Ch xor edi, edi lea ecx, [ eax + 1 ] loc_403B9C: ; CODE XREF: sub_403B4C + 55j mov dl, [ eax ] inc eax test dl, dl jnz short loc_403B9C sub eax, ecx mov [ ebp + arg_8 ], eax jz short loc_403C22 push 2 pop ebx loc_403BAD: ; CODE XREF: sub_403B4C + D4j lea eax, [ ebp + var_10C ] lea edx, [ eax + 1 ] loc_403BB6: ; CODE XREF: sub_403B4C + 6Fj mov cl, [ eax ] inc eax test cl, cl jnz short loc_403BB6 sub eax, edx cmp ebx, eax jnb short loc_403BEF cmp [ ebp + esi + var_10C ], 25h jnz short loc_403BEF cmp [ ebp + esi + var_10B ], 32h jnz short loc_403BEF cmp [ ebp + esi + var_10A ], 30h jnz short loc_403BEF inc esi inc esi inc ebx mov [ ebp + edi + var_210 ], 20h inc ebx jmp short loc_403C09 ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - loc_403BEF: ; CODE XREF: sub_403B4C + 75j ; sub_403B4C + 7Fj ... mov al, [ ebp + esi + var_10C ] cmp al, 2Fh jnz short loc_403BFF push 5Ch pop eax jmp short loc_403C02 ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - loc_403BFF: ; CODE XREF: sub_403B4C + ACj movsx eax, al loc_403C02: ; CODE XREF: sub_403B4C + B1j mov [ ebp + edi + var_210 ], al loc_403C09: ; CODE XREF: sub_403B4C + A1j inc esi lea eax, [ ebp + var_10C ] inc ebx inc edi lea ecx, [ eax + 1 ] loc_403C15: ; CODE XREF: sub_403B4C + CEj mov dl, [ eax ] inc eax test dl, dl jnz short loc_403C15 sub eax, ecx cmp esi, eax jb short loc_403BAD loc_403C22: ; CODE XREF: sub_403B4C + 5Cj lea eax, [ ebp + var_210 ] push eax push [ ebp + arg_4 ] lea eax, [ ebp + var_314 ] push offset aSS ; \"%s%s\" push eax call sub_412BB5 lea eax, [ ebp + var_314 ] push offset asc_420328 ; \"\n\" push eax call sub_413859 add esp, 18h lea eax, [ ebp + var_314 ] push eax call ds:dword_41F06C ; GetFileAttributesA xor ebx, ebx inc ebx cmp eax, 10h jz short loc_403C73 cmp eax, 0FFFFFFFFh jnz short loc_403C76 push [ ebp + arg_0 ] jmp loc_403CFB ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - loc_403C73: ; CODE XREF: sub_403B4C + 118j mov [ ebp + var_4 ], ebx loc_403C76: ; CODE XREF: sub_403B4C + 11Dj cmp [ ebp + edi + var_211 ], 5Ch jnz short loc_403C83 mov [ ebp + var_4 ], ebx loc_403C83: ; CODE XREF: sub_403B4C + 132j mov eax, [ ebp + arg_0 ] xor edi, edi cmp [ ebp + var_4 ], edi mov [ ebp + var_6C4 ], eax mov [ ebp + var_318 ], edi jz short loc_403D06 cmp [ ebp + arg_C ], edi jz short loc_403CFA lea edi, [ ebp + var_314 ] dec edi loc_403CA5: ; CODE XREF: sub_403B4C + 15Fj mov al, [ edi + 1 ] inc edi test al, al jnz short loc_403CA5 lea eax, [ ebp + var_314 ] push eax lea eax, [ ebp + var_640 ] mov esi, offset asc_4205E4 ; \" * \" push eax movsw call sub_412BB5 lea eax, [ ebp + var_210 ] push eax call sub_403879 lea eax, [ ebp + var_210 ] push eax lea eax, [ ebp + var_53C ] push eax call sub_412BB5 or [ ebp + var_330 ], 0FFFFFFFFh add esp, 14h mov [ ebp + var_31C ], ebx xor edi, edi jmp short loc_403D55 ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - loc_403CFA: ; CODE XREF: sub_403B4C + 150j push eax loc_403CFB: ; CODE XREF: sub_403B4C + 122j call dword_4335AC ; closesocket jmp loc_403DED ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - loc_403D06: ; CODE XREF: sub_403B4C + 14Bj push edi push edi push 3 push edi push ebx push 80000000h lea eax, [ ebp + var_314 ] push eax call ds:dword_41F03C ; CreateFileA mov esi, eax cmp esi, 0FFFFFFFFh jz short loc_403D55 lea eax, [ ebp + var_314 ] push eax lea eax, [ ebp + var_640 ] push eax call sub_412BB5 pop ecx pop ecx push edi push esi mov [ ebp + var_31C ], edi call ds:dword_41F060 ; GetFileSize push esi mov [ ebp + var_330 ], eax call ds:dword_41F034 ; CloseHandle loc_403D55: ; CODE XREF: sub_403B4C + 1ACj ; sub_403B4C + 1D7j mov esi, [ ebp + arg_10 ] push esi lea eax, [ ebp + var_8C4 ] push offset aHttpdWorkerThr ; \"[ HTTPD ]: Worker thread of server thread\"... push eax call sub_412BB5 push edi lea eax, [ ebp + var_8C4 ] push 4 push eax call sub_410EEA mov [ ebp + var_32C ], eax imul eax, 234h add esp, 18h mov dword_43433C[ eax ], esi lea eax, [ ebp + var_8 ] push eax push edi lea eax, [ ebp + var_6C4 ] push eax push offset sub_4039DE push edi push edi call ds:dword_41F00C ; CreateThread mov ecx, [ ebp + var_32C ] imul ecx, 234h cmp eax, edi mov dword_43434C[ ecx ], eax jnz short loc_403DFC push [ ebp + arg_0 ] call dword_4335AC ; closesocket call ds:dword_41F008 ; RtlGetLastWin32Error push eax lea eax, [ ebp + var_8C4 ] push offset aHttpdFailedT_0 ; \"[ HTTPD ]: Failed to start worker thread,\"... push eax call sub_412BB5 lea eax, [ ebp + var_8C4 ] push eax call sub_401C33 add esp, 10h loc_403DED: ; CODE XREF: sub_403B4C + 1B5j ; sub_403B4C + 2B8j pop edi pop esi xor eax, eax pop ebx leave retn ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - loc_403DF4: ; CODE XREF: sub_403B4C + 2B6j push 5 call ds:dword_41F000 ; Sleep loc_403DFC: ; CODE XREF: sub_403B4C + 26Fj cmp [ ebp + var_318 ], edi jz short loc_403DF4 jmp short loc_403DED sub_403B4C endp

    ########################## SUBROUTINE ##########################

    sub_403E06 proc near ; DATA XREF: sub_401141 + 363o ; sub_4078FA + 3FA2o var_28F0 = byte ptr - 28F0h var_18F0 = byte ptr - 18F0h var_8F0 = byte ptr - 8F0h var_6F0 = dword ptr - 6F0h var_6EC = byte ptr - 6ECh var_464 = byte ptr - 464h var_360 = dword ptr - 360h var_358 = dword ptr - 358h var_354 = dword ptr - 354h var_350 = dword ptr - 350h var_34C = dword ptr - 34Ch var_340 = byte ptr - 340h var_23C = byte ptr - 23Ch var_138 = byte ptr - 138h var_128 = dword ptr - 128h var_124 = dword ptr - 124h var_120 = dword ptr - 120h var_24 = word ptr - 24h var_22 = word ptr - 22h var_20 = dword ptr - 20h var_14 = dword ptr - 14h var_10 = dword ptr - 10h var_C = dword ptr - 0Ch var_8 = dword ptr - 8 var_4 = dword ptr - 4 arg_0 = dword ptr 8 push ebp mov ebp, esp mov eax, 28F0h call sub_412DD0 mov eax, [ ebp + arg_0 ] push ebx push esi push edi mov esi, eax mov ecx, 0ECh lea edi, [ ebp + var_6F0 ] rep movsd push [ ebp + var_360 ] xor esi, esi inc esi mov [ eax + 3ACh ], esi xor eax, eax lea edi, [ ebp + var_24 ] stosd stosd stosd stosd mov [ ebp + var_14 ], esi mov [ ebp + var_24 ], 2 call dword_4335EC ; ntohs and [ ebp + var_20 ], 0 push 0 push esi push 2 mov [ ebp + var_22 ], ax call dword_4334A0 ; socket mov ebx, eax or edi, 0FFFFFFFFh cmp ebx, edi mov [ ebp + var_8 ], ebx jz loc_4041D9 mov eax, [ ebp + var_358 ] imul eax, 234h mov dword_434344[ eax ], ebx push 10h lea eax, [ ebp + var_24 ] push eax push ebx call dword_433578 ; bind cmp eax, edi jz loc_4041D9 push 7FFFFFFFh push ebx call dword_4335C0 ; listen cmp eax, edi jz loc_4041D9 lea eax, [ ebp + var_14 ] push eax push 8004667Eh push ebx call dword_433444 ; ioctlsocket cmp eax, edi jz loc_4041D9 push 41h xor eax, eax pop ecx push eax push eax push eax lea eax, [ ebp + var_23C ] push eax mov [ ebp + var_124 ], ebx mov [ ebp + var_128 ], esi mov [ ebp + var_4 ], ebx lea eax, [ ebx + 1 ] jmp loc_4041BB ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - loc_403EEB: ; CODE XREF: sub_403E06 + 3CDj xor esi, esi mov [ ebp + arg_0 ], esi loc_403EF0: ; CODE XREF: sub_403E06 + 39Cj lea eax, [ ebp + var_23C ] push eax push esi call dword_4334F4 ; __WSAFDIsSet test eax, eax jz loc_404198 cmp esi, ebx jnz short loc_403F6D lea eax, [ ebp + var_10 ] push eax lea eax, [ ebp + var_138 ] push eax push ebx mov [ ebp + var_10 ], 10h call dword_433464 ; accept cmp eax, 0FFFFFFFFh jz loc_404198 mov edx, [ ebp + var_128 ] xor ecx, ecx test edx, edx jbe short loc_403F46 loc_403F38: ; CODE XREF: sub_403E06 + 13Ej cmp [ ebp + ecx * 4 + var_124 ], eax jz short loc_403F46 inc ecx cmp ecx, edx jb short loc_403F38 loc_403F46: ; CODE XREF: sub_403E06 + 130j ; sub_403E06 + 139j cmp ecx, edx jnz short loc_403F5C cmp edx, 40h jnb short loc_403F5C mov [ ebp + ecx * 4 + var_124 ], eax inc [ ebp + var_128 ] loc_403F5C: ; CODE XREF: sub_403E06 + 142j ; sub_403E06 + 147j cmp eax, [ ebp + var_4 ] jbe loc_404198 mov [ ebp + var_4 ], eax jmp loc_404198 ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - loc_403F6D: ; CODE XREF: sub_403E06 + 102j mov edx, 400h xor eax, eax mov ecx, edx lea edi, [ ebp + var_28F0 ] rep stosd push eax mov ecx, edx lea edi, [ ebp + var_18F0 ] rep stosd push 1000h lea eax, [ ebp + var_28F0 ] push eax push esi call dword_433414 ; recv test eax, eax jg short loc_403FF1 push esi call dword_4335AC ; closesocket xor eax, eax cmp [ ebp + var_128 ], eax jbe loc_404198 loc_403FB5: ; CODE XREF: sub_403E06 + 1BFj cmp [ ebp + eax * 4 + var_124 ], esi jz short loc_403FDB inc eax cmp eax, [ ebp + var_128 ] jb short loc_403FB5 jmp loc_404198 ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - loc_403FCC: ; CODE XREF: sub_403E06 + 1DEj mov ecx, [ ebp + eax * 4 + var_120 ] mov [ ebp + eax * 4 + var_124 ], ecx inc eax loc_403FDB: ; CODE XREF: sub_403E06 + 1B6j mov ecx, [ ebp + var_128 ] dec ecx cmp eax, ecx jb short loc_403FCC dec [ ebp + var_128 ] jmp loc_404198 ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - loc_403FF1: ; CODE XREF: sub_403E06 + 198j push 41h xor eax, eax pop ecx lea edi, [ ebp + var_340 ] rep stosd lea eax, [ ebp + var_28F0 ] xor ebx, ebx xor esi, esi lea ecx, [ eax + 1 ] loc_40400B: ; CODE XREF: sub_403E06 + 20Aj mov dl, [ eax ] inc eax test dl, dl jnz short loc_40400B sub eax, ecx mov [ ebp + var_C ], eax jz loc_404195 loc_40401D: ; CODE XREF: sub_403E06 + 2D0j mov al, [ ebp + ebx + var_28F0 ] cmp al, 0Ah mov [ ebp + esi + var_18F0 ], al jnz loc_4040C0 mov esi, offset aGet ; \"GET \" lea eax, [ ebp + var_18F0 ] push esi push eax call sub_413920 test eax, eax pop ecx pop ecx jz short loc_40409A lea eax, [ ebp + var_18F0 ] lea edx, [ eax + 1 ] loc_404054: ; CODE XREF: sub_403E06 + 253j mov cl, [ eax ] inc eax test cl, cl jnz short loc_404054 sub eax, edx cmp eax, 5 jbe short loc_40409A mov eax, offset asc_41FA74 ; \" \" push eax push eax lea eax, [ ebp + var_18F0 ] push esi push eax call sub_413920 pop ecx pop ecx push eax call sub_413920 pop ecx pop ecx push eax call sub_413859 pop ecx pop ecx lea edx, [ ebp + var_340 ] loc_40408E: ; CODE XREF: sub_403E06 + 290j mov cl, [ eax ] inc eax mov [ edx ], cl inc edx test cl, cl jnz short loc_40408E jmp short loc_4040AE ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - loc_40409A: ; CODE XREF: sub_403E06 + 243j ; sub_403E06 + 25Aj push 3 mov edi, offset asc_420620 ; \"\r\n\" lea esi, [ ebp + var_18F0 ] pop ecx xor eax, eax repe cmpsb jz short loc_4040E1 loc_4040AE: ; CODE XREF: sub_403E06 + 292j xor eax, eax mov ecx, 400h lea edi, [ ebp + var_18F0 ] rep stosd or esi, 0FFFFFFFFh loc_4040C0: ; CODE XREF: sub_403E06 + 227j lea eax, [ ebp + var_28F0 ] inc ebx inc esi lea ecx, [ eax + 1 ] loc_4040CB: ; CODE XREF: sub_403E06 + 2CAj mov dl, [ eax ] inc eax test dl, dl jnz short loc_4040CB sub eax, ecx cmp ebx, eax jb loc_40401D jmp loc_404195 ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - loc_4040E1: ; CODE XREF: sub_403E06 + 2A6j mov ecx, [ ebp + var_128 ] xor eax, eax test ecx, ecx jbe short loc_404120 loc_4040ED: ; CODE XREF: sub_403E06 + 2F6j mov edx, [ ebp + eax * 4 + var_124 ] cmp edx, [ ebp + arg_0 ] jz short loc_404115 inc eax cmp eax, ecx jb short loc_4040ED jmp short loc_404120 ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - loc_404100: ; CODE XREF: sub_403E06 + 312j mov ecx, [ ebp + eax * 4 + var_120 ] mov [ ebp + eax * 4 + var_124 ], ecx mov ecx, [ ebp + var_128 ] inc eax loc_404115: ; CODE XREF: sub_403E06 + 2F1j dec ecx cmp eax, ecx jb short loc_404100 dec [ ebp + var_128 ] loc_404120: ; CODE XREF: sub_403E06 + 2E5j ; sub_403E06 + 2F8j lea eax, [ ebp + var_340 ] lea edx, [ eax + 1 ] loc_404129: ; CODE XREF: sub_403E06 + 328j mov cl, [ eax ] inc eax test cl, cl jnz short loc_404129 sub eax, edx mov esi, eax lea eax, [ ebp + var_464 ] lea ecx, [ eax + 1 ] loc_40413D: ; CODE XREF: sub_403E06 + 33Cj mov dl, [ eax ] inc eax test dl, dl jnz short loc_40413D sub eax, ecx add eax, esi cmp eax, 104h jnb short loc_40418C and [ ebp + var_C ], 0 lea eax, [ ebp + var_C ] push eax push 8004667Eh push [ ebp + arg_0 ] call dword_433444 ; ioctlsocket push [ ebp + var_358 ] lea eax, [ ebp + var_340 ] push [ ebp + var_34C ] push eax lea eax, [ ebp + var_464 ] push eax push [ ebp + arg_0 ] call sub_403B4C add esp, 14h jmp short loc_404195 ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - loc_40418C: ; CODE XREF: sub_403E06 + 347j push [ ebp + arg_0 ] call dword_4335AC ; closesocket loc_404195: ; CODE XREF: sub_403E06 + 211j ; sub_403E06 + 2D6j ... mov ebx, [ ebp + var_8 ] loc_404198: ; CODE XREF: sub_403E06 + FAj ; sub_403E06 + 120j ... mov esi, [ ebp + arg_0 ] inc esi cmp esi, [ ebp + var_4 ] mov [ ebp + arg_0 ], esi jbe loc_403EF0 push 41h xor eax, eax pop ecx push eax push eax push eax lea eax, [ ebp + var_23C ] push eax mov eax, [ ebp + var_4 ] inc eax loc_4041BB: ; CODE XREF: sub_403E06 + E0j lea esi, [ ebp + var_128 ] lea edi, [ ebp + var_23C ] push eax rep movsd call dword_433544 ; select cmp eax, 0FFFFFFFFh jnz loc_403EEB loc_4041D9: ; CODE XREF: sub_403E06 + 66j ; sub_403E06 + 8Dj ... call dword_433558 ; WSAGetLastError push eax lea eax, [ ebp + var_8F0 ] push offset aHttpdErrorServ ; \"[ HTTPD ]: Error: server failed, returned\"... push eax call sub_412BB5 xor esi, esi add esp, 0Ch cmp [ ebp + var_350 ], esi jnz short loc_404221 push esi push [ ebp + var_354 ] lea eax, [ ebp + var_8F0 ] push eax lea eax, [ ebp + var_6EC ] push eax push [ ebp + var_6F0 ] call sub_4045DD add esp, 14h loc_404221: ; CODE XREF: sub_403E06 + 3F6j lea eax, [ ebp + var_8F0 ] push eax call sub_401C33 pop ecx push ebx call dword_4335AC ; closesocket push [ ebp + var_358 ] call sub_4111AE pop ecx push esi call ds:dword_41F014 ; ExitThread int 3 ; Trap to Debugger sub_403E06 endp ; sp - analysis failed