You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When an HTTPrequest is made, the emulator doesn't actually execute the request (because that would be rather dangerous). However, many scripts I've encountered, rely on the size of the returned buffer to check if the script is finished downloading so it can continue the script. Take the following code (from example):
The line "if (ADODBStream.size > 176277) {" is the focus here. Right now the size of an ADODBStream is always Infinity, so in this case it will validate to true because Infinity is bigger than 176277.
However, if the script is looking for an exact match like "if (ADODBStream.size == 176277) }", it will never validate to true and get stuck in the infinite while(true) loop.
Proposed solution:
For every iteration of "ADODBStream.write(httpStream.responseBody);", add 1 byte to the contents of the ADODBStream and update the size accordingly. This way we don't have to download the actual contents, but both "size > int" and "size == int" would validate to true.
The text was updated successfully, but these errors were encountered:
Proposed solution does not work. However, we could see if we can emulate it by updating the stream's size every time we read its value, like is done with the readyState on .send() in MSXML2.XMLHTTP.
This bug also causes another problem: when the script should call multiple urls, only the first url is ever returned. This means the analysis is incomplete and makes it a bug
When an HTTPrequest is made, the emulator doesn't actually execute the request (because that would be rather dangerous). However, many scripts I've encountered, rely on the size of the returned buffer to check if the script is finished downloading so it can continue the script. Take the following code (from example):
The line "if (ADODBStream.size > 176277) {" is the focus here. Right now the size of an ADODBStream is always Infinity, so in this case it will validate to true because Infinity is bigger than 176277.
However, if the script is looking for an exact match like "if (ADODBStream.size == 176277) }", it will never validate to true and get stuck in the infinite while(true) loop.
Proposed solution:
For every iteration of "ADODBStream.write(httpStream.responseBody);", add 1 byte to the contents of the ADODBStream and update the size accordingly. This way we don't have to download the actual contents, but both "size > int" and "size == int" would validate to true.
The text was updated successfully, but these errors were encountered: