Alzri2 Posted April 30, 2015 Posted April 30, 2015 Hi, Is there a way to open a chm file in the index tab and write something there ? Well, OllyDBG 2.01 does that ... I tried to debug it but couldn't figure out how it does thatbp on 0049A8F1 and use "Help on API function" from the R click menu to break on it. This is the code I tried in ASM: .data libN db "HHCTRL.OCX", 0 funcN db "HtmlHelpA", 0 ;unicode HtmlHelpW path db "D:\WinApi.chm", 0 val db 20h, 0 DeskHWND dd ? .code start: invoke GetDesktopWindow mov DeskHWND, eax invoke LoadLibrary, addr libN invoke GetProcAddress, eax, addr funcN push offset val push 0Dh push offset path push DeskHWND ; could be NULL call eax invoke ExitProcess, 0 end start
simple Posted April 30, 2015 Posted April 30, 2015 dont know what "open chm in index tab & write something there means" but to display a .chm in the "html browser" this works for me. push 0 push 0 ; HH_DISPLAY_TOPIC push offset path push DeskHWND call eax 1
Alzri2 Posted April 30, 2015 Author Posted April 30, 2015 (edited) Thanks ... works like a charm only ExitProcess invoke needs to be omitted Still, I want to write something in the index after opening the file cuz I'm writing a plugin for x64dbg, OllyDBG, and (maybe) IDA pro This is how Olly works as u know : http://postimg.org/image/4q8fits3p/ Do u have any idea on how to do so ? Edited April 30, 2015 by Alzri2
simple Posted April 30, 2015 Posted April 30, 2015 (edited) use HTML Help Workshop. just briefly tried & looks like to create custom index (w/tab view in left pane) u just create an index file & compile in ur project. tons of info on this. https://msdn.microsoft.com/en-us/library/windows/desktop/ms644604%28v=vs.85%29.aspx edit - u can also use htmlhelp.lib from the html help SDK instead of dynamically loading it Edited April 30, 2015 by simple 1
Alzri2 Posted April 30, 2015 Author Posted April 30, 2015 Ollydbg 2.01 can simply open the chm and write the function name in the index tab without all of that (it doesn't create any index or smth cuz the chm browser creates this file automatically)Is there a simple way ?
Alzri2 Posted April 30, 2015 Author Posted April 30, 2015 thanks Dreamer, but what u've posted is an independent chm viewer ... I'm looking for a way to launch a chm file using the windows html viewer
atom0s Posted May 1, 2015 Posted May 1, 2015 If the file type is known to the system you should just be able to use ShellExecute to open it. 1
kao Posted May 1, 2015 Posted May 1, 2015 0Dh is HH_KEYWORD_LOOKUP command. So, study the MSDN topic and pass a correct structure to HtmlHelp, not just a dummy value of 20h. As simple as that. 1
Alzri2 Posted May 5, 2015 Author Posted May 5, 2015 (edited) simple: I didn't import htmlhelp.lib cuz I don't like to import a whole library to get only one var ! @atom0s: ShellExecute would only open the file as the user normally does, which means there won't be anything written in the index tab. I can then wait for the chm viewer window and add smth using SendMessage. But, it would be hyper ugliness code kao: Do u really think I would pass an argument randomly ?!! As I said, I ripped the code above from Olly 2.01, but it doesn't work properly as it does in Olly. whenever I have the time, I'll try another way Edited May 5, 2015 by Alzri2
kao Posted May 6, 2015 Posted May 6, 2015 Did you actually read my suggestion and look at that MSDN topic? You ripped some data but that was not enough.
Alzri2 Posted May 6, 2015 Author Posted May 6, 2015 Sure I did. But, I haven't tried it yet ... Btw it looks like it will show the search tab instead of showing the index tab if I passed that arg.Anyway, as I said, I'll try it once i have the time.
Alzri2 Posted May 6, 2015 Author Posted May 6, 2015 (edited) As I said, I did it in an another way ... I wrote it in C++ cuz I couldn't pass a dword value in ASM Here is a working code: int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow){ typedef INT (CALLBACK* LPFNDLLFUNC1)(HWND, LPCTSTR, UINT, DWORD); HINSTANCE hDLL; // Handle to DLL LPFNDLLFUNC1 lpfnDllFunc1; // Function pointer UINT valS = 32; hDLL = LoadLibrary("HHCTRL.OCX"); if (hDLL != NULL) { lpfnDllFunc1 = (LPFNDLLFUNC1)GetProcAddress(hDLL, "HtmlHelpA"); if (!lpfnDllFunc1) { FreeLibrary(hDLL); return 0; }else{ lpfnDllFunc1(GetDesktopWindow(), "D:\\WinApi.chm", 0x0002, //HH_DISPLAY_INDEX (DWORD)"MessageBox"); while (true){} // just don't exit } } return 0; }; Edited May 6, 2015 by Alzri2
simple Posted May 6, 2015 Posted May 6, 2015 Not all the time, but in that case a dword cast means the address in binary db MBString "MessageBox", 0 ... push offset MbString push 2 push offset path push DeskHWND call eax 1
LCF-AT Posted May 7, 2015 Posted May 7, 2015 Hi guys, I have a little question.Can anybody tell me where to find API references files (offline versions to use without internet access) about almost all APIs?Normaly I just use win32.hlp (24 MB) but I also wanna know whether there are also others to download like documentations about VB & Msvcrt API's etc (also in hlp or chm).If you know some then it would be nice if you could post some links where I can download them. PS: Sorry for asking on your topic Alzri2 but on your picture I have seen you do use any other MSDN Lite reference (I don't know this one). Thank you
Alzri2 Posted May 7, 2015 Author Posted May 7, 2015 No problem to ask here at all Well, u don't how much time I spent on compiling this help I have converted help files of win7 sdk into a chm file just for the purpose mentioned in this topic (make plugins). Sure, I will upload it with the plugins once I have the time. 1
LCF-AT Posted May 8, 2015 Posted May 8, 2015 Hi Alzri2, thanks first. Sounds good if you could upload all files for us. I also like hlp files a bit more than chm files but anyway so its just important to have some extern offline documentation. Oh and if you also know or have any (extern / offline) VB & Msvcrt API documentation then upload them too if possible.No idea why I can't find anything about these on the internet to download. PS: Good luck with your plugin. Thank you
Alzri2 Posted May 9, 2015 Author Posted May 9, 2015 (edited) Chm files are much better than hlp files ... one of many advantages is supporting Win vista/7/8/8.1 (without any updates from MS) Don't know about VB. But, is there information about it in the online MSDN ? If so, you might find info about it in the chm file as well. Edited May 9, 2015 by Alzri2
SkyProud Posted September 9, 2015 Posted September 9, 2015 Two FireFox add-ons to open .chm file: https://addons.mozilla.org/en-us/firefox/addon/chmfox/https://addons.mozilla.org/en-us/firefox/addon/chm-reader/
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