Forum Discussion
Michael_Koyfma1
Cirrus
Nov 03, 2006Payload manipulation question
Basically, once I have the payload, I need to identify a piece that starts with FO followed by 5 digits, then three spaces, and then B. I need the send back the payload back to the client, only I need to insert three digits instead of spaces in the pattern that I am looking for above.
So, I thought I could do something like this:
regexp -all "(\*)(FO\*)(B\*)" [TCP::payload] $first_part $second_part $third_part
This way I should be able to capture part of the payload that starts with FO and ends just before B.
The question becomes now how do I replace the contents of $second_part from let say FO00001 to FO00001113?
2 Replies
- Deb_Allen_18Historic F5 AccountHi Michael -
set payload [TCP::payload] set new_digits "" regsub -all "(FO)(.*)( )(B)" $payload "\\1\\2$new_digits\\4" payload TCP::payload replace 0 [TCP::payload length] $payload
- Deb_Allen_18Historic F5 AccountActually one better, let's only look for digits with that wildcard:
regsub -all "(FO)(\[0-9\]*)( )(B)" $payload "\\1\\2$replace_digits\\4" payload
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects