Page 1 of 2
pbAnalyzer v1.1
Posted: Wed Jan 31, 2007 3:47 pm
by dige
Maybe someone need it too:
This little tool ( 11KB ) create a new complete projectfile.
Including all includes. Unused Procedures() will be ripped
out. Also all comments.
I've made this tool, because the current PBCompiler v4.02
compiles unused procedures too.
Usage: pbAnalyzer.exe Main.pb [Outfile.pb]
Download pbanalyzer.zip
-EDIT-
Update: v1.1
Posted: Wed Jan 31, 2007 3:54 pm
by gnozal
Thanks !
Is this some kind of cutter plugin ?
Posted: Wed Jan 31, 2007 4:06 pm
by dige
yes, something like that :)
The Cutterplugin do also a good job. But it does
not find all unused Procedures ().
For example ... after cutting a project main.pb
to CUT.main.pb and then starting the pbAnalyzer,
there a still 39 unused Procedures found ....
Re: pbAnalyzer v1.0
Posted: Wed Jan 31, 2007 5:00 pm
by ricardo
dige wrote:
I've made this tool, because the current PBCompiler v4.02
compiles unused procedures too.
Are you sure?? Why is this?
Posted: Wed Jan 31, 2007 5:04 pm
by Heathen
Pb already doesn't compile unused procedures and comments (at least in 4.0) and if comments are kept, then fasm doesn't compile them. Although, if there are strings in the procedures, then those are added to the exe. Correct me if im wrong though.
Posted: Wed Jan 31, 2007 5:07 pm
by dige
Dont ask me why ... :roll:
I use a lot of includes ( dont like libs ) and since I found out,
that my current project have some stuff included that should'nt
be inside.
Try it out:
Code: Select all
Procedure NoUse1()
txt.s = "Procedure NoUse1()"
InitEngine3D()
EndProcedure
Procedure NoUse2()
txt.s = "Procedure NoUse2()"
EndProcedure
Procedure NoUse3()
txt.s = "Procedure NoUse3()"
EndProcedure
Procedure InUse()
txt.s = "Procedure InUse()"
EndProcedure
InUse()
open the exe ( its 3073Bytes) in a hex editor ... and you will find the strings and the
Engine3D init stuff...
Procedure NoUse1() Procedure NoUse2() Procedure NoUse3() Procedure InUse() InitEngine3DFirst Engine3D.dll Parse3DScripts InitEngine3D Add3DArchive
Posted: Wed Jan 31, 2007 5:08 pm
by Heathen
dige wrote:Dont ask me why ... :roll:
I use a lot of includes ( dont like libs ) and since I found out,
that my current project have some stuff included that should'nt
be inside.
Try it out:
Code: Select all
Procedure NoUse1()
txt.s = "Procedure NoUse1()"
InitEngine3D()
EndProcedure
Procedure NoUse2()
txt.s = "Procedure NoUse2()"
EndProcedure
Procedure NoUse3()
txt.s = "Procedure NoUse3()"
EndProcedure
Procedure InUse()
txt.s = "Procedure InUse()"
EndProcedure
InUse()
open the exe in a hex editor ... and you will find the strings and the
Engine3D init stuff...
try without strings.
ie
Code: Select all
Procedure blahblah()
a = 100
b = 100
c = 100
EndProcedure
If you compile the exe with and without this procedure, the filesize will be the exact same
Posted: Wed Jan 31, 2007 5:10 pm
by Kaeru Gaman
it has nothing to do with the strings... they are just there to make it easier to see in the hex-edi.
Posted: Wed Jan 31, 2007 5:11 pm
by Heathen
Kaeru Gaman wrote:it has nothing to do with the strings... they are just there to make it easier to see in the hex-edi.
edit: nevermind, the filesize is the same with strings too.
Posted: Wed Jan 31, 2007 5:14 pm
by remi_meier
We had this discussion several times now. Use the search function!
In codes like
Code: Select all
declare b()
Procedure a()
b()
endprocedure
procedure b()
a()
endprocedure
both procedures will be included, even if they are not called. :roll:
Posted: Wed Jan 31, 2007 5:15 pm
by Kaeru Gaman
hm... seems it's unclear at the moment, I heard different opitions in both boards...
so I will shut up and listen until I have the need to find the time to test it on my own...
Posted: Wed Jan 31, 2007 5:16 pm
by Heathen
remi_meier wrote:We had this discussion several times now. Use the search function!
In codes like
Code: Select all
declare b()
Procedure a()
b()
endprocedure
procedure b()
a()
endprocedure
both procedures will be included, even if they are not called. :roll:
I just tested that, the amount of bytes in the exe are identical with and without that code though.. at least in 4.0
Posted: Wed Jan 31, 2007 5:18 pm
by ts-soft
If some bytes more or not, the exe is the same size. This is normal by
Design of Exe

Re: pbAnalyzer v1.0
Posted: Wed Jan 31, 2007 5:19 pm
by Kaeru Gaman
Heathen wrote:.. at least in 4.0
dige wrote:I've made this tool, because the current PBCompiler v4.02
compiles unused procedures too.
so it seems you were offtopic.
I should have a look at edel's profile if he is still using 4.00, too
Posted: Wed Jan 31, 2007 5:20 pm
by Heathen
true, my mistake, I should have tested in 4.02 instead.
sorry guys.