How to find the Cross reference of a function or a string using r2pipe? - cross-reference

I am working on a malware detection project where I am using both radare2 and r2pipe. I know how to find the cross references of a function and string with the help of "axt #function_address/string_address" command. But the problem is that same command is not working in r2pipe i.e. r2.cmd("axt #function_address"). Can someone please help me how to find the cross references of a function or a string using r2pipe??

Same command is working. But the mistake which I have done was this. I have used double 'aa' instead of triple 'aaa' for analysing i.e r2.cmd('aaa').

Related

Expression.Error for Text.InferNumberType wasn't recognized

I've got a function where I want to determine if all the digits after the first are numbers. To do so, I thought I could use Text.InferNumberType which, per the documentation, should raise an error if the text is not a number.
Here is my code snippet:
a= Text.Start(Argument,1),
b= Text.End(Argument, Text.Length(Argument) - 1),
c= try Text.InferNumberType(b) otherwise "FALSE" ,
Instead, I'm getting this Expression.Error which says:
Expression.Error: the name Text.InferNumberType wasn't recognized. Make sure it's spelled correctly.
I literally copied and pasted the function name from the reference document, so I'm sure it's spelled correctly.
I'm using PowerQuery in Excel 2013. PowerQuery was installed about a week ago using the latest download from Microsoft. I did search and found this question - I'm wondering if this is a similar issue? I don't see anything in the documentation though which says this function wouldn't be available in certain versions of power query.
This is likely an older function that isn't supported in Excel 2013. I'd recommend a different function like Number.From or Number.FromText, which have similar functionality.

Error calling similar() in Sikuli

l = find("Start_menu.png").similar(0.5).anyColor()
click(l)
The above is an excerpt from my code. "Start_menu.png" refers to an image of the Windows Start Menu. I got the following error when I executed this:
File "C:\Users\VPRAVE~1.TSI\AppData\Local\Temp\sikuli-tmp8636618870597770744.py", line 1, in
l = find("1368426219510.png").similar(0.5).anyColor().anySize()
AttributeError: 'org.sikuli.script.Match' object has no attribute 'similar'
Could some one help me out with this? And could some one tell me how to use anyColor() and anySize()?
find attempts to find something when it's called. So what your code says, in prose, is "find something that looks like 'Start_menu', then make the thing you found 0.5 similar, then make that any color"
This is wrong--you can't set the similarity threshold after the fact. Instead, call it as seen in the Sikuli docs.
Instead, say
l = find(Pattern("Start_menu.png").similar(0.5))
Here's the same code arranged vertically:
pattern = Pattern("Start_menu.png")
pattern.similar(0.5)
l = find(pattern)
The other problem is your reference to the anyColor() function, which doesn't exist. I see the code you're trying to run is from "Sikuli: Using GUI Screenshots for Search and Automation" (linked from the Sikuli docs), but this function (and the syntax used in that paper) don't exist in any extant version of Sikuli. You can see an open feature request for it on the Sikuli launchpad page.
This doesn't help you now, though. I don't know of another visual automation package that can do anyColor. If you wanted to use that feature for something, I suggest asking a new question where you describe the problem you're trying to solve, and someone may be able to suggest a work-around for that specific case.

Erlang and current date time

I would like to get a current date time with erlang.
I have tried using the code below;
{{Year,Month,Day},{Hour,Min,Sec}} = erlang:localtime().
But sometimes it got an error like '** exception error: no match of right hand side value {{2012,5,6},{23,40,58}}'
Looks like there is a problem with 1 digit. I try searching couple of webs but still cannot find a way to cope this.
I believe this is quite an easy one but as a erlang newbie, I cannot resolve this. I try my best.
Env:
Erlang {"OTP APN 181 01","R15B01"} installed with windows binary version
Windows XP
Thanks in advance,
No, there is no problem with 1 digit. It should match perfectly well (check with {{Year,Month,Day},{Hour,Min,Sec}} = {{2012,5,6},{23,40,58}}). Most likely you have already assigned one of the variables to something earlier in the function.

Is there a native CodeIgniter function that does the reverse of $this->db->escape()?

I was looking for a function that does the reverse of $this->db->escape() to get the original string when it was still unescaped.
I have tried searching for it in the Codeigniter docs. I don't think I can find one.
I also tried finding a native PHP function for it( since it uses mysql_real_escape_string when using MySQL) but so far the closest thing that I can find is stripslashes()
stripslashes will unescape the string correctly.

Using Apache and mod_ext_filter, need to dynamically replace values of static file based off of query string

I've got a situation where I need to alter the contents of a cached file based off of one of the query string arguments passed in. I'd love to use sed to do a simple regular expression replacement of a value based off of said argument but I can't figure that one out. I could use a ruby script to do the replacement for me but can't seem to access the query string for the request within the script. The documents for mod_ext_filter say:
In addition to the standard CGI environment variables, DOCUMENT_URI, DOCUMENT_PATH_INFO, and QUERY_STRING_UNESCAPED will also be set for the program.
Um yeah, can't seem to access those.
Has anybody any experience with this or does anybody have a better solution?
Doh! Looks like I simply need to access the ENV variable within ruby. Pretty dumb of me.
Using PHP scripting language server function we can able to get the query string values.
echo $_SERVER['REQUEST_URI'];
And pass the URL arguments as a variable to the file and make it dynamic.
Refer : PHP.net

Resources