/** * WalkModList callback. * * @returns WR_CONTINUE * @param mh The module. * @param _idx Pointer to the current module index. */ static walk_result ModCallback( mod_handle mh, void *_idx ) { int *idx = (int *)_idx; char buff[2048]; unsigned len; const char *lang; address addr = {0}; printf( "%5d ", ++*idx ); /* address */ addr = ModAddr( mh ); printf( "%04x:%08lx ", addr.mach.segment, (long)addr.mach.offset ); /* what info do we have? */ printf( "%c%c%c%c ", ModHasInfo( mh, HK_IMAGE ) == DS_OK ? 'I' : '-', ModHasInfo( mh, HK_TYPE ) == DS_OK ? 'T' : '-', ModHasInfo( mh, HK_CUE ) == DS_OK ? 'C' : '-', ModHasInfo( mh, HK_SYM ) == DS_OK ? 'S' : '-' ); /* language and name */ lang = ModSrcLang( mh ); len = ModName( mh, buff, sizeof(buff) ); if( len == 0 ) { buff[0] = '\0'; } printf( "%-4s %s\n", lang, buff ); return( WR_CONTINUE ); }
static bool ProcPending( void ) { for( ;; ) { for( ;; ) { if( InpStack == NULL ) return( FALSE ); if( InpStack->type & INP_NEW_LANG ) { InpStack->type &= ~INP_NEW_LANG; if( (CodeAddrMod != NO_MOD) && !IsInternalMod( CodeAddrMod ) ) { NewLang( ModSrcLang( CodeAddrMod ) ); } } if( InpStack->type & INP_STOP_PURGE ) return( FALSE ); if( InpStack->type & INP_NO_CMD ) break; if( CurrToken == T_LINE_SEPARATOR ) break; _SwitchSet( SW_CMD_INTERACTIVE, !(InpStack->type & (INP_BREAK_POINT|INP_HOOK))); _SwitchSet( SW_IN_REPLAY_MODE, (InpStack->type & INP_REPLAYED) ); ProcACmd(); } if( InpStack->rtn( InpStack->handle, INP_RTN_EOL ) ) continue; PopInpStack(); } }