Function at 0x1007d8c4
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 [0x10184508]
xor eax, esp
mov dword [esp + 0x8314], eax
push esi
mov esi, dword [esp + 0x8320]
mov al, byte [esi + 4]
test al, 0x10
je 0x1007e08a
push ebx
and al, 3
push ebp
push edi
cmp al, 3
jne 0x1007dba5
xor edi, edi
mov dword [esp + 0x20], 0x100
cmp dword [esi + 0x18], 1
mov dword [esp + 0x14], edi
je 0x1007d938
cmp dword [esi + 0x18], 5
je 0x1007d938
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 0x1007d963
lea eax, [esp + 0x20]
push eax
lea eax, [esp + 0x28]
push eax
push edi
push ebp
push ebx
jmp 0x1007d952
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 0x1007d971
push dword [0x10189b14]
call sym.CoreFoundation.dll_CFRetain
pop ecx
jmp 0x1007d983
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 0x1007d99c
lea eax, [esp + 0x324]
cmp ebx, eax
je 0x1007d99c
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 0x1007d9bf
push ebp
call sym.CoreFoundation.dll_CFRelease
push ebx
call sym.CoreFoundation.dll___CFSpinUnlock
pop ecx
jmp 0x1007e086
or al, 0x20
mov byte [esi + 4], al
cmp dword [esp + 0x20], edi
jle 0x1007d9e5
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 0x1007da55
cmp dword [esi + 0x18], 1
je 0x1007d9f1
cmp dword [esi + 0x18], 5
jne 0x1007da5b
cmp dword [esi + 0x24], edi
jne 0x1007da4c
mov dword [esp + 0x18], 0x100
test al, 0x10
je 0x1007da47
cmp dword [esi + 0x14], 0xffffffff
je 0x1007da47
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 0x1007da47
cmp dword [esp + 0x18], edi
jle 0x1007da47
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 0x1007da5b
push dword [esi + 0x24]
call sym.CoreFoundation.dll_CFRetain
pop ecx
mov ebx, eax
test ebx, ebx
jne 0x1007da69
push dword [0x10189b14]
call sym.CoreFoundation.dll_CFRetain
pop ecx
mov ebx, eax
cmp dword [esi + 0x4c], edi
jne 0x1007da87
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 0x1007daa5
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 0x1007decf
test byte [esi + 8], 3
je 0x1007decf
test dword [esi + 8], 0x300
jne 0x1007decf
cmp dword [esi + 0x28], edi
jle 0x1007decf
mov ebp, 0x10189afc
push ebp
call sym.CoreFoundation.dll___CFSpinLock
mov eax, dword [0x10189b10]
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 0x1007dd7b
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 0x1007db5e
push ebx
push dword [esp + 0x18]
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
jne 0x1007dd7b
mov ecx, dword [esp + 0x1c]
test ecx, ecx
jle 0x1007db5e
mov eax, dword [ebx]
lea eax, [eax*4 + 8]
jmp 0x1007db63
mov eax, 0x1004
cmp eax, ecx
jle 0x1007db7f
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 0x1007dd4d
lea edx, [ebx + 4]
cmp dword [edx], ecx
je 0x1007dd4b
inc eax
add edx, 4
cmp eax, dword [ebx]
jb 0x1007db90
jmp 0x1007dd4b
cmp al, 2
jne 0x1007dd87
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 0x1007e087
cmp dword [esp + 0x14], 0
jle 0x1007dbfb
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 0x1007dc07
push dword [0x10189b14]
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 0x1007dc2d
push ebp
call dword [sym.imp.WS2_32.dll_closesocket]
push ebx
call sym.CoreFoundation.dll_CFRelease
push edi
jmp 0x1007d9b4
or al, 0x20
xor edi, edi
mov byte [esi + 4], al
cmp dword [esi + 0x4c], edi
jne 0x1007dc4e
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 0x1007dc6c
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 0x1007decf
test dword [esi + 8], 0x200
jne 0x1007decf
cmp dword [esi + 0x28], edi
jle 0x1007decf
mov ebp, 0x10189afc
push ebp
call sym.CoreFoundation.dll___CFSpinLock
mov eax, dword [0x10189b10]
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 0x1007dd7b
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 0x1007dd11
push ebx
push dword [esp + 0x1c]
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
jne 0x1007dd7b
mov ecx, dword [esp + 0x1c]
test ecx, ecx
jle 0x1007dd11
mov eax, dword [ebx]
lea eax, [eax*4 + 8]
jmp 0x1007dd16
mov eax, 0x1004
cmp eax, ecx
jle 0x1007dd32
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 0x1007dd4d
lea edx, [ebx + 4]
cmp dword [edx], ecx
je 0x1007dd4b
inc eax
add edx, 4
cmp eax, dword [ebx]
jb 0x1007dd3f
cmp eax, dword [ebx]
jne 0x1007dd5d
cmp dword [ebx], 0x400
jae 0x1007dd5d
mov dword [ebx + eax*4 + 4], ecx
inc dword [ebx]
mov eax, dword [0x10179100]
cmp eax, 0xffffffff
je 0x1007dd7b
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 0x1007decf
lea ebp, [esi + 0xc]
push ebp
mov dword [esp + 0x1c], ebp
call sym.CoreFoundation.dll___CFSpinLock
test byte [esi + 4], 0x10
pop ecx
je 0x1007e080
test dword [esi + 8], 0x100
jne 0x1007e080
xor edi, edi
cmp byte [esp + 0x8330], 0
je 0x1007de70
cmp dword [esi + 0x64], edi
jne 0x1007decb
mov ebp, 0x10189afc
push ebp
call sym.CoreFoundation.dll___CFSpinLock
mov eax, dword [esi + 0x14]
mov ebx, dword [0x10189b10]
mov byte [0x101790fc], 1
mov dword [esp + 0x20], ebx
mov dword [esp + 0x18], eax
pop ecx
cmp eax, 0xffffffff
je 0x1007e070
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 0x1007de29
push esi
push dword [esp + 0x18]
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
jne 0x1007e070
test ebx, ebx
jle 0x1007de29
mov eax, dword [esi]
lea eax, [eax*4 + 8]
jmp 0x1007de2e
mov eax, 0x1004
cmp eax, ebx
jle 0x1007de4a
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 0x1007e042
lea edx, [esi + 4]
cmp dword [edx], ecx
je 0x1007e040
inc eax
add edx, 4
cmp eax, dword [esi]
jb 0x1007de5b
jmp 0x1007e040
mov ebx, dword [esi + 0x60]
test ebx, ebx
je 0x1007decb
cmp byte [esi + 0x6c], 0
jne 0x1007decb
sub ebx, dword [esi + 0x64]
test ebx, ebx
jle 0x1007decb
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 0x1007df95
call ebp
mov ecx, dword [esp + 0x1c]
cmp dword [eax], 0xb
je 0x1007de99
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 0x1007df17
push ebx
call sym.CoreFoundation.dll_CFRunLoopSourceIsValid
pop ecx
xor ecx, ecx
test al, al
cmove ebx, ecx
test ebx, ebx
je 0x1007df17
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.1007cce9
add esp, 0xc
mov dword [esp + 0x14], eax
test ebx, ebx
je 0x1007df3d
push ebx
call sym.CoreFoundation.dll_CFRelease
mov eax, dword [esp + 0x18]
pop ecx
test eax, eax
je 0x1007df52
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 0x1007df71
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 0x1007e087
push ebp
call sym.CoreFoundation.dll_CFRelease
jmp 0x1007e086
test eax, eax
je 0x1007dec7
add dword [esi + 0x64], eax
mov eax, dword [esi + 0x64]
cmp dword [esi + 0x60], eax
je 0x1007decb
mov ebp, 0x10189afc
push ebp
call sym.CoreFoundation.dll___CFSpinLock
mov eax, dword [esi + 0x14]
mov ebx, dword [0x10189b10]
mov byte [0x101790fc], 1
mov dword [esp + 0x18], eax
pop ecx
cmp eax, 0xffffffff
je 0x1007e070
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 0x1007e008
push esi
push dword [esp + 0x18]
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
jne 0x1007e070
test edi, edi
jle 0x1007e008
mov eax, dword [esi]
lea eax, [eax*4 + 8]
jmp 0x1007e00d
mov eax, 0x1004
cmp eax, edi
jle 0x1007e025
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 0x1007e042
lea edx, [esi + 4]
cmp dword [edx], ecx
je 0x1007e040
inc eax
add edx, 4
cmp eax, dword [esi]
jb 0x1007e034
cmp eax, dword [esi]
jne 0x1007e052
cmp dword [esi], 0x400
jae 0x1007e052
mov dword [esi + eax*4 + 4], ecx
inc dword [esi]
mov eax, dword [0x10179100]
cmp eax, 0xffffffff
je 0x1007e070
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 0x1007d9b4
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