DataSection question

Everything else that doesn't fall into one of the other PB categories.
marc_256
Addict
Addict
Posts: 862
Joined: Thu May 06, 2010 10:16 am
Location: Belgium
Contact:

DataSection question

Post by marc_256 »

What are the limits of the DataSection
I was searching the help file and internet help doc.

I need a lot of data in my 3D viewer, so ?
I tested till +- 500 Mb and it works ok, but above ??
I need at least double of that.

What is the reason ?
Is the limit PB or window limits ?

And are there work arounds ?

Thanks,
- every professional was once an amateur - greetings from Pajottenland - Belgium -
PS: sorry for my english I speak flemish ...
User avatar
luis
Addict
Addict
Posts: 3895
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Re: DataSection question

Post by luis »

I'm not able to answer your question without making assumptions and I wouldn't be absolutely certain about the correctness of my reply even then, so I better shut up.
But I think the limits are more inside the PE file structure (if we are talking about windows) than in the CPU architecture.
Hope someone else would be more precise.

One thing I can tell you is the data segment is no place for so much static data, it should be on a external file.

PB stores them here:

Code: Select all

section '.data' data readable writeable
I don't think it's putting limits to that. Simply the linking will fail or more probably the exe will stop loading at some point before that.
"Have you tried turning it off and on again ?"
marc_256
Addict
Addict
Posts: 862
Joined: Thu May 06, 2010 10:16 am
Location: Belgium
Contact:

Re: DataSection question

Post by marc_256 »

Hi luis,

thanks for your answer,

it is about this post
http://www.purebasic.fr/english/viewtop ... 13&t=60143

I just want to know what the limits are.

The reason is privacy of the end user.

marc,
- every professional was once an amateur - greetings from Pajottenland - Belgium -
PS: sorry for my english I speak flemish ...
User avatar
luis
Addict
Addict
Posts: 3895
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Re: DataSection question

Post by luis »

marc_256 wrote: I just want to know what the limits are.
You can find that by yourself beyond any theory by duplicating the data in the datasection until the linker explodes or the exe fails to load.

I don't understand what you would like to obtain privacy-wise, but if you want to keep the image data inaccessible from the outside of your program, you could encrypt it. You could pre-process each image by reading the original image in chunks, encrypting every chunk and appending it to the new destination (the encrypted image).
Then you just read it back in chunks decrypting them and recreating the binary image of the original file in memory, then you catch the image from the binary image and release it.
Last edited by luis on Sun Aug 24, 2014 1:02 pm, edited 1 time in total.
"Have you tried turning it off and on again ?"
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: DataSection question

Post by PB »

> until the linker explodes

:lol:
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
User avatar
Tenaja
Addict
Addict
Posts: 1959
Joined: Tue Nov 09, 2010 10:15 pm

Re: DataSection question

Post by Tenaja »

> until the linker explodes
This will give you the max size for the machine it is compiled on, but every pc will be different. Each one has different programs running, and different memory sizes.
User avatar
luis
Addict
Addict
Posts: 3895
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Re: DataSection question

Post by luis »

Tenaja wrote: This will give you the max size for the machine it is compiled on.
I really don't think so.
It will hit the limits of what the linker can generate as a valid PE executable, supposing you have enough RAM to run the linker, and I think this is a pretty safe assumption compared to what required by the generated program to be able to run.
What can be different is how soon a program still linked successfully will stop to be loaded anyway even if it's a valid binary image.
That's why it is a bad idea compared to external data which can be selectively streamed in.
"Have you tried turning it off and on again ?"
Fred
Administrator
Administrator
Posts: 18547
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: DataSection question

Post by Fred »

Just creating a packfile using brieflz compressor will be more than enough to protect your picture from the average joe. If you think than raw picture in your exe are protected, you're wrong as it's very easy to spot png bmp or jpg headers and extract them.
marc_256
Addict
Addict
Posts: 862
Joined: Thu May 06, 2010 10:16 am
Location: Belgium
Contact:

Re: DataSection question

Post by marc_256 »

I did some data section tests and OEPS, No pc anymore :mrgreen: :mrgreen:
It smells a little burned PC plastics here ...

You are all wright, a can't do protection by including them inside my .exe file.
The best thing is to encrypt them I think.

And yes, finding bmp's inside an .exe is very easy to do. :oops: :oops:

Thanks, Marc
- every professional was once an amateur - greetings from Pajottenland - Belgium -
PS: sorry for my english I speak flemish ...
Post Reply