I'm dealing with a piece of malware that does extensive use of PCRE (Perl-compatible regular expressions). Normally I would be able to read them, but it seems they're in some kind of binary format (compiled, maybe?). They all start with ERCP (check out the hexdump below); FWIW, I strongly suspect the language that generated this code to be C++.
00000150 00 00 00 00 11 00 5e 00 00 00 01 00 00 00 45 52 |......^.......ER|
00000160 43 50 56 00 00 00 00 00 80 00 04 00 00 00 01 00 |CPV.............|
00000170 00 00 00 00 74 00 28 00 00 00 00 00 00 00 00 00 |....t.(.........|
00000180 00 00 00 00 00 00 5e 00 2a 5f 00 06 00 01 1a 54 |......^.*_.....T|
00000190 00 05 1c 2e 55 00 0b 1c 61 1c 61 1c 61 1c 61 1c |....U...a.a.a.a.|
000001a0 61 1c 61 1c 61 1c 61 1c 2e 1c 6e 1c 65 1c 74 1b |a.a.a.a...n.e.t.|
000001b0 55 00 2a 00 00 00 00 00 8d ff a5 95 0a 2d 2d 2d |U.*..........---|
In this example, the regex seems to match some string related to an internet domain, aaaaaaaa.net.
My question is: given a binary blob like this, is it possible to go back to a "human readable" (decompiled?) PCRE? (i.e. ^aaaaaa\.net$) If yes, how should I go about it ?