Skip to content

faking the release name

June 10, 2005

Just got asked how to fake the release information of a system using dtrace. This script will turn your release into what ever you supply as the argument. Clearly not something you would normally want to do.

#!/usr/sbin/dtrace -Cws  #include <sys/utsname.h>  syscall::uname:entry {         this->in = (struct utsname *)arg0; }  syscall::uname:return {         copyoutstr($$1, (uintptr_t)&this->in->release[0], SYS_NMLN);  }

Tags: ,

Advertisements

From → Solaris

faking the release name

June 10, 2005

Just got asked how to fake the release information of a system using dtrace. This script will turn your release into what ever you supply as the argument. Clearly not something you would normally want to do.

#!/usr/sbin/dtrace -Cws  #include <sys/utsname.h>  syscall::uname:entry {         this->in = (struct utsname *)arg0; }  syscall::uname:return {         copyoutstr($$1, (uintptr_t)&this->in->release[0], SYS_NMLN);  }

Tags: ,

From → Solaris

2 Comments
  1. That ‘$1’ should really be ‘$$1’ shouldn’t it ?

  2. You are right. Wiht just one $ it will work for dotted releases like “9.1” but not for a release like “9”. Thanks I’ll fix it for clarity.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: