Highlighted
Absent Member.
Absent Member.
5909 views

Converting BodyBinary to Readable Format

Hi All, I have a recording where the web request body is BodyBinary. As described in the help file, the BodyBinary is an ASCII representation of the binary data passed across the network, where non-printable characters are represented as HEX. So that means, it is possible to reverse engineer what text the binary data represents. For the application under test, the data being passed across the network is simply clear text but compressed (via java Deflater/OutputStream) that is why LoadRunner captures it as binary data. I have tried to inflate the data, that is, convert the BodyBinary text to its byte representation (ASCII to byte or HEX to byte), then decompressed using java Inflate class, but the decompression works. Can anyone tell me I have the right/wrong idea and if this is possible or give some suggestions?

 

Thanks!

0 Likes
7 Replies
Highlighted
Absent Member.
Absent Member.

Re: Converting BodyBinary to Readable Format

Some additional info:

 

I made a recording in fiddler and the request data (HEX) did not perfectly match the BodyBinary when converted to from ASCII to HEX. Anyone knows why this is the case?

0 Likes
Highlighted
New Member.

Re: Converting BodyBinary to Readable Format

Hello,

 

You wrote "LoadRunner captures it as binary data" and "the request data (HEX) did not perfectly match the BodyBinary when converted to from ASCII to HEX."

 

I assume you are using the Data Format Extensions feature?

Could you post the relevant step, and a sample of the data as converted by fiddler?

 

Thanks,

Oded Keret
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Converting BodyBinary to Readable Format

No, I'm not using DFE, just the data in the BodyBinary.

 

After some more investigation, I found that the BodyBinary when inflated/decompressed, contains an extract character/byte compared to the inflated/decompressed data from Fiddler. I have traced the data to be an extrac backslash. It appears that a single backslash character is represented by two backslash characters. After making adjustments to my BodyBinary decompression code, I'm now able to view the inflated/decompressed and correct bytes/text.

 

Next question:

 

Are there DFE's for deflate/zlib compression/decompression? Can I write a DFE in Java? Seems to be available only in C. Can anyone point me to good references/tutorials for writing a custom DFE?

 

Thanks.

0 Likes
Highlighted
New Member.

Re: Converting BodyBinary to Readable Format

The LoadRunner Data Format Extensions Developer Guide can be found here:

Start > All Programs > HP Software > HP LoadRunner > Documentation > Data Format Extensions Developer Guide

 

Currently, we do not support DFEs written in Java out of the box.

 

For using zlib, you can try the following (in this case, for decompression):

1. Copy zlib.h and zconf.h into the LoadRunner include directory.

2. Add an #include "zlib.h" statement to the relevant Action file.

3. Call lr_load_dll("zlib.dll"); within your Action file to have access to zlip functions.

4. Allocate enough memory for the resulting buffer, for example:

Byte * unzipped = (Byte*)calloc((uInt)4096, 1);
unsigned long unzipped_len = 4096;

5. Call lr_eval_string_ext in order to save the compressed value to a buffer:

lr_eval_string_ext(param_name, param_name_length, &content, &prmLen, 0, 0, -1);

6. Call zlip uncompress function:

rc = uncompress(unzipped, &unzipped_len, (const Bytef*)content,prmLen); 

 

For further assistance please contact our support system.

 

Regards,

Oded Keret
0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Converting BodyBinary to Readable Format

Hi Raymond

 

I have the same problem. After recording an application I'm seeing a lot of BodyBinary data that contains hex values. I can see that you've somehow managed to convert the data into text but I don't understand how you did it.


It says you "inflated/decompressed" the bodybinary. What does this mean and how did you do that?

 

I tried adding jars to the classpath for recording but it seems to just give me "// couldn't decode request from body, couldn't decode response from body"

 

 

 

0 Likes
Highlighted
New Member.

Re: Converting BodyBinary to Readable Format

Hi I tried all possible ways to convert the Binary body in readable format. I am using LR 12.60 version and using web HTTP/HTML protocol. Can someone help me how to convert the Binary body please 

0 Likes
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: Converting BodyBinary to Readable Format

Hi,

What type of application do you test? Do you know what type of binary content it is?

Did you read about LoadRunner Data Format Extension? It allows you to inject your own plugin in the script code generation (a result of the recording) and as part of the replay of the script to convert data from one format to a readable text format.

Regards,
Shlomi

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.