Readded Bc<->Bc messages to dissector

Also added them to the heurestic check
This commit is contained in:
QuantumEntangledAndy authored and Andrew committed 2021-08-31 20:47:34 +07:00
1 parent 73204acf52
commit ea4de74e8d
1 file changed
+10 -9
+10 -9
View File
@@ -189,7 +189,12 @@ end
function get_header_len(buffer) function get_header_len(buffer)
local magic = buffer(0, 4):le_uint() local magic = buffer(0, 4):le_uint()
if magic ~= 0x0abcdef0 then if magic == 0x0abcdef0 then
-- Client <-> BC
elseif magic == 0x0fedcba0 then
-- BC <-> BC
else
-- Unknown magic
return -1 -- No header found return -1 -- No header found
end end
local header_len = header_lengths[buffer(18, 2):le_uint()] local header_len = header_lengths[buffer(18, 2):le_uint()]
@@ -400,7 +405,6 @@ function get_udp_header_len(buffer)
elseif udptype == 0x10 then elseif udptype == 0x10 then
return 20 return 20
else else
print("Unknown udp type")
return -1 return -1
end end
end end
@@ -668,7 +672,6 @@ function process_bc_message(buffer, pinfo, tree)
end end
function bc_protocol.init () function bc_protocol.init ()
-- print ("(re-)initialise")
fragments = {} fragments = {}
end end
@@ -733,12 +736,9 @@ end
local function heuristic_checker_udp(buffer, pinfo, tree) local function heuristic_checker_udp(buffer, pinfo, tree)
-- guard for length -- guard for length
print("UDP Heur")
length = buffer:len() length = buffer:len()
if length < 4 then return false end if length < 4 then return false end
print("LEN GOOD")
local potential_magic = buffer(0,4):le_uint() local potential_magic = buffer(0,4):le_uint()
print("MAGIC??? " .. string.format("%x", potential_magic))
if potential_magic ~= 0x2a87cf3a and if potential_magic ~= 0x2a87cf3a and
potential_magic ~= 0x2a87cf20 and potential_magic ~= 0x2a87cf20 and
@@ -748,7 +748,6 @@ local function heuristic_checker_udp(buffer, pinfo, tree)
return false return false
end end
print("YEP")
bc_protocol.dissector(buffer, pinfo, tree) bc_protocol.dissector(buffer, pinfo, tree)
return true return true
end end
@@ -759,7 +758,10 @@ local function heuristic_checker_tcp(buffer, pinfo, tree)
if length < 4 then return false end if length < 4 then return false end
local potential_magic = buffer(0,4):le_uint() local potential_magic = buffer(0,4):le_uint()
if potential_magic ~= 0xabcdef0 then return false end if potential_magic ~= 0xabcdef0 and
potential_magic ~= 0x0fedcba0 then
return false
end
bc_protocol.dissector(buffer, pinfo, tree) bc_protocol.dissector(buffer, pinfo, tree)
return true return true
@@ -776,4 +778,3 @@ bc_protocol:register_heuristic("tcp", heuristic_checker_tcp)
-- DissectorTable.get("udp.port"):add(2018, bc_protocol) -- DissectorTable.get("udp.port"):add(2018, bc_protocol)
-- DissectorTable.get("udp.port"):add(2000, bc_protocol) -- DissectorTable.get("udp.port"):add(2000, bc_protocol)
-- DissectorTable.get("udp.port"):add(9999, bc_protocol) -- DissectorTable.get("udp.port"):add(9999, bc_protocol)