IDA Pro get Grey comments - ios

I have an iOS App disassembly which has the following block:
There are 'greyed out' comments in the picture of great interest which we want to capture from IDAPython. Such as which selectors are used on imported Framework objects such as UIWindow, CLHeading etc. IDA python however only has calls to get Repeatable comments, regular comments and function comments. Any idea which idc/idapython function gets this 'greyed out' comments? I assume they are repeatable comments from somewhere. Thanks.
UPDATES
The grey out comments are repeatable comments so I tried following the labeled address (selRef_setLastHeading on the third line) to the repeatable comment and arrived at this line:
However, when I did a RptCmt(here()) at that address, I was expecting #selector(setLastHeading:) to be returned as the comment but it returned an empty string..

The grey comments are repeating comments from the referenced item, thus for the first grey comment on the third line, if you went to the selRef_setLastHeading_ it should have a repeating comment.
If this was in a structured data block, I'd say read the address and then use that for the comment request function (sorry no IDApython experience just IDC script). but as they are an operand of an instruction, for this type of thing I'd tend to write a script that had a switch based on the instruction so you knew how to decode the reference address.

I'm found a stupid way to get the grey comments,something likes below.
widget = ida_kernwin.open_xrefs_window(pk_ea)
title = ida_kernwin.get_widget_title(widget)
ida_kernwin.close_widget(widget,0)
print(title)

Related

(Roblox scripting) help needed for "GetMaterialColor" or "SetMaterialColor"

