News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Christmas Wish - Hxi and Hxs to .hlp file

Started by Magnum, December 02, 2012, 10:07:19 AM

Previous topic - Next topic

Magnum

Quote from: CommonTater on December 02, 2012, 01:10:04 PM
Quote from: Magnum on December 02, 2012, 10:07:19 AM
It would be real nice if we could hit F1 when on InputBlock and get  popup info on the API.

But it probably would not be easy converting those Hxi and Hxs files to a big .hlp file.

In which IDE?

I just finished an addin for Pelles POIDE which will let you do just that... directly launches the SDK's DEXPLORE.EXE program with keyword lookup...  You can get the addin ... HERE (also attached below)  Its C code but it's not complex, so it should be possible to take the way it's done and adapt it to other IDE's without too much trouble...  So long as you have access to the keyword under the cursor, it should work.

The command line is a pain but it's not unmanageable...

<path to dexplore.exe> /HELPCOL <location information> /LAUNCHFKEYWORDTOPIC <Keyword>

You can get a look at the /helpcol info for your installation by right clicking the SDK Documentation in your start menu and selecting properties...

In Canada/English it is ...  MS-Help://MS.W7SDK.1033 ... but it will be different in Europe, Asia, etc.

For Canada, on Win7 x64 ...

C:\Program Files (x86)\Common Files\microsoft shared\Help 9\dexplore.exe /helpcol MS-Help://MS.W7SDK.1033 /launchfkeywordtopic

So, when looking up FindFirstFile the complete command line is...

C:\Program Files (x86)\Common Files\microsoft shared\Help 9\dexplore.exe /helpcol MS-Help://MS.W7SDK.1033 /launchfkeywordtopic FindFirstFile


It shouldn't be too much trouble to cobble up a Tool, plugin, addon or whatever with this info in hand.

CommonTater,

Thanks, I may install Pelles POIDE and see if it can load up an .asm file and see if your plugin will work in it.

I was surprised that the help files take up 208 Mb for the 2005 SDK, bu t it's worth it to not have to search online
for it.

M.S. is exactly "Johnie on the spot" about making some of their files and programs efficient in terms of size.  ::)

Andy
Take care,
                   Andy

Ubuntu-mate-18.04-desktop-amd64

http://www.goodnewsnetwork.org

TouEnMasm

Dexplore first step to read hxs and hxi files can be found here:
http://www.mcbsys.com/techblog/2011/06/install-microsoft-document-explorer/
There is two others(free) readers
Fa is a musical note to play with CL

Magnum

ToutEnMasm,

I already use dexplore to read those help files.
Maybe those .hxi and .hxs files need some kind of packer.  :biggrin:

Andy
Take care,
                   Andy

Ubuntu-mate-18.04-desktop-amd64

http://www.goodnewsnetwork.org

TouEnMasm

You are not alone in this forum interested by the subject  :biggrin:
Fa is a musical note to play with CL

TouEnMasm

#19
If you don't like dexplore,there is also
http://www.donkeysstable.com/
http://helpware.net/mshelp2/h2viewer.htm
the h2viewer accept the F1 key,this allow me to have the ddk help + my perso help library + the masm32 help(s) files,all in one file.Want More !?
If you want a complet help2 system without visual studio,just ask,i will help you.

Fa is a musical note to play with CL

Magnum

Yes, I would like your help.

All the files that dexplore uses are here.
C:\Program Files\Microsoft Platform SDK\Help

It would be nice if I could open an asm source code on Qeditor or any editor, and hit F1 on the NtQueryInformationProcess
and it would go to the function using dexplore.

call NtQueryInformationProcess ; Still undocumented, even though it's been around for quite a while ?

Andy
Take care,
                   Andy

Ubuntu-mate-18.04-desktop-amd64

http://www.goodnewsnetwork.org

TouEnMasm

I have not made it with dexplore but with the H2viewer.
The H2viewer had an interface named H2help.
I can search if dexplore had one but h2viewer offer better soluce than dexplore for the F1 key.
Later:
With dexplore and the help2 interface i find only ...my source code.
perhaps you can find more.
The soluce for me is to use the h2viewer instead.
The link is in french and a little old,seems without answer other mine.
http://www.asmfr.com/codes/DEXPLORE-INTERFACE-HELP2-MICROSOFT-DOCUMENT-EXPLORER_49159.aspx
Fa is a musical note to play with CL

Magnum

I might as well see if I can make a plugin for Qeditor that would use the F2 key to find context help using dexplore or h2viewer.

I need to learn to write a dll anyway.

Andy
Take care,
                   Andy

Ubuntu-mate-18.04-desktop-amd64

http://www.goodnewsnetwork.org

jj2007

Quote from: Magnum on December 03, 2012, 05:49:01 AM
I might as well see if I can make a plugin for Qeditor that would use the F2 key to find context help

