Page 1 of 1

DataSection question

Posted: Sun Aug 24, 2014 7:06 am
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,

Re: DataSection question

Posted: Sun Aug 24, 2014 11:23 am
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.

Re: DataSection question

Posted: Sun Aug 24, 2014 11:52 am
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,

Re: DataSection question

Posted: Sun Aug 24, 2014 12:53 pm
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.

Re: DataSection question

Posted: Sun Aug 24, 2014 12:55 pm
by PB
> until the linker explodes

:lol:

Re: DataSection question

Posted: Sun Aug 24, 2014 2:27 pm
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.

Re: DataSection question

Posted: Sun Aug 24, 2014 2:38 pm
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.

Re: DataSection question

Posted: Sun Aug 24, 2014 7:23 pm
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.

Re: DataSection question

Posted: Sun Aug 24, 2014 9:40 pm
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