VBScipt: calls to inline functions obscured by global variables

VBScript in ASP Classic contains an int function. (He rounds the numbers to -∞.) Suppose that some overly "smart" encoder has created a global variable called "int". Is there any way to get the original function? I tried all kinds of workarounds with clipped and dodgy execs, but no dice. I suspect this is not possible, but I hope someone finds out more about it than I do.

EDIT: Thanks for the answers. As y'all asked, a global variable called "Int" (although, unfortunately, vbscript is not case sensitive) is the factory for a class like Java Integer. The default property is essentially a single argument constructor; that is, "Int (42)" gives a new IntClass object containing 42. The default property for IntClass, in turn, simply returns a raw number.

The creator tried to get around the lack of proper namespaces and static methods, and the solution was actually pretty seamless. Pass to IntClass where int is expected, and it will automatically activate the default property. I am trying to fix the last remaining seam: the outer code calling "int" will not be rounded properly (because the constructor uses CLng).

0
source share
3 answers

Not that I know, getref only works with user-defined functions, not with built-in modules. I would suggest renaming the custom'int function and updating all links to these custom ones. You can use the search function visual studio (express) or any other tool that you like. Do not work hard.

+3
source

Or you can use CIntinstead onInt

response.write trim(cint(3.14)) + "<br>"

Wrong!! See NobodyMan Comments

0
source

, .

. int. , , .

( - int..., )

0
source

Source: https://habr.com/ru/post/1721416/


All Articles