1
我的協議基於HTTP,我需要解析器來分析HTTP有效載荷。如何在解析函數中獲得http有效載荷?當寫作wireshark lua鏈接HTTP解析器時得到http有效載荷
鏈式剝離的樣子:
local original_http_dissector = DissectorTable.get("tcp.port"):get_dissector(80)
local function my_dissector(buf, pkt, root)
-- 'buf' here contains all tcp data,
-- including the http header
-- How to get the http payload only(skip http header)?
local b = buf
end
function p_MM.dissector(buf, pkt, root)
if original_http_dissector:call(buf, pkt, root) then
my_dissector(buf, pkt, root)
end
end