I am new to roblox scripting, and I am working on a game. I am trying to make an exploration game with multiple planets. I want the colors on the surfaces of the planets to vary, but I also wish to use smooth terrain, as it is easier to use and looks nice. from reading a bit online, i have figured out i need to use "GetMaterialColor" or "SetMaterialColor". however, "SetMaterialColor", the one i needed specifically, requires two bits of information- the material and the color.
The issue comes from the "Material" part of this, as I have no idea how to make the script recognize what material I want to change. i tried multiple things, including but not limited to:
(grass, #,#,#)
(grass) (#,#,#)
("Grass"), (#,#,#)
("Grass", #,#,#)
or even just (#,#,#), without trying to get a specific material at all
so yeah, I need some help
here is the code:
local function onTouch(hit)
game.Workspace.Terrain:SetMaterialColor
end
script.Parent.Touched:connect(onTouch)
(there should be stuff after SetMaterialColor, that is what i need help with)
If you read the documentation on Terrain:SetMaterialColor(), you'll see that the first argument is a Material type, which is an Enum. So the method expects an Enum (or number to be more accurate), not a string denoting the material.
At the same time the second argument is a Color3, so (#,#,#) isn't apt, using it with the constructor Color3.fromRGB(#,#,#) is. If you are ever confused about what a method returns or expects, try referring to its documentation on https://developer.roblox.com/.
Here's an example of correct usage:
workspace.Terrain:SetMaterialColor(Enum.Material.Grass, Color3.fromRGB(123,123,123))
And ofcourse, Event:Connect() instead of Event:connect()

Why using List<T> as stack returns _GrowableList

I am new to Flutter and Dart. I have implemented list as stack reference for code here. I am calculating path from one node to other in graph. Problem with code is it returns _GrowableList on which is either empty or null but my GetAnswer do returns a correct list(checked while debugging). Why it automatically converts it into growable, How can I have my normal list?
Here is snippet of code where I am passing my graph start node and end node to instance of GetAnswer and storing back result in path variable.
That's the real internal type for the list you created. However, it shouldn't really look like this in the tooltip, this is how it looks for me:
If you can provide code that reproduces showing the tooltip like that, I'd love to take a look. Please open a bug in GitHub.
(It's possible you're on v2.11 of Dart Code - if so, please update to v2.12 and this should be improved)

authorProfileImageUrl returns only a tiny thumbnail

I'm trying to use YouTube Data API to get a list of comments for a video.
The problem is that the field authorProfileImageUrl in the response contains a URL to a tiny thumbnail (28x28 pixels) of the profile image instead of the bigger one (48x48) that can be seen in YouTube's comment section. How can I retrieve the bigger one? Am I missing some magic parameter in the request that selects the size of the profile images in comments?
Here's my request URL:
https://www.googleapis.com/youtube/v3/commentThreads?videoId=VIDEO_ID&part=snippet&fields=pageInfo,items(snippet(topLevelComment(id,snippet(authorDisplayName,authorChannelUrl,authorProfileImageUrl,authorChannelId,textDisplay,likeCount,publishedAt)),totalReplyCount))&maxResults=3&key=API_KEY
Edit:
Here's an example profile pic URL i get:
https://yt3.ggpht.com/-b-fXZSZ0hPw/AAAAAAAAAAI/AAAAAAAAAAA/mq4JpF46xq4/s28-c-k-no-mo-rj-c0xffffff/photo.jpg
^^
I noticed that the marked part seems to select the size, because when I change the 28 to 48, the size of the profile pic changes too.
I could change it "manually" with some fancy regexp, and it will work, but it will also rely on implementation details that are undocumented and that may change in future and render the application broken :P So it really would be better if there was a documented API way to do that.
Seems like nobody knows how to solve this, ho here's my temporary solution.
It works, but it depends on an implementation detail that can change in the future and then the solution will break apart and will have to be corrected :q
I accept my own answer for now, but when someone posts a better one, I'll accept it instead.
The solution:
I made a simple function that searches for the image size in the URL string and replaces it with a bigger size.
function small2big(url)
{
return url.replace(/(\/.*s)28(.*\/photo.jpg)$/,"$1"+"48"+"$2");
}
Oh, and here's my middle finger for you, Google: ,,|,,
It seems that actually removing everything right at the 's28' will display the entire image without specifying a size.
For example, instead of this:
https://yt3.ggpht.com/-b-fXZSZ0hPw/AAAAAAAAAAI/AAAAAAAAAAA/mq4JpF46xq4/s28-c-k-no-mo-rj-c0xffffff/photo.jpg
You can use this: https://yt3.ggpht.com/-b-fXZSZ0hPw/AAAAAAAAAAI/AAAAAAAAAAA/mq4JpF46xq4/
And it will return the full size image.
In my case, using php I simply:
function bigAvatar($url) {
$url = substr($url, 0, strpos($url, 's28'));
return $url;
}
Again, if google decides to change this in the future, this would break. But for now, it works.

How to use bell character (BEL, CTRL-G, \x07) with xterm.js?

How do I add use the bell character with Xterm.js? I see a couple of entries in the sources 'options' defaults, but dont get anything whether i send it from the shell or write it directly to the terminal, even with those set to true. I tried overloading the term.bell function with one containing a window.navigator.vibrate, and that works if I call it directly, but doesnt fire in response to a bell character.
Ok. So testing determined nothing is blocking the bell character ("\x07" or "\u0007") from getting through to xterm.js. It just doesnt respond, even if you enable the flags in the options. The code in the source looks like it should work, but something internal is not connected. Since I am avoiding actual changes to the source to make upgrades to xterm.js straightforward and out of the box, I worked a little magic. Here's a hack to get the bell character working:
Make a function that fires on the "message" event from your websocket. In it, check for a match for BEL. Then have it do your voodoo if it detects it. Something like:
sock.addEventListener('message',function(v){ if(v.match(/\x07/)){ /*voodoo here*/ } });
Where v is event, \x07 is BEL, and voodoo is code or an invocation to blip the screen white briefly, make a chirp, vibrate if your getting around on "mobile", or open a portal to the single-sock dimension.
Annoyingly, now I need to look up more ansi codes and find a pattern, as some end in a BEL character. So this will work by itself, but will be set off by some codes not intended to act as BEL, because they contain that character. More on this later....
FYI, not sure if this works with term.attach(). I have my own thing that does some preprocessing anyway, so basically all I had to do was splice in the if/match, but cut that out, the above code is the minimal cut-paste version.
Hope this helps someone else. Bug out.

How do I link to a LABEL in org-mode?

In org-mode, I have defined a figure+caption like this:
#+CAPTION: My great figure
#+LABEL: fig:myfigure
[[myfigure.png]]
How do I write "See figure [myfigure]"? I've found the following syntax:
See figure \ref{fig:myfigure}
but this looks ugly in the source file. In particular, you cannot use it for actually jumping to the figure.
You actually don't need '#+NAME', it works fine if you use '#+LABEL', which won't break your short-caption for list of figures.
Orgmode does now offer a 'jumpable', enumerated or link with name of your choice in the exported (latex, html) text if you link with:
see figure [[fig:myfigure]].
or
see figure [[fig:myfigure][figurenameintext]].
I would have added this as a comment, but I don't have the reputation yet.
--
In response to your comment (still can't comment): you do need the '#+NAME' for it to jump within the .org source file; as mentioned in the manual, and i also just confirmed that works. Not sure about the short-captions in the latest version.
With a very recent org-mode, you can use #+name:, see:
http://thread.gmane.org/gmane.emacs.orgmode/62644/focus=62646
#+CAPTION: My great figure
#+LABEL: fig:myfigure
#+name: fig:myfigure
[[test.png]]
See figure [[fig:myfigure][test]].
This works for me to jump from the link , but has no effect when exporting, I'm afraid...

Resources