Author Topic: Tools in the latest build environment.  (Read 711 times)

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 4875
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Tools in the latest build environment.
« on: October 02, 2016, 08:58:58 AM »
In the "tools64" directory there are a number of tools that should be useful writing code with ML64.

1. bin2db64.exe
   Convert any file into a compacted DB sequence so it can be written to disk from within an executable file. The main use I have had for this is storing icons and toolbars in code generators.

2. cvstrct.exe
   Convert C structures into MASM format. It is not a perfect conversion but takes much of the hack work out of the task.

3. editmake.exe
   A code generator that makes a basic editor application complete with toolbar and status bar. I use this tool for making other specialised tools that use an editor interface.

4. l2inc64.exe
   A tool for creating ML64 format include files from existing libraries. You use it by placing it in a separate directory and specifying the path of another directory on the command line.

5. mangle64.exe
   A tool to mangle text so it far harder to find in an executable file.

6. subclass64.exe
   A tool for subclassing controls. Same interface as the 32 bit version but with a ML64 compatible output.

7. tmake.exe
   A simple code generator that creates a bare window that you can write your own code in. It is mainly designed to take the hack work out of starting a window based app.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :biggrin:

jj2007

  • Member
  • *****
  • Posts: 7641
  • Assembler is fun ;-)
    • MasmBasic
Re: Tools in the latest build environment.
« Reply #1 on: October 05, 2016, 02:49:27 AM »
2. cvstrct.exe
   Convert C structures into MASM format. It is not a perfect conversion but takes much of the hack work out of the task.

A notoriously difficult task :(

Here are some examples of C structures that don't translate well. Maybe we could establish a collection of tricky ones...
Code: [Select]
typedef struct tagMIXERCONTROLA {
    DWORD           cbStruct;           /* size in bytes of MIXERCONTROL */
    DWORD           dwControlID;        /* unique control id for mixer device */
    DWORD           dwControlType;      /* MIXERCONTROL_CONTROLTYPE_xxx */
    DWORD           fdwControl;         /* MIXERCONTROL_CONTROLF_xxx */
    DWORD           cMultipleItems;     /* if MIXERCONTROL_CONTROLF_MULTIPLE set */
    CHAR            szShortName[MIXER_SHORT_NAME_CHARS];
    CHAR            szName[MIXER_LONG_NAME_CHARS];
    union {
        struct {
            LONG    lMinimum;           /* signed minimum for this control */
            LONG    lMaximum;           /* signed maximum for this control */
        } DUMMYSTRUCTNAME;
        struct {
            DWORD   dwMinimum;          /* unsigned minimum for this control */
            DWORD   dwMaximum;          /* unsigned maximum for this control */
        } DUMMYSTRUCTNAME2;
        DWORD       dwReserved[6];
    } Bounds;
    union {
        DWORD       cSteps;             /* # of steps between min & max */
        DWORD       cbCustomData;       /* size in bytes of custom data */
        DWORD       dwReserved[6];      /* !!! needed? we have cbStruct.... */
    } Metrics;
} MIXERCONTROLA, *PMIXERCONTROLA, *LPMIXERCONTROLA;
Code: [Select]
struct GdiplusStartupInput
{
    UINT32 GdiplusVersion;             // Must be 1  (or 2 for the Ex version)
    DebugEventProc DebugEventCallback; // Ignored on free builds
    BOOL SuppressBackgroundThread;     // FALSE unless you're prepared to call
                                       // the hook/unhook functions properly
    BOOL SuppressExternalCodecs;       // FALSE unless you want GDI+ only to use
                                       // its internal image codecs.
   
    GdiplusStartupInput(
        DebugEventProc debugEventCallback = NULL,
        BOOL suppressBackgroundThread = FALSE,
        BOOL suppressExternalCodecs = FALSE)
    {
        GdiplusVersion = 1;
        DebugEventCallback = debugEventCallback;
        SuppressBackgroundThread = suppressBackgroundThread;
        SuppressExternalCodecs = suppressExternalCodecs;
    }
};
Code: [Select]
struct GdiplusStartupOutput
{
    NotificationHookProc NotificationHook;
    NotificationUnhookProc NotificationUnhook;
};
Code: [Select]
struct _PACKEDEVENTINFO
{
    DWORD               ulSize; 
    DWORD               ulNumEventsForLogFile;
    DWORD               ulOffsets[];           
};
Code: [Select]
struct  hostent {
        char     * h_name;           
        char     *  * h_aliases; 
        short   h_addrtype;             
        short   h_length;               
        char     *  * h_addr_list;
};
Code: [Select]
struct sockaddr {
        u_short sa_family;             
        char    sa_data[14];           
};

See also Raymond Chen on Why do some structures end with an array of size 1?

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 4875
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: Tools in the latest build environment.
« Reply #2 on: October 05, 2016, 01:55:20 PM »
Auto converted. The commented out union and structure names are left there for tools that don't support anonymous structures and unions.

  MIXERCONTROLA STRUCT QWORD
    cbStruct dd ?
    dwControlID dd ?
    dwControlType dd ?
    fdwControl dd ?
    cMultipleItems dd ?
    szShortName db MIXER_SHORT_NAME_CHARS dup (?)
    szName db MIXER_LONG_NAME_CHARS dup (?)
      UNION
        STRUCT
        lMinimum dd ?
        lMaximum dd ?
        ENDS ; DUMMYSTRUCTNAME
        STRUCT
        dwMinimum dd ?
        dwMaximum dd ?
        ENDS ; DUMMYSTRUCTNAME2
      dwReserved dd 6 dup (?)
      ENDS ; Bounds
      UNION
      cSteps dd ?
      cbCustomData dd ?
      dwReserved dd 6 dup (?)
      ENDS ; Metrics
  MIXERCONTROLA ENDS
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :biggrin: