Modbus customize protocol header

Hi, all

I have a problem, when i use HA to connect a modbus device, the device’s manufacturer add a customize protocol header base on standard modbus protocol. I consider to modify pymodbus or write a python script, but do not know how to start. Can anyone help me?