Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Dessecting SD message from bytearray -> cannot see all entries in the entry_array #7

@public-src-code

Description

@public-src-code

## SCAPY from scapy.all import * from scapy.contrib.automotive.someip import SOMEIP from scapy.contrib.automotive.someip_sd import *

`# SD message with multiple entries (from wireshark)
localPayload = [0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x06, 0x00, 0x00, 0x10, 0xb0, 0x91, 0x00, 0x01, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x06, 0x00, 0x00, 0x10, 0x30, 0x21, 0x00, 0x01, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x06, 0x00, 0x00, 0x10, 0xd5, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x06, 0x00, 0x00, 0x10, 0xd5, 0x38, 0x00, 0x01, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x06, 0x00, 0x00, 0x10, 0x33, 0x91, 0x00, 0x01, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x06, 0x00, 0x00, 0x10, 0x33, 0x91, 0x00, 0x01, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x06, 0x00, 0x00, 0x10, 0xe2, 0xb5, 0x00, 0x01, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x06, 0x00, 0x00, 0x20, 0x35, 0x61, 0x00, 0x01, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x06, 0x02, 0x00, 0x10, 0x35, 0x48, 0x00, 0x02, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x06, 0x00, 0x00, 0x10, 0x31, 0x20, 0x00, 0x01, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x06, 0x00, 0x00, 0x10, 0x12, 0x78, 0x00, 0x01, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x06, 0x00, 0x00, 0x10, 0x82, 0xb6, 0x00, 0x01, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x06, 0x00, 0x00, 0x10, 0x81, 0xb8, 0x00, 0x01, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x06, 0x02, 0x00, 0x10, 0x75, 0x42, 0x00, 0x01, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x06, 0x00, 0x00, 0x10, 0x30, 0x1e, 0x00, 0x01, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x24, 0x00, 0x09, 0x04, 0x00, 0xa0, 0x30, 0xc7, 0x10, 0x00, 0x11, 0xfe, 0x0d, 0x00, 0x09, 0x04, 0x00, 0xa0, 0x30, 0xc7, 0x10, 0x00, 0x11, 0x77, 0x1b, 0x00, 0x09, 0x04, 0x00, 0xa0, 0x30, 0xc7, 0x10, 0x00, 0x11, 0xf5, 0xbd]

my_sd = SD(bytearray(localPayload))
for sd_entry in my_sd.getfieldval("entry_array"):
print(sd_entry.getfieldval('srv_id'))
print(repr(sd_entry))
`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions