DBGPlugInOS2.cpp revision 19d2bd74156f55ea7fd654c35cc421abb0dc55cf
af062818b47340eef15700d2f0211576ba3506eevboxsync * DBGPlugInOS2 - Debugger and Guest OS Digger Plugin For OS/2.
af062818b47340eef15700d2f0211576ba3506eevboxsync * Copyright (C) 2009-2013 Oracle Corporation
af062818b47340eef15700d2f0211576ba3506eevboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
af062818b47340eef15700d2f0211576ba3506eevboxsync * available from http://www.virtualbox.org. This file is free software;
af062818b47340eef15700d2f0211576ba3506eevboxsync * you can redistribute it and/or modify it under the terms of the GNU
af062818b47340eef15700d2f0211576ba3506eevboxsync * General Public License (GPL) as published by the Free Software
af062818b47340eef15700d2f0211576ba3506eevboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
af062818b47340eef15700d2f0211576ba3506eevboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
af062818b47340eef15700d2f0211576ba3506eevboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
af062818b47340eef15700d2f0211576ba3506eevboxsync/*******************************************************************************
af062818b47340eef15700d2f0211576ba3506eevboxsync* Header Files *
af062818b47340eef15700d2f0211576ba3506eevboxsync*******************************************************************************/
af062818b47340eef15700d2f0211576ba3506eevboxsync#define LOG_GROUP LOG_GROUP_DBGF ///@todo add new log group.
af062818b47340eef15700d2f0211576ba3506eevboxsync/*******************************************************************************
af062818b47340eef15700d2f0211576ba3506eevboxsync* Structures and Typedefs *
af062818b47340eef15700d2f0211576ba3506eevboxsync*******************************************************************************/
af062818b47340eef15700d2f0211576ba3506eevboxsync/** @name Internal OS/2 structures */
af062818b47340eef15700d2f0211576ba3506eevboxsync * OS/2 guest OS digger instance data.
af062818b47340eef15700d2f0211576ba3506eevboxsynctypedef struct DBGDIGGEROS2
af062818b47340eef15700d2f0211576ba3506eevboxsync /** Whether the information is valid or not.
af062818b47340eef15700d2f0211576ba3506eevboxsync * (For fending off illegal interface method calls.) */
af062818b47340eef15700d2f0211576ba3506eevboxsync /** 32-bit (true) or 16-bit (false) */
af062818b47340eef15700d2f0211576ba3506eevboxsync /** The OS/2 guest version. */
af062818b47340eef15700d2f0211576ba3506eevboxsync /** Guest's Global Info Segment selector. */
af062818b47340eef15700d2f0211576ba3506eevboxsync/** Pointer to the OS/2 guest OS digger instance data. */
af062818b47340eef15700d2f0211576ba3506eevboxsync/*******************************************************************************
af062818b47340eef15700d2f0211576ba3506eevboxsync* Defined Constants And Macros *
af062818b47340eef15700d2f0211576ba3506eevboxsync*******************************************************************************/
af062818b47340eef15700d2f0211576ba3506eevboxsync/** The 'SAS ' signature. */
af062818b47340eef15700d2f0211576ba3506eevboxsync#define DIG_OS2_SAS_SIG RT_MAKE_U32_FROM_U8('S','A','S',' ')
af062818b47340eef15700d2f0211576ba3506eevboxsync/** OS/2Warp on little endian ASCII systems. */
af062818b47340eef15700d2f0211576ba3506eevboxsync#define DIG_OS2_MOD_TAG UINT64_C(0x43532f3257617270)
af062818b47340eef15700d2f0211576ba3506eevboxsync/*******************************************************************************
af062818b47340eef15700d2f0211576ba3506eevboxsync* Internal Functions *
af062818b47340eef15700d2f0211576ba3506eevboxsync*******************************************************************************/
af062818b47340eef15700d2f0211576ba3506eevboxsyncstatic DECLCALLBACK(int) dbgDiggerOS2Init(PUVM pUVM, void *pvData);
af062818b47340eef15700d2f0211576ba3506eevboxsync/*******************************************************************************
af062818b47340eef15700d2f0211576ba3506eevboxsync* Global Variables *
af062818b47340eef15700d2f0211576ba3506eevboxsync*******************************************************************************/
af062818b47340eef15700d2f0211576ba3506eevboxsync * Process a PE image found in guest memory.
af062818b47340eef15700d2f0211576ba3506eevboxsync * @param pThis The instance data.
af062818b47340eef15700d2f0211576ba3506eevboxsync * @param pUVM The user mode VM handle.
af062818b47340eef15700d2f0211576ba3506eevboxsync * @param pszName The image name.
af062818b47340eef15700d2f0211576ba3506eevboxsync * @param pImageAddr The image address.
af062818b47340eef15700d2f0211576ba3506eevboxsync * @param cbImage The size of the image.
af062818b47340eef15700d2f0211576ba3506eevboxsync * @param pbBuf Scratch buffer containing the first
af062818b47340eef15700d2f0211576ba3506eevboxsync * RT_MIN(cbBuf, cbImage) bytes of the image.
af062818b47340eef15700d2f0211576ba3506eevboxsync * @param cbBuf The scratch buffer size.
af062818b47340eef15700d2f0211576ba3506eevboxsyncstatic void dbgDiggerOS2ProcessImage(PDBGDIGGEROS2 pThis, PUVM pUVM, const char *pszName,
af062818b47340eef15700d2f0211576ba3506eevboxsync LogFlow(("DigOS2: %RGp %#x %s\n", pImageAddr->FlatPtr, cbImage, pszName));
af062818b47340eef15700d2f0211576ba3506eevboxsync /* To be implemented.*/
af062818b47340eef15700d2f0211576ba3506eevboxsync * @copydoc DBGFOSREG::pfnQueryInterface
af062818b47340eef15700d2f0211576ba3506eevboxsyncstatic DECLCALLBACK(void *) dbgDiggerOS2QueryInterface(PUVM pUVM, void *pvData, DBGFOSINTERFACE enmIf)
af062818b47340eef15700d2f0211576ba3506eevboxsync * @copydoc DBGFOSREG::pfnQueryVersion
af062818b47340eef15700d2f0211576ba3506eevboxsyncstatic DECLCALLBACK(int) dbgDiggerOS2QueryVersion(PUVM pUVM, void *pvData, char *pszVersion, size_t cchVersion)
RTStrPrintf(pszVersion, cchVersion, "%u.%u (%s)", pThis->OS2MajorVersion, pThis->OS2MinorVersion, pszOS2ProductType);
return VINF_SUCCESS;
while (iMod-- > 0)
int rc;
return VINF_SUCCESS;
return VERR_NOT_SUPPORTED;
int rc;
return VINF_SUCCESS;