Function at 0x1007d8b6
Capabilities:
Read and send data from client to server
Read file on windows
Receive data
Receive data on socket
Send data
Send data on socket

Disassembly:
mov eax, 0x8318
call fcn.10001019
mov eax, dword [0x101844f8]
xor eax, esp
mov dword [esp + 0x8314], eax
push esi
mov esi, dword [esp + 0x8320]
mov al, byte [esi + 4]
test al, 0x10
je 0x1007e07c
push ebx
and al, 3
push ebp
push edi
cmp al, 3
jne 0x1007db97
xor edi, edi
mov dword [esp + 0x20], 0x100
cmp dword [esi + 0x18], 1
mov dword [esp + 0x14], edi
je 0x1007d92a
cmp dword [esi + 0x18], 5
je 0x1007d92a
mov ebp, 0xffff
push ebp
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov ebx, eax
pop ecx
test ebx, ebx
je 0x1007d955
lea eax, [esp + 0x20]
push eax
lea eax, [esp + 0x28]
push eax
push edi
push ebp
push ebx
jmp 0x1007d944
lea eax, [esp + 0x20]
push eax
lea eax, [esp + 0x28]
push eax
push edi
lea ebx, [esp + 0x330]
push 0x8000
mov eax, ebx
push eax
push dword [esi + 0x14]
call dword [sym.imp.WS2_32.dll_recvfrom]
mov dword [esp + 0x14], eax
test eax, eax
jg 0x1007d963
push dword [0x10189b04]
call sym.CoreFoundation.dll_CFRetain
pop ecx
jmp 0x1007d975
push eax
push ebx
push esi
call sym.CoreFoundation.dll_CFGetAllocator
pop ecx
push eax
call sym.CoreFoundation.dll_CFDataCreate
add esp, 0xc
mov ebp, eax
test ebx, ebx
je 0x1007d98e
lea eax, [esp + 0x324]
cmp ebx, eax
je 0x1007d98e
push ebx
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
pop ecx
lea ebx, [esi + 0xc]
push ebx
call sym.CoreFoundation.dll___CFSpinLock
mov al, byte [esi + 4]
pop ecx
test al, 0x10
jne 0x1007d9b1
push ebp
call sym.CoreFoundation.dll_CFRelease
push ebx
call sym.CoreFoundation.dll___CFSpinUnlock
pop ecx
jmp 0x1007e078
or al, 0x20
mov byte [esi + 4], al
cmp dword [esp + 0x20], edi
jle 0x1007d9d7
push dword [esp + 0x20]
lea eax, [esp + 0x28]
push eax
push esi
call sym.CoreFoundation.dll_CFGetAllocator
pop ecx
push eax
call sym.CoreFoundation.dll_CFDataCreate
add esp, 0xc
jmp 0x1007da47
cmp dword [esi + 0x18], 1
je 0x1007d9e3
cmp dword [esi + 0x18], 5
jne 0x1007da4d
cmp dword [esi + 0x24], edi
jne 0x1007da3e
mov dword [esp + 0x18], 0x100
test al, 0x10
je 0x1007da39
cmp dword [esi + 0x14], 0xffffffff
je 0x1007da39
lea eax, [esp + 0x18]
push eax
lea eax, [esp + 0x128]
push eax
push dword [esi + 0x14]
call dword [sym.imp.WS2_32.dll_getpeername]
test eax, eax
jne 0x1007da39
cmp dword [esp + 0x18], edi
jle 0x1007da39
push dword [esp + 0x18]
lea eax, [esp + 0x128]
push eax
push esi
call sym.CoreFoundation.dll_CFGetAllocator
pop ecx
push eax
call sym.CoreFoundation.dll_CFDataCreate
add esp, 0xc
mov dword [esi + 0x24], eax
cmp dword [esi + 0x24], edi
je 0x1007da4d
push dword [esi + 0x24]
call sym.CoreFoundation.dll_CFRetain
pop ecx
mov ebx, eax
test ebx, ebx
jne 0x1007da5b
push dword [0x10189b04]
call sym.CoreFoundation.dll_CFRetain
pop ecx
mov ebx, eax
cmp dword [esi + 0x4c], edi
jne 0x1007da79
push sym.CoreFoundation.dll_kCFTypeArrayCallBacks
push edi
push esi
call sym.CoreFoundation.dll_CFGetAllocator
pop ecx
push eax
call sym.CoreFoundation.dll_CFArrayCreateMutable
add esp, 0xc
mov dword [esi + 0x4c], eax
cmp dword [esi + 0x50], edi
jne 0x1007da97
push sym.CoreFoundation.dll_kCFTypeArrayCallBacks
push edi
push esi
call sym.CoreFoundation.dll_CFGetAllocator
pop ecx
push eax
call sym.CoreFoundation.dll_CFArrayCreateMutable
add esp, 0xc
mov dword [esi + 0x50], eax
push ebp
push dword [esi + 0x4c]
call sym.CoreFoundation.dll_CFArrayAppendValue
push ebp
call sym.CoreFoundation.dll_CFRelease
push ebx
push dword [esi + 0x50]
call sym.CoreFoundation.dll_CFArrayAppendValue
push ebx
call sym.CoreFoundation.dll_CFRelease
add esp, 0x18
cmp dword [esp + 0x14], edi
jle 0x1007dec1
test byte [esi + 8], 3
je 0x1007dec1
test dword [esi + 8], 0x300
jne 0x1007dec1
cmp dword [esi + 0x28], edi
jle 0x1007dec1
mov ebp, 0x10189aec
push ebp
call sym.CoreFoundation.dll___CFSpinLock
mov eax, dword [0x10189b00]
pop ecx
mov ecx, dword [esi + 0x14]
mov byte [0x101790fc], 1
mov dword [esp + 0x18], eax
mov dword [esp + 0x14], ecx
cmp ecx, 0xffffffff
je 0x1007dd6d
push eax
call sym.CoreFoundation.dll_CFDataGetMutableBytePtr
push dword [esp + 0x1c]
mov ebx, eax
call sym.CoreFoundation.dll_CFDataGetLength
pop ecx
pop ecx
mov ecx, eax
mov dword [esp + 0x1c], ecx
test ecx, ecx
je 0x1007db50
push ebx
push dword [esp + 0x18]
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
jne 0x1007dd6d
mov ecx, dword [esp + 0x1c]
test ecx, ecx
jle 0x1007db50
mov eax, dword [ebx]
lea eax, [eax*4 + 8]
jmp 0x1007db55
mov eax, 0x1004
cmp eax, ecx
jle 0x1007db71
mov ebx, dword [esp + 0x18]
sub eax, ecx
push eax
push ebx
call sym.CoreFoundation.dll_CFDataIncreaseLength
push ebx
call sym.CoreFoundation.dll_CFDataGetMutableBytePtr
add esp, 0xc
mov ebx, eax
mov ecx, dword [esp + 0x14]
mov eax, edi
cmp eax, dword [ebx]
jae 0x1007dd3f
lea edx, [ebx + 4]
cmp dword [edx], ecx
je 0x1007dd3d
inc eax
add edx, 4
cmp eax, dword [ebx]
jb 0x1007db82
jmp 0x1007dd3d
cmp al, 2
jne 0x1007dd79
lea eax, [esp + 0x14]
mov dword [esp + 0x14], 0x100
push eax
lea eax, [esp + 0x228]
push eax
push dword [esi + 0x14]
call dword [sym.imp.WS2_32.dll_accept]
mov ebp, eax
cmp ebp, 0xffffffff
je 0x1007e079
cmp dword [esp + 0x14], 0
jle 0x1007dbed
push dword [esp + 0x14]
lea eax, [esp + 0x228]
push eax
push esi
call sym.CoreFoundation.dll_CFGetAllocator
pop ecx
push eax
call sym.CoreFoundation.dll_CFDataCreate
add esp, 0xc
jmp 0x1007dbf9
push dword [0x10189b04]
call sym.CoreFoundation.dll_CFRetain
pop ecx
lea edi, [esi + 0xc]
mov ebx, eax
push edi
call sym.CoreFoundation.dll___CFSpinLock
mov al, byte [esi + 4]
pop ecx
test al, 0x10
jne 0x1007dc1f
push ebp
call dword [sym.imp.WS2_32.dll_closesocket]
push ebx
call sym.CoreFoundation.dll_CFRelease
push edi
jmp 0x1007d9a6
or al, 0x20
xor edi, edi
mov byte [esi + 4], al
cmp dword [esi + 0x4c], edi
jne 0x1007dc40
push edi
push edi
push esi
call sym.CoreFoundation.dll_CFGetAllocator
pop ecx
push eax
call sym.CoreFoundation.dll_CFArrayCreateMutable
add esp, 0xc
mov dword [esi + 0x4c], eax
cmp dword [esi + 0x50], edi
jne 0x1007dc5e
push sym.CoreFoundation.dll_kCFTypeArrayCallBacks
push edi
push esi
call sym.CoreFoundation.dll_CFGetAllocator
pop ecx
push eax
call sym.CoreFoundation.dll_CFArrayCreateMutable
add esp, 0xc
mov dword [esi + 0x50], eax
push ebp
push dword [esi + 0x4c]
call sym.CoreFoundation.dll_CFArrayAppendValue
push ebx
push dword [esi + 0x50]
call sym.CoreFoundation.dll_CFArrayAppendValue
push ebx
call sym.CoreFoundation.dll_CFRelease
add esp, 0x14
test byte [esi + 8], 2
je 0x1007dec1
test dword [esi + 8], 0x200
jne 0x1007dec1
cmp dword [esi + 0x28], edi
jle 0x1007dec1
mov ebp, 0x10189aec
push ebp
call sym.CoreFoundation.dll___CFSpinLock
mov eax, dword [0x10189b00]
pop ecx
mov ecx, dword [esi + 0x14]
mov byte [0x101790fc], 1
mov dword [esp + 0x20], eax
mov dword [esp + 0x18], ecx
cmp ecx, 0xffffffff
je 0x1007dd6d
push eax
call sym.CoreFoundation.dll_CFDataGetMutableBytePtr
push dword [esp + 0x24]
mov ebx, eax
call sym.CoreFoundation.dll_CFDataGetLength
pop ecx
pop ecx
mov ecx, eax
mov dword [esp + 0x1c], ecx
test ecx, ecx
je 0x1007dd03
push ebx
push dword [esp + 0x1c]
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
jne 0x1007dd6d
mov ecx, dword [esp + 0x1c]
test ecx, ecx
jle 0x1007dd03
mov eax, dword [ebx]
lea eax, [eax*4 + 8]
jmp 0x1007dd08
mov eax, 0x1004
cmp eax, ecx
jle 0x1007dd24
mov ebx, dword [esp + 0x20]
sub eax, ecx
push eax
push ebx
call sym.CoreFoundation.dll_CFDataIncreaseLength
push ebx
call sym.CoreFoundation.dll_CFDataGetMutableBytePtr
add esp, 0xc
mov ebx, eax
mov ecx, dword [esp + 0x18]
mov eax, edi
cmp eax, dword [ebx]
jae 0x1007dd3f
lea edx, [ebx + 4]
cmp dword [edx], ecx
je 0x1007dd3d
inc eax
add edx, 4
cmp eax, dword [ebx]
jb 0x1007dd31
cmp eax, dword [ebx]
jne 0x1007dd4f
cmp dword [ebx], 0x400
jae 0x1007dd4f
mov dword [ebx + eax*4 + 4], ecx
inc dword [ebx]
mov eax, dword [0x10179100]
cmp eax, 0xffffffff
je 0x1007dd6d
push edi
push 1
lea ecx, [esp + 0x1b]
mov byte [esp + 0x1b], 0x72
push ecx
push eax
call dword [sym.imp.WS2_32.dll_send]
push ebp
call sym.CoreFoundation.dll___CFSpinUnlock
pop ecx
jmp 0x1007dec1
lea ebp, [esi + 0xc]
push ebp
mov dword [esp + 0x1c], ebp
call sym.CoreFoundation.dll___CFSpinLock
test byte [esi + 4], 0x10
pop ecx
je 0x1007e072
test dword [esi + 8], 0x100
jne 0x1007e072
xor edi, edi
cmp byte [esp + 0x8330], 0
je 0x1007de62
cmp dword [esi + 0x64], edi
jne 0x1007debd
mov ebp, 0x10189aec
push ebp
call sym.CoreFoundation.dll___CFSpinLock
mov eax, dword [esi + 0x14]
mov ebx, dword [0x10189b00]
mov byte [0x101790fc], 1
mov dword [esp + 0x20], ebx
mov dword [esp + 0x18], eax
pop ecx
cmp eax, 0xffffffff
je 0x1007e062
push ebx
call sym.CoreFoundation.dll_CFDataGetMutableBytePtr
push ebx
mov esi, eax
call sym.CoreFoundation.dll_CFDataGetLength
mov ebx, eax
pop ecx
pop ecx
test ebx, ebx
je 0x1007de1b
push esi
push dword [esp + 0x18]
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
jne 0x1007e062
test ebx, ebx
jle 0x1007de1b
mov eax, dword [esi]
lea eax, [eax*4 + 8]
jmp 0x1007de20
mov eax, 0x1004
cmp eax, ebx
jle 0x1007de3c
mov esi, dword [esp + 0x1c]
sub eax, ebx
push eax
push esi
call sym.CoreFoundation.dll_CFDataIncreaseLength
push esi
call sym.CoreFoundation.dll_CFDataGetMutableBytePtr
add esp, 0xc
mov esi, eax
mov ecx, dword [esp + 0x14]
mov eax, edi
cmp eax, dword [esi]
jae 0x1007e034
lea edx, [esi + 4]
cmp dword [edx], ecx
je 0x1007e032
inc eax
add edx, 4
cmp eax, dword [esi]
jb 0x1007de4d
jmp 0x1007e032
mov ebx, dword [esi + 0x60]
test ebx, ebx
je 0x1007debd
cmp byte [esi + 0x6c], 0
jne 0x1007debd
sub ebx, dword [esi + 0x64]
test ebx, ebx
jle 0x1007debd
push dword [esi + 0x5c]
call sym.CoreFoundation.dll_CFDataGetMutableBytePtr
mov ebp, dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
pop ecx
mov ecx, eax
mov dword [esp + 0x1c], ecx
mov eax, dword [esi + 0x64]
push ebx
add eax, ecx
push eax
push dword [esi + 0x14]
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__read]
add esp, 0xc
cmp eax, 0xffffffff
jne 0x1007df87
call ebp
mov ecx, dword [esp + 0x1c]
cmp dword [eax], 0xb
je 0x1007de8b
call ebp
mov eax, dword [eax]
mov dword [esi + 0x70], eax
mov byte [esi + 0x6c], 1
or byte [esi + 4], 0x20
push dword [esi + 0x2c]
call sym.CoreFoundation.dll_CFRunLoopSourceSignal
push dword [esi + 0x30]
call sym.CoreFoundation.dll_CFRetain
push dword [esi + 0x30]
mov dword [esp + 0x28], eax
push edi
push dword [sym.CoreFoundation.dll_kCFAllocatorSystemDefault]
call sym.CoreFoundation.dll_CFArrayCreateMutableCopy
mov ebx, dword [esi + 0x2c]
add esp, 0x14
mov ebp, eax
test ebx, ebx
je 0x1007df09
push ebx
call sym.CoreFoundation.dll_CFRunLoopSourceIsValid
pop ecx
xor ecx, ecx
test al, al
cmove ebx, ecx
test ebx, ebx
je 0x1007df09
push ebx
call sym.CoreFoundation.dll_CFRetain
pop ecx
lea eax, [esi + 0xc]
push eax
call sym.CoreFoundation.dll___CFSpinUnlock
push ebp
push ebx
call fcn.1007ccdb
add esp, 0xc
mov dword [esp + 0x14], eax
test ebx, ebx
je 0x1007df2f
push ebx
call sym.CoreFoundation.dll_CFRelease
mov eax, dword [esp + 0x18]
pop ecx
test eax, eax
je 0x1007df44
push eax
call sym.CoreFoundation.dll_CFRunLoopWakeUp
push dword [esp + 0x18]
call sym.CoreFoundation.dll_CFRelease
pop ecx
pop ecx
lea eax, [esi + 0xc]
push eax
call sym.CoreFoundation.dll___CFSpinLock
mov ebx, dword [esp + 0x20]
pop ecx
cmp ebx, dword [esi + 0x30]
jne 0x1007df63
mov dword [esi + 0x30], ebp
mov ebp, edi
push ebx
call sym.CoreFoundation.dll_CFRelease
pop ecx
lea eax, [esi + 0xc]
push eax
call sym.CoreFoundation.dll___CFSpinUnlock
push ebx
call sym.CoreFoundation.dll_CFRelease
pop ecx
pop ecx
test ebp, ebp
je 0x1007e079
push ebp
call sym.CoreFoundation.dll_CFRelease
jmp 0x1007e078
test eax, eax
je 0x1007deb9
add dword [esi + 0x64], eax
mov eax, dword [esi + 0x64]
cmp dword [esi + 0x60], eax
je 0x1007debd
mov ebp, 0x10189aec
push ebp
call sym.CoreFoundation.dll___CFSpinLock
mov eax, dword [esi + 0x14]
mov ebx, dword [0x10189b00]
mov byte [0x101790fc], 1
mov dword [esp + 0x18], eax
pop ecx
cmp eax, 0xffffffff
je 0x1007e062
push ebx
call sym.CoreFoundation.dll_CFDataGetMutableBytePtr
push ebx
mov esi, eax
call sym.CoreFoundation.dll_CFDataGetLength
mov edi, eax
pop ecx
pop ecx
test edi, edi
je 0x1007dffa
push esi
push dword [esp + 0x18]
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
jne 0x1007e062
test edi, edi
jle 0x1007dffa
mov eax, dword [esi]
lea eax, [eax*4 + 8]
jmp 0x1007dfff
mov eax, 0x1004
cmp eax, edi
jle 0x1007e017
sub eax, edi
push eax
push ebx
call sym.CoreFoundation.dll_CFDataIncreaseLength
push ebx
call sym.CoreFoundation.dll_CFDataGetMutableBytePtr
add esp, 0xc
mov esi, eax
mov ecx, dword [esp + 0x14]
xor edi, edi
mov eax, edi
cmp eax, dword [esi]
jae 0x1007e034
lea edx, [esi + 4]
cmp dword [edx], ecx
je 0x1007e032
inc eax
add edx, 4
cmp eax, dword [esi]
jb 0x1007e026
cmp eax, dword [esi]
jne 0x1007e044
cmp dword [esi], 0x400
jae 0x1007e044
mov dword [esi + eax*4 + 4], ecx
inc dword [esi]
mov eax, dword [0x10179100]
cmp eax, 0xffffffff
je 0x1007e062
push edi
push 1
lea ecx, [esp + 0x1b]
mov byte [esp + 0x1b], 0x72
push ecx
push eax
call dword [sym.imp.WS2_32.dll_send]
push ebp
call sym.CoreFoundation.dll___CFSpinUnlock
mov eax, dword [esp + 0x1c]
push eax
jmp 0x1007d9a6
push ebp
call sym.CoreFoundation.dll___CFSpinUnlock
pop ecx
pop edi
pop ebp
pop ebx
mov ecx, dword [esp + 0x8318]
pop esi
xor ecx, esp
call fcn.1000234c
add esp, 0x8318
ret