Split a binary file into 2 basing on 2 delemiter string

Hi all,

I have a binary file (orig.dat) and two special delimiter strings 'AAA' and 'BBB'. My binary file's content is as follow:
<Data1.1>AAA<Data1.2>BBB
<Data2.1>AAA<Data2.2>BBB
...
<DataN.1>AAA<DataN.2>BBB
DataX.Y might have any length, and contains any kind of special/printable characters.

Now I want to split this file into 2 files F1.dat and F2.dat, content of file 1 should be:
<Data1.1>
<Data2.1>
...
<DataN.1>

content of file 2 should be
<Data1.2>
<Data2.2>
...
<DataN.2>

Could you please help suggest me a way to do this.

Thank you very much!

See this thread: How to hide SSH version