Function Repository Resource:

WordsFromExecutable

Source Notebook

Retrieve the words found in an executable file

Contributed by: Yana Outkin and Faizon Zaman

ResourceFunction["WordsFromExecutable"][file]

returns words that can be found in the executable file.

ResourceFunction["WordsFromExecutable"][file,prop]

returns the property prop.

Details

The property prop supports the following values:
"WordCloud"return the WordCloud of the words found in the executable file
"CountsData"create a Dataset of the number of times each word appears in the words from the executable file
"Counts"return an Association between the word and the amount of times the word appears in the executable file
ResourceFunction["WordsFromExecutable"] has similar functionality to the Unix strings utility to find and print strings embedded in binary files.

Examples

Basic Examples (2) 

Show a list of words found in the Mathematica executable file:

In[1]:=
Short@ResourceFunction["WordsFromExecutable"][
  First@FileNames["*.exe", $InstallationDirectory, 5]]
Out[1]=

Show a WordCloud of the words found in the Mathematica executable file:

In[2]:=
ResourceFunction["WordsFromExecutable"][
 First@FileNames["*.exe", $InstallationDirectory, 5], "WordCloud"]
Out[2]=

Scope (2) 

Show the counts of each word found in the Mathematica executable file:

In[3]:=
ResourceFunction["WordsFromExecutable"][
  RandomChoice@FileNames["*.exe", $InstallationDirectory, 5], "CountsData"] // ReverseSort
Out[3]=

Create an Association between the word and the amount of times each word is found in the Mathematica executable file:

In[4]:=
ResourceFunction["WordsFromExecutable"][
  RandomChoice@FileNames["*.exe", $InstallationDirectory, 5], "Counts"] // ReverseSort
Out[4]=

Neat Examples (2) 

List the top 10 longest words in the wolframscript executable file:

In[5]:=
exeWords = ResourceFunction["WordsFromExecutable"][
   FileNameJoin[{$InstallationDirectory, "wolframscript.exe"}]];
In[6]:=
TakeLargestBy[DeleteDuplicates[exeWords], StringLength, 10]
Out[6]=

Show the common words across the web browsers Firefox, Chrome and Internet Explorer. The file paths below will likely need to be changed for your computer:

In[7]:=
firefoxWords = ResourceFunction["WordsFromExecutable"][
   "C:\\Program Files\\Mozilla Firefox\\firefox.exe"];
In[8]:=
chromefoxWords = ResourceFunction["WordsFromExecutable"][
   Switch[$OperatingSystem, "MacOSX", FileNameJoin[{"/Applications/Google\ Chrome.app/Contents/MacOS", "Google Chrome.exe"}], "Windows", "C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe"]];
In[9]:=
internetexplorerWords = ResourceFunction["WordsFromExecutable"][
   "C:\\Program Files\\Internet Explorer\\iexplore.exe"];

Publisher

Wolfram Summer Camp

Version History

  • 1.1.0 – 22 March 2021
  • 1.0.0 – 09 March 2021

Related Resources

Author Notes

This is a follow up from a previous submission regarding words from executable files. Added an update to the documentation in the Details section.

License Information