jennico Posted January 3, 2009 Share Posted January 3, 2009 (edited) when i search icons, let's say in shell32.dll the autoit way (negative and positive ordinals), how can i retrieve where to stop the search (what is the highest iconnumber ? despite of all gaps i want to keep on searching to the really last one. i searched the forum examples, but no script seems to find the really last one. anyone knows ? thx j. Edited January 3, 2009 by jennico Spoiler I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.Don't forget this IP: 213.251.145.96 Link to comment Share on other sites More sharing options...
jennico Posted January 3, 2009 Author Share Posted January 3, 2009 (edited) from here: using System.Runtime.InteropServices; Get Icon Count From ExtractIconEx WinAPI This code snippet demonstrates how to get the total number of Icons in a DLL file. public extern static int ExtractIconEx(string libName, int iconIndex, IntPtr[] largeIcon, IntPtr[] smallIcon, int nIcons); int icons = ExtractIconEx("shell32.dll", 0, null, null, 0); MessageBox.Show(icons.ToString()); now translate it... Edited January 3, 2009 by jennico Spoiler I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.Don't forget this IP: 213.251.145.96 Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 3, 2009 Moderators Share Posted January 3, 2009 from here:now translate it...Would you like to super size that order? Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
jennico Posted January 3, 2009 Author Share Posted January 3, 2009 (edited) .... #Include <WinAPI.au3> MsgBox(0,"",_WinAPI_ExtractIconEx("shell32.dll",-1,0,0,0)) ..... just loudly thinking, the order was for myself. keep calm, smoke_n .... Edited January 3, 2009 by jennico Spoiler I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.Don't forget this IP: 213.251.145.96 Link to comment Share on other sites More sharing options...
BrettF Posted January 3, 2009 Share Posted January 3, 2009 (edited) Not that hard. $file = @SystemDir & "\shell32.dll" $ret = DllCall ("shell32.dll", "int", "ExtractIconEx", "str", $file, "int", -1, "hwnd", "", "hwnd", "", "uint", "") MsgBox (0, "", $ret[0]) Cheers, Brett EDIT: I see it is in WinAPI.au3.... Edited January 3, 2009 by BrettF Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
jennico Posted January 3, 2009 Author Share Posted January 3, 2009 one question is left: i hope this equals the number autoit gets out of the dll by pulling pos and neg ordinals. i will have to count them, no ? j. Spoiler I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.Don't forget this IP: 213.251.145.96 Link to comment Share on other sites More sharing options...
jennico Posted January 3, 2009 Author Share Posted January 3, 2009 (edited) one question is left: i hope this equals the number autoit gets out of the dll by pulling pos and neg ordinals. i will have to count them, no ?j.i am afraid, no !!!as i suspected, the number is differente.g. for "zipfldr.dll", ExtractIconEx says 7 icons, but i can extract at least 25:ordinal 0ordinal -1ordinal -2ordinal -3ordinal -4ordinal -5ordinal -6ordinal -7ordinal 101ordinal 123ordinal 170ordinal 10202ordinal 10203ordinal 32513ordinal 32515ordinal 65637ordinal 65659ordinal 65706ordinal 75738ordinal 75739ordinal 98049ordinal 98051ordinal 131173ordinal 131175ordinal 131242... (seems endless)what now ? that's too badmaybe the number excludes repetitions ? Edited January 3, 2009 by jennico Spoiler I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.Don't forget this IP: 213.251.145.96 Link to comment Share on other sites More sharing options...
jennico Posted January 3, 2009 Author Share Posted January 3, 2009 (edited) i found another example:the file "shdocvw.dll" : ExtractIconEx says it contain 35 icons. but in reality there are only 23 different icons.$file = @SystemDir & "\shdocvw.dll" $ret = DllCall ("shell32.dll", "int", "ExtractIconEx", "str", $file, "int", -1, "hwnd", "", "hwnd", "", "uint", "") MsgBox (0, "", $ret[0])that's what i suspected: this is not a good way to get the icon count. but is there another one ?any idea ?j. Edited January 3, 2009 by jennico Spoiler I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.Don't forget this IP: 213.251.145.96 Link to comment Share on other sites More sharing options...
ProgAndy Posted January 3, 2009 Share Posted January 3, 2009 (edited) There are 34 icons plus 1 empty icon in this file, but some icons are included multiple times in there. //Edit: Strange. if you use The ordinal icon value, the first icon is shown mutliple times. If you open the file with reshacker, there are many empty icon groups, not multiple entries for the first icon. Edited January 3, 2009 by ProgAndy *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes Link to comment Share on other sites More sharing options...
trancexx Posted January 3, 2009 Share Posted January 3, 2009 Missing icons are manually deleted from RT_GROUP_ICON resources. What's left is only the mention of them.Great findings!I will update my reshacker wannabe (viewer currently) to meet this. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
jennico Posted January 3, 2009 Author Share Posted January 3, 2009 (edited) that's not all. ExtractIconEx is supposed to return the icon count without duplicates (there are many many more if you count duplicates."shdocvw.dll" is said to have 35 icons. there are only 23:"NAME", not ordinal number01 does not exist (it is not empty !)234 does not exist (it is not empty !)56-9 do not exist (not empty !)1011121314-15 do not exist (not empty !)1617 does not exist (it is not empty !)1819202122232425262728 => is identical to 10 !29303132-34 are empty !so, missing RT_GROUP_ICON groups is not the reason."shdocvw.dll" is not an exception. mmsys.cpl and netshell.dll, shell32.dll, newdev.dll..., they all have "false" entries.i am just trying to get an understanding of resources, but it seems complicated.j. Edited January 3, 2009 by jennico Spoiler I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.Don't forget this IP: 213.251.145.96 Link to comment Share on other sites More sharing options...
jennico Posted January 3, 2009 Author Share Posted January 3, 2009 i will have to test if ExtractIconEx at least returns the max limit for searching (you can sort the empty/missing out with PixelChecksum (i do not see a better method)), but i fear there could be more icons beyond this limit. j. Spoiler I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.Don't forget this IP: 213.251.145.96 Link to comment Share on other sites More sharing options...
trancexx Posted January 3, 2009 Share Posted January 3, 2009 that's not all. ExtractIconEx is supposed to return the icon count without duplicates (there are many many more if you count duplicates."shdocvw.dll" is said to have 35 icons. there are only 23:"NAME", not ordinal number01 does not exist (it is not empty !)234 does not exist (it is not empty !)56-9 do not exist (not empty !)1011121314-15 do not exist (not empty !)1617 does not exist (it is not empty !)181920212223242526272829303132-34 are empty !so, missing RT_GROUP_ICON groups is not the reason."shdocvw.dll" is not an exception. mmsys.cpl and netshell.dll, shell32.dll, newdev.dll..., they all have "false" entries.i am just trying to get an understanding of resources, but it seems complicated.j.They are not missing, they are missing!Entry is there but points to nothing. RT_GROUP_ICON does not contain actuall icon data (that is stored in RT_ICON to which RT_GROUP_ICON points). Authors (modifiers) of that dlls decided to preserve that RT_GROUP_ICON entries probably not to lose the count when using ordinals to extract icons for backward compatibility. And apparently in that cases, first icon (0) will be extracted instead of that one (that does not exists any more). ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
jennico Posted January 4, 2009 Author Share Posted January 4, 2009 hmm..hmm.. i will have to go deeper into this forest. j. Spoiler I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.Don't forget this IP: 213.251.145.96 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now