Okay, I made it. I used Ws2_32.dll's functions. Here is my code:
UDPStartup()
$hWs2_32 = DllOpen("ws2_32.dll")
$hSocket = _WinsockCreateSocket(2, 2, 17)
_WinsockBind($hSocket, "192.168.178.20", 53); The source address and port for the Socket. The IP must be your LAN IP. I've found that 127.0.0.1 does not work.
_WinsockConnect($hSocket, "192.168.178.22", 65432); The destination IP and port.
_WinsockSend($hSocket, "This UDP Packet came from Port 53!")
Func _WinsockCreateSocket($Address_Family, $Socket_Type, $Protocol)
$iRet = DllCall($hWs2_32, "int", "socket", "int", $Address_Family, "int", $Socket_Type, "int", $Protocol)
Return $iRet[0]
EndFunc
Func _WinsockBind($hSocket, $IP, $Port)
$hAddr = _SocketAddr($IP, $Port)
$iRet = DllCall($hWs2_32, "int", "bind", "uint", $hSocket, "ptr", DllStructGetPtr($hAddr), "int", DllStructGetSize($hAddr))
Return $iRet[0]
EndFunc
Func _WinsockConnect($hSocket, $IP, $Port)
$hAddr = _SocketAddr($IP, $Port)
$iRet = DllCall($hWs2_32, "int", "connect", "uint", $hSocket, "ptr", DllStructGetPtr($hAddr), "int", DllStructGetSize($hAddr))
EndFunc
Func _WinsockSend($hSocket, $data)
$hBuf = DllStructCreate("byte[" & BinaryLen($data) & "]")
DllStructSetData($hBuf, 1, $data)
$iRet = DllCall($hWs2_32, "int", "send", "uint", $hSocket, "ptr", DllStructGetPtr($hBuf), "int", DllStructGetSize($hBuf), "int", 0)
EndFunc
Func _SocketAddr($IP, $Port, $Address_Family = 2)
$stAddress = DllStructCreate("short; ushort; uint; char[8]")
DllStructSetData($stAddress, 1, $Address_Family)
$iRet = DllCall($hWs2_32, "ushort", "htons", "ushort", $Port)
DllStructSetData($stAddress, 2, $iRet[0])
$iRet = DllCall($hWs2_32, "uint", "inet_addr", "str", $IP)
DllStructSetData($stAddress, 3, $iRet[0])
Return $stAddress
EndFunc ;==>_SocketAddr
Func _WSAGetLastError()
$iRet = DllCall($hWs2_32, "int", "WSAGetLastError")
Return $iRet[0]
EndFunc ;==>_WSAGetLastError
On the other computer, there was an AutoIt UDP listener running. It said the source port of the packet received is indeed 53.
There is PLENTY of room to expand this and make it into an excellent UDF. I only implemented the functions I need for now, but you probably see where to expand this.
Here's the list of functions that could potentially be adapted in the UDF:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms741394(v=vs.85).aspx