*Start = AllocateExecutableMemory(Size.L)

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Ollivier
Enthusiast
Enthusiast
Posts: 281
Joined: Mon Jul 23, 2007 8:30 pm
Location: FR

*Start = AllocateExecutableMemory(Size.L)

Post by Ollivier »

It'd be cool executing this code :D :

Code: Select all

*Start = AllocateExecutableMemory(1)
      PokeB(*Start, $CB)
      CallFunctionFast(*Start)
User avatar
Rings
Moderator
Moderator
Posts: 1435
Joined: Sat Apr 26, 2003 1:11 am

Post by Rings »

*stop=MakingTrojansForDummies(<Insert Nickname here>)
SPAMINATOR NR.1
Ollivier
Enthusiast
Enthusiast
Posts: 281
Joined: Mon Jul 23, 2007 8:30 pm
Location: FR

Post by Ollivier »

Yes! It's right! It's shame too...
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

Maybe an optional flag to specify the type of memory or if it should be pre-cleared would be handy.
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
Ollivier
Enthusiast
Enthusiast
Posts: 281
Joined: Mon Jul 23, 2007 8:30 pm
Location: FR

Post by Ollivier »

@Rings

A solution in order to prevent dummies from such an infection should be adding a warning input requester at the beginning of the execution.

Code: Select all

Caution ! This program could contain a virus : Are you sure you want to execute it ?

[Yes] [No] [Cancel]
A second solution : limit the size of such a memory area. The quantity too. I see two reason to have this functionnality :
1) protect the code by autoreferency enkryption. Thing I never saw actually.
2) use a new possibility of call of procedure.
In the past, in the old Basic compiler named Quick-Basic, there was a function named : On Value Goto Label1, Label2, Label3, etc...

Maybe other users can find other functionnalities available with this options.
User avatar
Rings
Moderator
Moderator
Posts: 1435
Joined: Sat Apr 26, 2003 1:11 am

Post by Rings »

lol
SPAMINATOR NR.1
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

Ollivier: You cannot be serious with this suggestion? Anyone who wanted to bypass your ideas would just use the API.

I think if these extensions were added then it would be great, but with no "nanny state" warning messages please. :)
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
Ollivier
Enthusiast
Enthusiast
Posts: 281
Joined: Mon Jul 23, 2007 8:30 pm
Location: FR

Post by Ollivier »

Yes, yes! CallFunctionFast() Okay but not JumpFast, cause actually OOC... slow, slow... Lol ? :D

Code: Select all

Object1()
...
code
...
JMP {lea Object2() } << Poke!

Object2()
...
code
...
JMP {lea Object3() } << Poke!

Object3()
...
code
...
JMP {lea Object1() } << And Poke!
And when you've a picture to transform with ! REP MOVSD, it's cool to prepare registers before the execution... not during the one, exactly like the code above.

>> Autoreferency enkrypton... What's that?
Maybe an expression with lots of error that a french try to translate!

Yes! It's only that... I just hope it's not a patent I'm able to execute with an old compiler I wanna forget!

Code: Select all

In this rectangle:
1) There is ... time(s) the figure 4
2) There is ... time(s) the figure 3
3) There is ... time(s) the figure 2
4) There is ... time(s) the figure 1
I think it's a good illustration of the autoreferency bordel.

So! Happy to discover your humour!
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

:shock:
>> Autoreferency enkrypton... What's that?
Maybe an expression with lots of error that a french try to translate!
Who are you replying to? Has a post been deleted?

:?
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
Ollivier
Enthusiast
Enthusiast
Posts: 281
Joined: Mon Jul 23, 2007 8:30 pm
Location: FR

Post by Ollivier »

@DoubleDutch

If the PB team gives us this technic, he'll use to protect PBCompiler again hacking. Now, draw a message and input the keyboard, it's not only the API...

You give me an idea... :D ...
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

> Who are you replying to? Has a post been deleted?

He's referring to the fifth post in this thread, where "autoreferency enkryption"
is first mentioned. I guess he used ">>" to point out that phrase, rather than
use it as quote marks (as some people, including myself, do).
Ollivier
Enthusiast
Enthusiast
Posts: 281
Joined: Mon Jul 23, 2007 8:30 pm
Location: FR

Post by Ollivier »

@DD

no... no deleted post
Just the function AllocateExecutableMemory() allows us really to protect executable code.

Auto-reference resolution, it's simple: more it's false, more it's longer.

EDIT : Rings had right : lol
I seem like ET...
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

ic... :)

I think that adding the extra flags to AllocateMemory, is the best way to go. It means no extra commands that are basically just mods of the other commands.

Eg:

address=AllocateMemory(4000,#PB_Memory_Code) ; default is #PB_Memory_Data
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

This would be useful for a scripting language.
Iron_Meiden
User
User
Posts: 37
Joined: Sun Sep 09, 2007 1:16 pm
Location: Asdenia

Post by Iron_Meiden »

Special for Rings...

Code: Select all

\ Just for fun (Win32Forth v6.13.00)...

: Test CR S" Hi, I'm a trojan for all dummies !!1" TYPE CR ;
HERE CONSTANT TestEnd
' Test CONSTANT TestStart

TestEnd TestStart - Constant CodeSize
CodeSize Allocate Drop Value MEMORY
TestStart MEMORY CodeSize MOVE
MEMORY EXECUTE
Post Reply