binary storage in same file?

Everything else that doesn't fall into one of the other PB categories.
Edwin Knoppert
Addict
Addict
Posts: 1073
Joined: Fri Apr 25, 2003 11:13 pm
Location: Netherlands
Contact:

binary storage in same file?

Post by Edwin Knoppert »

In PowerBASIC i can obtain data using a lable and using CodePtr( mylabel ) like:

MyLabel:
!db 2,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
etc...

With the above i only need to remember it's size.
Can i make use of db statements in PureBasic in a similar way?
1) db statements results in the smallest not-encoded code.
2) Need to have direct access using a pointer to mylabel or so.
3) Would not like to use a method like T.s = T.s & "abcd"...
4) The size can become really big, like megabytes, to handle?
5) Don't want to use includebinary since then i'll need a separate file.

Thanks,
User avatar
Rings
Moderator
Moderator
Posts: 1435
Joined: Sat Apr 26, 2003 1:11 am

Post by Rings »

hehe,

Code: Select all

Debug "Adress is " + Hex(?MyLabel)+ " Len of Data is ="+Str(?MyLabel2-?MyLabel)

MyLabel:
!Db $90,$90,144 ;$90 iss NOP

MyLabel2:
Debug "Yes "
SPAMINATOR NR.1
Edwin Knoppert
Addict
Addict
Posts: 1073
Joined: Fri Apr 25, 2003 11:13 pm
Location: Netherlands
Contact:

Post by Edwin Knoppert »

Thanks!

Will test soon..

:)
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6172
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

if it's DATA and you're planning to WRITE to it as well and you want it to run under future versions of windows (xp) you may need to put your data in a datasection...
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB - upgrade incoming...)
( The path to enlightenment and the PureBasic Survival Guide right here... )
Edwin Knoppert
Addict
Addict
Posts: 1073
Joined: Fri Apr 25, 2003 11:13 pm
Location: Netherlands
Contact:

Post by Edwin Knoppert »

I only need to obtain it (read only)
User avatar
Rings
Moderator
Moderator
Posts: 1435
Joined: Sat Apr 26, 2003 1:11 am

Post by Rings »

if you want to include some protection-tricks in the code to irritate Disassemblers, than this is the way to do it ;)
SPAMINATOR NR.1
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

how to disturb the dissassemblers?

I've found many informations on disturbing debuggers, but not dissassemblers. But again, How? interesting :D
User avatar
Rings
Moderator
Moderator
Posts: 1435
Joined: Sat Apr 26, 2003 1:11 am

Post by Rings »

thefool wrote:how to disturb the dissassemblers?

I've found many informations on disturbing debuggers, but not dissassemblers. But again, How? interesting :D
well described in the following book (i own) :
http://www.nostarch.com/frameset.php?startat=crackproof
SPAMINATOR NR.1
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

Thanks :)
User avatar
NoahPhense
Addict
Addict
Posts: 1999
Joined: Thu Oct 16, 2003 8:30 pm
Location: North Florida

Post by NoahPhense »

Thanks Rings.. looks like a good book, ordering now..

- np
Post Reply