VB Decompiler Forum Index VB Decompiler
Hosted by TheAutomaters.com
 
  MemberlistMemberlist
 

Visual Basic 6 Compliler command line options

 
   VB Decompiler Forum Index -> The Code
Author Message
drk||Raziel
New User


Joined: 25 Aug 2004
Posts: 8
Location: Athens

Posted: Fri Aug 27, 2004 2:20 pm     Post subject: Visual Basic 6 Compliler command line options

I didn't found any info on the net so i decided to load IDA and a hexeditor..

This is what i found:

--Visual Basic 6 Compiler Options(c2) List--

-nowarn4786:?? disable warning 4786=??
-nowarn4715:?? disable warning 4715=??
-cap:??
-nodlp:??
-dlp:??
-ZX:??? needs an input file,seems to need a Object File , then complier error (internal.. error)
-ZI:/ZI enable Edit and Continue debug info(in c), seems to work
-S:?? it seems to be Display listing on screen
-dos:?? from 16 bit VB?? it is used from VB6 , not needed to complie
-Fo# : object file (-Fo"C:\myobj.obj")
-H#: external name length restriction (default 31) (c2 c++v6)
-Zl:/Zl omit default library name in .OBJ(in C) ,it seems to work
-Za:/Za disable extensions (implies /Op)(in c) , seems to have no effect...
-Zd:/Zd line number debugging info only ,seems to work
-Zi:/Zi enable debugging information (in c)
-Brepro:?? it seems to have no effect
-Bd: it seems to have no effect
-Fs#: generate a source file listing with .LST extension (c2 c++v6)
-Fa#:/Fa[file] name assembly listing file
-FA#:/FA[sc] configure assembly listing s= source , c= code bytes
-pr:??
-QIWMTemu:??
-QIfist:/QIfist[-] use FIST instead of ftol()
-QI0f:/QI0f[-] enable Pentium 0x0f fix
-QIfdiv:/QIfdiv[-] enable Pentium FDIV fix
-QIf : ?? possibly enable QIfist and QIfdiv ?? [RE needed]
-p6gj:??
-noblend:?? possibly forcode generation ,No optimize for blended model (default)
-nolock :???
-noehopt :??? possibly some optimization, off
-ehopt :??? possibly some optimization, on
-bzalign :??align mode perhaps??
-basic :??possibly compile VB code.. but his compiler complies VB code so what's this ?? , compiler freeses if removed
-nogen :?? hmm possibly do not generate output (syntax checking olny..) it seems to have no effect

These are REALY strange... possibly left from C compiler.. [RE needed]
-MT :/MT link with LIBCMT.LIB
-MD :/MD link with MSVCRT.LIB
-ML :/ML link with LIBC.LIB , used by vb6 , not needed to compile
-MTd :/MTd link with LIBCMTD.LIB debug lib
-MDd :/MDd link with MSVCRTD.LIB debug lib
-MLd :/MLd link with LIBCD.LIB debug lib
-EHa : /EHa enable C++ EH (w/ SEH exceptions)
-EHs : /EHs enable C++ EH (no SEH exceptions)

-loopopt : ?? Posibly loop expanding optimization
-Loop# : ?? Possibly how much to expand.. (the param..)


-vol# :?? takes one par...
-il# :Complier Intermediate File (???) input , must exist , needed for compilation
-isize# :?? takes one par..
-ide : ?? runing from ide?? never used from VB6 ide tho...

-Fd# :/Fd[file] name .PDB file
-f# :File to Compile , -f "filename" /-f"Filename"
-ef# :?? takes one par,seems to have no effect
-off#:?? takes one par, seems to have no effect
-db# :?? taes one par , debug maby? , seems to have no effect
-W# :possibly warning level...
-O# :/O[opts] where "opts" is a string containing the following:
a relax alias checking
g enable global optimizations and global common expressions
p improve consistency in floating-point calculations
s optimize for size
t optimize for speed (default)
w assume no aliasing except across function calls

-A# : All these are legal
/AT Tiny Memory Model; combined code and data limited to 64K
/AS Small Memory Model; code and data limited to 64K each
/AM Medium Memory Model; data is limited to 64K
/AC Compact Memory Model; code is limited to 64K
/AL Large Memory Model; unlimited code and data but arrays are limited to 64K
/AH Huge Memory Model; unlimited code, data and array size

