The Artima Developer Community
Sponsored Link

Agile Buzz Forum
Executing arbitrary assembler from Cincom Smalltalk

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
James Robertson

Posts: 29924
Nickname: jarober61
Registered: Jun, 2003

David Buck, Smalltalker at large
Executing arbitrary assembler from Cincom Smalltalk Posted: Nov 8, 2007 2:52 PM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by James Robertson.
Original Post: Executing arbitrary assembler from Cincom Smalltalk
Feed Title: Michael Lucas-Smith
Feed URL: http://www.michaellucassmith.com/site.atom
Feed Description: Smalltalk and my misinterpretations of life
Latest Agile Buzz Posts
Latest Agile Buzz Posts by James Robertson
Latest Posts From Michael Lucas-Smith

Advertisement

For anyone who has ever been interested in taking total control of their computer from Cincom Smalltalk VisualWorks or ObjectStudio - here's how you can bypass all the wonderful technology that makes up the VM, JIT etc and just ran whatever assembly code you want:

(Example for x86 platform only)

| assembly assembler address procedure |
assembly := ByteArray new writeStream.
assembly nextPut: 16rB8. "mov eax, 1"
assembly nextPutAll: #[ 1 0 0 0 ].
assembly nextPut: 16rC3. "retf"
assembler := assembly contents gcCopyToHeap.
address := assembler referentAddress.
procedure := ExternalProcedure new.
procedure owner: ExternalInterface.
procedure referentAddress: address.
procedure type: (CProcedureType resultType: CIntegerType unsignedInt argumentTypes: #() argumentNames: #()).
procedure call

Read: Executing arbitrary assembler from Cincom Smalltalk

Topic: Oredev Previous Topic   Next Topic Topic: The Inspector and printOn:

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use