Although your attempt to make xHelp run was unsuccessful, you might have a file \Masm32\plugins\xHelpQE.asc - to be opened in WordPad or Ms Word. You can replace the MasmBasic stuff with good ol' Masm32, and use it as a template. QE plugins are actually very simple to write.

CommonTater

Quote from: jj2007 on December 03, 2012, 03:22:27 AM
Quote from: CommonTater on December 03, 2012, 03:02:37 AM
Oh come on, Help9 is not that bad... It's a big old reference book with a keyword index, table of contents and a very powerful search tool built right in...  All you gotta do is stop hating it long enough to learn how to actually use it ... Just like C or C++.

And FWIW... Yes I do --absolutely-- want the latest and most exotic API calls at my disposal.  The Windows API is some 30,000 functions and I can't think of a single reason why I should ignore even one of them...

Get one of your fat sources, and count how many different API calls you used. Probably no more that 500. And yes, it's good to have the other 29,500 "at your disposal", and why not wait ten seconds until Help9 is ready to answer, in case you really, really need something completely new and exotic?

Yes, and the odds are 150 to 200 of those 500 it will be a different in every application.

Typical load time on my system, from pressing F1 to seeing the call documentation is under a second.

If you follow the link I gave to Pelles Forums, you will find a link to a version of the SDK that installs directly on your local hard drive and is much faster than the patched up on-line version ... by orders of magnitude.

Quote
But for the 50 bread-and-butter functions that we really use, the response time should be in the milliseconds range (a toolhelp bubble would be fine...), and the info should be delivered as elegantly as Google does it.

Naaaa... pressing F1 should take you straight to the function... not to a list of warez sites trying to get you to download viruses of the same name.  (FWIW .... my example FindNextFile search returns 165,000 results... Dexplore simply shows me the function)


Quote
Quote from: CommonTater on December 03, 2012, 03:05:14 AMNeither the program nor the sfx database have manifests in them so the UAC was freaking out all over it.

Thanks for reminding me, maybe I should try that one day. Although I never had problems on my Win7-64 installation (maybe they have realised that virus coders can write manifests, too  :greensml:)

Well, if you don't want your files triggering UAC and getting Virtualized into mysterious hidden folders, you need a manifest in everything these days. 

CommonTater

Quote from: Magnum on December 03, 2012, 03:37:39 AM
Thanks, I may install Pelles POIDE and see if it can load up an .asm file and see if your plugin will work in it.

I was surprised that the help files take up 208 Mb for the 2005 SDK, bu t it's worth it to not have to search online
for it.

Download THIS version of the SDK ... not some antique... I know it works.


It's a fairly large download... Burn or rip the ISO and run the setup program... select Custom Install and only put in the SDK documenation for Win32 and Desktop... You don't need to install anything else for this to work.

POIDE is a pretty good IDE... lots of built in stuff right on hand... Install the addin from the forum's AddIns section ... fix the location stuff as I descriped and it should work.

Vortex can give you the lowdown on hooking POIDE up to ASM so you can try things out....  But you should be able to just open a blank page (ctrl - n) and type in an api call's name ... such as MessageBox ... then hit F1 to see it work.

From there it's just a matter of adapting it to QEdit...

FWIW... a lot of people have been reinventing this particular wheel because the documentation for dexplore is pee-poor... I think it's better to make the effort and get the real deal working....

CommonTater

Quote from: ToutEnMasm on December 03, 2012, 03:48:31 AM
Dexplore first step to read hxs and hxi files can be found here:
http://www.mcbsys.com/techblog/2011/06/install-microsoft-document-explorer/
There is two others(free) readers

Ok.. there are two versions of the SDK ... the one I've been linking to is an ISO download that runs almost entirely from the local hard drives.  It only goes online when it can't find the keyword in the command line.  It's very fast and the documentation is very complete ... Matched to Win7 ... not Vista or 2005 or XP... so it's pretty much right up to date.

The other version (the one with .net 4) is wired up to go online for almost everything.  Lose your internet connection and you are effectively out of the game.  It's slower, but it does get the very most recent information. 

Obviously you will want the first one for the command lines I've shown in my earlier messages.

CommonTater

Quote from: Magnum on December 03, 2012, 04:39:42 AM
It would be nice if I could open an asm source code on Qeditor or any editor, and hit F1 on the NtQueryInformationProcess
and it would go to the function using dexplore.

Ok... tried that... Got this in under a second....


NtQueryInformationProcess Function
[NtQueryInformationProcess may be altered or unavailable in future versions of Windows. Applications should use the alternate functions listed in this topic.]


Retrieves information about the specified process.


Syntax
NTSTATUS WINAPI NtQueryInformationProcess(
  __in       HANDLE ProcessHandle,
  __in       PROCESSINFOCLASS ProcessInformationClass,
  __out      PVOID ProcessInformation,
  __in       ULONG ProcessInformationLength,
  __out_opt  PULONG ReturnLength
);

Parameters
ProcessHandle [in]
A handle to the process for which information is to be retrieved.

ProcessInformationClass [in]
The type of process information to be retrieved. This parameter can be one of the following values from the PROCESSINFOCLASS enumeration.

Value Meaning
ProcessBasicInformation
0 Retrieves a pointer to a PEB structure that can be used to determine whether the specified process is being debugged, and a unique value used by the system to identify the specified process.

It is best to use the CheckRemoteDebuggerPresent and GetProcessId functions to obtain this information.

ProcessDebugPort
7 Retrieves a DWORD_PTR value that is the port number of the debugger for the process. A nonzero value indicates that the process is being run under the control of a ring 3 debugger.

It is best to use the CheckRemoteDebuggerPresent or IsDebuggerPresent function.

ProcessWow64Information
26 Determines whether the process is running in the WOW64 environment (WOW64 is the x86 emulator that allows Win32-based applications to run on 64-bit Windows).

It is best to use the IsWow64Process function to obtain this information.

ProcessImageFileName
27 Retrieves a UNICODE_STRING value containing the name of the image file for the process.

ProcessInformation [out]
A pointer to a buffer supplied by the calling application into which the function writes the requested information. The size of the information written varies depending on the data type of the ProcessInformationClass parameter:


PROCESS_BASIC_INFORMATION
When the ProcessInformationClass parameter is ProcessBasicInformation, the buffer pointed to by the ProcessInformation parameter should be large enough to hold a single PROCESS_BASIC_INFORMATION structure having the following layout:

typedef struct _PROCESS_BASIC_INFORMATION {
    PVOID Reserved1;
    PPEB PebBaseAddress;
    PVOID Reserved2[2];
    ULONG_PTR UniqueProcessId;
    PVOID Reserved3;
} PROCESS_BASIC_INFORMATION;

The UniqueProcessId member points to the system's unique identifier for this process. It is best to use the GetProcessId function to retrieve this information.

The PebBaseAddress member points to a PEB structure.

The other members of this structure are reserved for internal use by the operating system.

ULONG_PTR
When the ProcessInformationClass parameter is ProcessWow64Information, the buffer pointed to by the ProcessInformation parameter should be large enough to hold a ULONG_PTR. If this value is non-zero, the process is running in a WOW64 environment; otherwise, if the value is equal to zero, the process is not running in a WOW64 environment.

It is best to use the IsWow64Process function to determine whether a process is running in the WOW64 environment.

UNICODE_STRING
When the ProcessInformationClass parameter is ProcessImageFileName, the buffer pointed to by the ProcessInformation parameter should be large enough to hold a UNICODE_STRING structure as well as the string itself. The string stored in the Buffer member is the name of the image file.

If the buffer is too small, the function fails with the STATUS_INFO_LENGTH_MISMATCH error code and the ReturnLength parameter is set to the required buffer size.



ProcessInformationLength [in]
The size of the buffer pointed to by the ProcessInformation parameter, in bytes.

ReturnLength [out, optional]
A pointer to a variable in which the function returns the size of the requested information. If the function was successful, this is the size of the information written to the buffer pointed to by the ProcessInformation parameter, but if the buffer was too small, this is the minimum size of buffer needed to receive the information successfully.

Return Value
The function returns an NTSTATUS success or error code.

The forms and significance of NTSTATUS error codes are listed in the Ntstatus.h header file available in the DDK, and are described in the DDK documentation under Kernel-Mode Driver Architecture / Design Guide / Driver Programming Techniques / Logging Errors.

Remarks
The NtQueryInformationProcess function and the structures that it returns are internal to the operating system and subject to change from one release of Windows to another. To maintain the compatibility of your application, it is better to use public functions mentioned in the description of the ProcessInformationClass parameter instead.

If you do use NtQueryInformationProcess, access the function through run-time dynamic linking. This gives your code an opportunity to respond gracefully if the function has been changed or removed from the operating system. Signature changes, however, may not be detectable.

This function has no associated import library. You must use the LoadLibrary and GetProcAddress functions to dynamically link to Ntdll.dll.

Requirements
Header Winternl.h
DLL Ntdll.dll

See Also
CheckRemoteDebuggerPresent
GetProcessId
IsDebuggerPresent
IsWow64Process


Send comments about this topic to Microsoft

Build date: 5/29/2009



jj2007

Quote from: CommonTater on December 03, 2012, 06:00:11 AM
Well, if you don't want your files triggering UAC and getting Virtualized into mysterious hidden folders, you need a manifest in everything these days.

Will reflect on it ;-)

By the way, dexplorer just greeted me with this:
Microsoft Document Explorer has encountered a problem and needs to close.
Probably some tiny buffer overflow problem :icon_mrgreen:

Magnum

I tried dling just the help documentation but it seemed like it wasn't doing anything.

When M.S. downloads and installs things with no details, Eye starting wondering if they are "going thru my fridge without asking."

Now I am downloading the iso.

Maybe I can extract only the help files without doing any kind of installation.

Andy
Take care,
                   Andy

Ubuntu-mate-18.04-desktop-amd64

http://www.goodnewsnetwork.org