Function at 0x401dd1
Capabilities:
Create tcp socket
Create thread
Get file size
Initialize winsock library
Read file on windows
Start tcp server

Disassembly:
push rbp
push rbx
sub rsp, 0x3f8
lea rbp, [rsp + 0x80]
call fcn.0040cde0
lea rax, [rbp + 0x1a0]
mov r8d, 0x104
mov rdx, rax
mov ecx, 0
mov rax, qword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
call rax
lea rax, [rbp + 0x1a0]
mov rcx, rax
mov rax, qword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecA]
call rax
lea rax, [rbp + 0x2ff]
mov rcx, rax
call fcn.00468ad0
lea rcx, [rbp + 0x2ff]
lea rdx, [rbp + 0x1a0]
lea rax, [rbp + 0x2d0]
mov r8, rcx
mov rcx, rax
call fcn.0049dbb0
lea rax, [rbp + 0x2b0]
lea rdx, [rbp + 0x2d0]
lea r8, str.index.html
mov rcx, rax
call fcn.004b9910
lea rax, [rbp + 0x2b0]
mov rcx, rax
call fcn.00428160
mov qword [rsp + 0x30], 0
mov dword [rsp + 0x28], pe_nt_image_headers64
mov dword [rsp + 0x20], 3
mov r9d, 0
mov r8d, 0
mov edx, 0x80000000
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_CreateFileA]
call rax
mov qword [rbp + 0x368], rax
lea rax, [rbp + 0x2b0]
mov rcx, rax
call fcn.0049e0e0
lea rax, [rbp + 0x2d0]
mov rcx, rax
call fcn.0049e0e0
lea rax, [rbp + 0x2ff]
mov rcx, rax
call fcn.00468b00
mov rax, qword [rbp + 0x368]
mov edx, 0
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_GetFileSize]
call rax
mov dword [rbp + 0x364], eax
mov eax, dword [rbp + 0x364]
add eax, 1
mov eax, eax
mov rcx, rax
call fcn.004bc9e0
mov qword [rbp + 0x358], rax
lea r8, [rbp + 0x19c]
mov ecx, dword [rbp + 0x364]
mov rdx, qword [rbp + 0x358]
mov rax, qword [rbp + 0x368]
mov qword [rsp + 0x20], 0
mov r9, r8
mov r8d, ecx
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_ReadFile]
call rax
mov edx, dword [rbp + 0x364]
mov rax, qword [rbp + 0x358]
mov r8, rdx
mov rdx, rax
lea rcx, [0x004ef060]
call fcn.0049c8a0
lea rax, [rbp + 0x347]
mov rcx, rax
call fcn.00468ad0
lea rcx, [rbp + 0x347]
lea rdx, [rbp + 0x1a0]
lea rax, [rbp + 0x320]
mov r8, rcx
mov rcx, rax
call fcn.0049dbb0
lea rax, [rbp + 0x300]
lea rdx, [rbp + 0x320]
lea r8, str.img.jpg
mov rcx, rax
call fcn.004b9910
lea rax, [rbp + 0x300]
mov rcx, rax
call fcn.00428160
mov qword [rsp + 0x30], 0
mov dword [rsp + 0x28], pe_nt_image_headers64
mov dword [rsp + 0x20], 3
mov r9d, 0
mov r8d, 0
mov edx, 0x80000000
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_CreateFileA]
call rax
mov qword [rbp + 0x368], rax
lea rax, [rbp + 0x300]
mov rcx, rax
call fcn.0049e0e0
lea rax, [rbp + 0x320]
mov rcx, rax
call fcn.0049e0e0
lea rax, [rbp + 0x347]
mov rcx, rax
call fcn.00468b00
mov rax, qword [rbp + 0x368]
mov edx, 0
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_GetFileSize]
call rax
mov dword [rbp + 0x364], eax
mov eax, dword [rbp + 0x364]
add eax, 1
mov eax, eax
mov rcx, rax
call fcn.004bc9e0
mov qword [rbp + 0x358], rax
lea r8, [rbp + 0x19c]
mov ecx, dword [rbp + 0x364]
mov rdx, qword [rbp + 0x358]
mov rax, qword [rbp + 0x368]
mov qword [rsp + 0x20], 0
mov r9, r8
mov r8d, ecx
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_ReadFile]
call rax
mov edx, dword [rbp + 0x364]
mov rax, qword [rbp + 0x358]
mov r8, rdx
mov rdx, rax
lea rcx, [0x004ef080]
call fcn.0049c8a0
mov rax, qword [rbp + 0x368]
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_CloseHandle]
call rax
mov dword [rbp - 0x34], 0x10
mov rax, rbp
mov rdx, rax
mov ecx, 0x202
mov rax, qword [sym.imp.WS2_32.dll_WSAStartup]
call rax
test eax, eax
setne al
test al, al
je 0x40211f
lea rdx, str.WSAStartup_failed
mov rcx, qword [0x004c5f00]
call fcn.004b9300
mov rdx, qword [0x004c5f30]
mov rcx, rax
call fcn.004713f0
mov eax, 1
jmp 0x402449
mov r8d, 6
mov edx, 1
mov ecx, 2
mov rax, qword [sym.imp.WS2_32.dll_socket]
call rax
mov qword [rbp + 0x350], rax
cmp qword [rbp + 0x350], 0xffffffffffffffff
jne 0x40217e
lea rdx, str.socket_creation_failed
mov rcx, qword [0x004c5f00]
call fcn.004b9300
mov rdx, qword [0x004c5f30]
mov rcx, rax
call fcn.004713f0
mov rax, qword [sym.imp.WS2_32.dll_WSACleanup]
call rax
mov eax, 1
jmp 0x402449
mov word [rbp - 0x20], 2
mov dword [rbp - 0x1c], 0
mov ecx, 0x1f90
mov rax, qword [sym.imp.WS2_32.dll_htons]
call rax
mov word [rbp - 0x1e], ax
lea rdx, [rbp - 0x20]
mov rax, qword [rbp + 0x350]
mov r8d, 0x10
mov rcx, rax
mov rax, qword [sym.imp.WS2_32.dll_bind]
call rax
cmp eax, 0xffffffff
sete al
test al, al
je 0x40220c
lea rdx, str.bind_failed
mov rcx, qword [0x004c5f00]
call fcn.004b9300
mov rdx, qword [0x004c5f30]
mov rcx, rax
call fcn.004713f0
mov rax, qword [rbp + 0x350]
mov rcx, rax
mov rax, qword [sym.imp.WS2_32.dll_closesocket]
call rax
mov rax, qword [sym.imp.WS2_32.dll_WSACleanup]
call rax
mov eax, 1
jmp 0x402449
mov rax, qword [rbp + 0x350]
mov edx, 0x7fffffff
mov rcx, rax
mov rax, qword [sym.imp.WS2_32.dll_listen]
call rax
cmp eax, 0xffffffff
sete al
test al, al
je 0x402276
lea rdx, str.listen_failed
mov rcx, qword [0x004c5f00]
call fcn.004b9300
mov rdx, qword [0x004c5f30]
mov rcx, rax
call fcn.004713f0
mov rax, qword [rbp + 0x350]
mov rcx, rax
mov rax, qword [sym.imp.WS2_32.dll_closesocket]
call rax
mov rax, qword [sym.imp.WS2_32.dll_WSACleanup]
call rax
mov eax, 1
jmp 0x402449
lea rdx, str.Server_is_listening_on_port_8080...
mov rcx, qword [0x004c5f20]
call fcn.004b9300
mov rdx, qword [0x004c5f30]
mov rcx, rax
call fcn.004713f0
lea rcx, [rbp - 0x34]
lea rdx, [rbp - 0x30]
mov rax, qword [rbp + 0x350]
mov r8, rcx
mov rcx, rax
mov rax, qword [sym.imp.WS2_32.dll_accept]
call rax
mov qword [rbp - 8], rax
mov rax, qword [rbp - 8]
cmp rax, 0xffffffffffffffff
jne 0x40230c
lea rdx, str.accept_failed
mov rcx, qword [0x004c5f00]
call fcn.004b9300
mov rdx, qword [0x004c5f30]
mov rcx, rax
call fcn.004713f0
mov rax, qword [rbp + 0x350]
mov rcx, rax
mov rax, qword [sym.imp.WS2_32.dll_closesocket]
call rax
mov rax, qword [sym.imp.WS2_32.dll_WSACleanup]
call rax
mov eax, 1
jmp 0x402449
lea rax, [rbp - 8]
mov qword [rsp + 0x28], 0
mov dword [rsp + 0x20], 0
mov r9, rax
lea r8, [0x00401837]
mov edx, 0
mov ecx, 0
mov rax, qword [sym.imp.KERNEL32.dll_CreateThread]
call rax
mov qword [rbp + 0x348], rax
cmp qword [rbp + 0x348], 0
jne 0x4023a7
lea rdx, str.CreateThread_failed
mov rcx, qword [0x004c5f00]
call fcn.004b9300
mov rdx, qword [0x004c5f30]
mov rcx, rax
call fcn.004713f0
mov rax, qword [rbp - 8]
mov rcx, rax
mov rax, qword [sym.imp.WS2_32.dll_closesocket]
call rax
mov rax, qword [rbp + 0x350]
mov rcx, rax
mov rax, qword [sym.imp.WS2_32.dll_closesocket]
call rax
mov rax, qword [sym.imp.WS2_32.dll_WSACleanup]
call rax
mov eax, 1
jmp 0x402449
mov rax, qword [rbp + 0x348]
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_CloseHandle]
call rax
jmp 0x402298
add rsp, 0x3f8
pop rbx
pop rbp
ret