-G# :All these are legal
/G3 optimize for 80386
/Gh enable _penter function call
/G4 optimize for 80486
/G5 optimize for Pentium
/G6 optimize for PPro, P-II, P-III
/GX[-] enable C++ EH (same as /EHsc)
/GA optimize for Windows Application : ok too
/Gf enable string pooling
/Gy separate functions for linker :This is used by Vb6
/GZ Enable stack checks (/RTCs)
/Gs[num] control stack checking calls

-fastcap:??? it has effect on the ouput
-stkfill#:???
-Gt# : /Gt[num] places data items larger than "num" bytes into different
segments. The default value for "num is 256 bytes.

-Gs# :/Gs[num] control stack checking calls , Gs4096 by defualt
-cbstring

I hope you like it :)
Back to top
Dr Memory
Expert


Joined: 16 Aug 2004
Posts: 147
Location: Surrey, UK

Posted: Fri Aug 27, 2004 4:25 pm     Post subject:

I hadn't spotted "ehopt" before - sounds like ExceptHandling maybe? ... sounds intriguing ...

You have to remember many of these options are not really changeable - C2 was a real C compiler, the original MVC (?) compiler maybe, which they adopted a copy of and performed some sort of surgery


-Z options

Suggest don't mess with them - your OBJ files will probably not link properly, as they can affect naming conventions

-basic, -il

Crucial, that tells C2 it's VB who is calling!

The IL files contain the data tables needed for C2 to embed the correct table data - COM, DB links, Line numbering for RESUME support, etc etc

Again, unwise to touch

However, C programmers might be able to tell us (or somebody can try), whether C2 can still compile C if we leave off the -basic option ???


/G options

A 1-1 correspondence with the control panel, so that all makes sense, you can control all the GUI options basically, from the command line, which is the ideal situation.


/AH ????

Now, have I been asleep? Are they hiding the "Huge" model from us for a reason? Or did it not go according to plan?

Back to top
Dr Memory
Expert


Joined: 16 Aug 2004
Posts: 147
Location: Surrey, UK

Posted: Fri Aug 27, 2004 4:38 pm     Post subject:

Tsk,... by "VB calling", I mean "VB executing", of course ....
Back to top
drk||Raziel
New User


Joined: 25 Aug 2004
Posts: 8
Location: Athens

Posted: Fri Aug 27, 2004 6:54 pm     Post subject:

Calling Vb's C2 without -basic makes it go on an infinitive loop...

VB's C2 is not so similar with C C2.dll...
The compiler backend is the same
[Code generation , Asm level Optimizarion,Register managment]

The compiler Frontend is a lot diferent
[Language Syntax/Gramar , Higth Level opts (Very important) , Type conrvetions , OOP handing , exeptions ect..]

That's the reson that vb suffers from performance... Bad front end that can make *bad* code run realy slow + Slow runtime dll's

On C the first pass is made by cl.exe , c1.dll, c1xx.dll and the code generation is made by c2.dll [as far as i know , mauby wrong..]

VB's c2 is a subset of C's c2.dll + a buggy, fast made parser/fisrt pass analyser... This causes the problems with the listings too..


If i have time i will do some real RE on this .. but i think that it is not worth... it would be better to write a VB frontend for GCC and a new runtime Lib... waht do you think??

*Edit*
The Zx seems to work well .. at least , the exe compiles...
i don't have IDA rigth now , i'l test it later
Back to top
Dr Memory
Expert


Joined: 16 Aug 2004
Posts: 147
Location: Surrey, UK

Posted: Sat Aug 28, 2004 12:43 am     Post subject:

VB/GCC, now that's exotic!

That's one form of C I do actually have somewhere ...


Last edited by Dr Memory on Sat Aug 28, 2004 1:01 am; edited 1 time in total
Back to top
Dr Memory
Expert


Joined: 16 Aug 2004
Posts: 147
Location: Surrey, UK

Posted: Sat Aug 28, 2004 12:53 am     Post subject:

Yes, it's not hard to write good code - you can emulate RtlMoveMemory with conventional code and get a 6 to 4 performance ratio, not bad for a HLL, especially with all its other talents


I wonder what % of the millions of compilations done every day are using all default options?
Back to top
   VB Decompiler Forum Index -> The Code All times are GMT
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group