Author Topic: The Outer Limits  (Read 8239 times)

0 Members and 1 Guest are viewing this topic.

John

  • Hero Member
  • *****
  • Posts: 3249
The Outer Limits
« on: November 03, 2014, 12:21:42 AM »
I was reading a thread about the smallest .exe that Windows can run. (97 bytes) It seems to run without error under Wine but got a way too funny result under XP. (in a VirtualBox - see attached)

Creating the smallest possible PE executable

.

Mike Lobanovsky

  • Admin Support Member
  • *****
  • Posts: 1856
Re: The Outer Limits
« Reply #1 on: November 03, 2014, 05:44:14 AM »
Such hocus-pocuses were doable way back at the times of Win2K but aren't possible any more under genuine XP and up. The smallest exe that I was able to machine code and get going under XP was somewhere around 1,300 bytes in size. Smaller exes are rejected by the PE loader. They say that's part of MS AV policy.
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, 2 x nVidia GTX 650Ti w/ 2GB VRAM, Windows 7 Ultimate Sp1)

Charles Pegge

  • Admin Support Member
  • *****
  • Posts: 3745
    • Oxygen Basic
Re: The Outer Limits
« Reply #2 on: November 03, 2014, 07:24:38 AM »
It is perfectly feasible to create a customised binary loader, if so desired. OxygenBasic's code is relocatable, so address remapping is not required.

John

  • Hero Member
  • *****
  • Posts: 3249
The Outer Limits - File System Redirector
« Reply #3 on: December 14, 2014, 11:27:48 PM »
I ran into this and thought I would pass it along.

Quote
File System Redirector

The %windir%\System32 directory is reserved for 64-bit applications. Most DLL file names were not changed when 64-bit versions of the DLLs were created, so 32-bit versions of the DLLs are stored in a different directory. WOW64 hides this difference by using a file system redirector.

In most cases, whenever a 32-bit application attempts to access %windir%\System32, the access is redirected to %windir%\SysWOW64. Access to %windir%\lastgood\system32 is redirected to %windir%\lastgood\SysWOW64. Access to %windir%\regedit.exe is redirected to %windir%\SysWOW64\regedit.exe.

If the access causes the system to display the UAC prompt, redirection does not occur. Instead, the 64-bit version of the requested file is launched. To prevent this problem, either specify the SysWOW64 directory to avoid redirection and ensure access to the 32-bit version of the file, or run the 32-bit application with administrator privileges so the UAC prompt is not displayed.

Windows Server 2003 and Windows XP: UAC is not supported.

Certain subdirectories are exempt from redirection. Access to these subdirectories is not redirected to %windir%\SysWOW64:
%windir%\system32\catroot%windir%\system32\catroot2%windir%\system32\driverstore %windir%\system32\drivers\etc%windir%\system32\logfiles%windir%\system32\spool
Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP: %windir%\system32\driverstore is redirected.

To retrieve the name of the 32-bit system directory, 64-bit applications should use the GetSystemWow64Directory function.

Applications should use the SHGetSpecialFolderPath function to determine the %ProgramFiles% directory name.

Applications can control the WOW64 file system redirector using the Wow64DisableWow64FsRedirection, Wow64EnableWow64FsRedirection, and Wow64RevertWow64FsRedirection functions. Disabling file system redirection affects all file operations performed by the calling thread, so it should be disabled only when necessary for a single CreateFile call and re-enabled again immediately after the function returns. Disabling file system redirection for longer periods can prevent 32-bit applications from loading system DLLs, causing the applications to fail.

32-bit applications can access the native system directory by substituting %windir%\Sysnative for %windir%\System32. WOW64 recognizes Sysnative as a special alias used to indicate that the file system should not redirect the access. This mechanism is flexible and easy to use, therefore, it is the recommended mechanism to bypass file system redirection. Note that 64-bit applications cannot use the Sysnative alias as it is a virtual directory not a real one.

Windows Server 2003 and Windows XP: The Sysnative alias was added starting with Windows Vista.

Mike Lobanovsky

  • Admin Support Member
  • *****
  • Posts: 1856
Re: The Outer Limits
« Reply #4 on: December 15, 2014, 12:00:39 AM »
Thanks for sharing, John.
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, 2 x nVidia GTX 650Ti w/ 2GB VRAM, Windows 7 Ultimate Sp1)

Mike Lobanovsky

  • Admin Support Member
  • *****
  • Posts: 1856
Re: The Outer Limits - Smallest Windows Executable
« Reply #5 on: December 15, 2014, 12:34:04 AM »
Here's the smallest Windows GUI executable that I was able to compile with MS VC6. It's only 496 bytes large and it doesn't produce any visible output. Nonetheless it does load in memory and it does fulfill its only purpose, which is to return a zero exit code to the system.

Not sure though if it's compilable with any later version of MS Visual C.

Code: [Select]
#include <windows.h>
 
// Make section alignment really small
#pragma comment(linker, "/FILEALIGN:16")
#pragma comment(linker, "/ALIGN:16")
// Merge sections
#pragma comment(linker, "/MERGE:.rdata=.data")
#pragma comment(linker, "/MERGE:.text=.data")
#pragma comment(linker, "/MERGE:.reloc=.data")
// Favour small code
#pragma optimize("gsy", on)
 
// Single entrypoint
int WinMainCRTStartup()
{
return 0;
}

.
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, 2 x nVidia GTX 650Ti w/ 2GB VRAM, Windows 7 Ultimate Sp1)

Mike Lobanovsky

  • Admin Support Member
  • *****
  • Posts: 1856
Re: The Outer Limits
« Reply #6 on: January 04, 2015, 08:21:25 PM »
Interestingly, similar results are feasible under Linux as well. Here's a tutorial on how you can generate a 45-byte-only Linux executable that would be only as large as a fraction of its circumcized ELF header. That's effectively less than one fiftieth the size of the smallest executable that you would be able to create using your favorite GNU C compiler. :)
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, 2 x nVidia GTX 650Ti w/ 2GB VRAM, Windows 7 Ultimate Sp1)

John

  • Hero Member
  • *****
  • Posts: 3249
Re: The Outer Limits
« Reply #7 on: January 20, 2015, 12:09:13 AM »
Here is a recap of the activity for the OxygenBasic site for 2014. Thanks to those that contributed and made the site interesting. As always, Charles keeps me amazed and humbled.



.

John

  • Hero Member
  • *****
  • Posts: 3249
Re: The Outer Limits
« Reply #8 on: March 12, 2015, 09:28:43 AM »
I came across this ad on craiglist.  I guess we still haven't reached the bottom yet but this is close.  :'(

Quote
I gave you a ride from the courthouse Sept. 22 2014 You had just gotten out of jail, and you stole my pink plaid laptop. If you return it unharmed I'll pay you for it!!! It has all my daughters pictures on it for the last 6 year's! It's super special to me!! Please!! If any one reading this knows who stole it, please tell her ill pay her for it!

Mike Lobanovsky

  • Admin Support Member
  • *****
  • Posts: 1856
Re: The Outer Limits
« Reply #9 on: March 12, 2015, 10:35:37 AM »
Are you willing to pay for DDOS? I guess skyrocketing the visits counter won't be too hard to fix up. ;)





P.S. I was simply trying to relate your two latest posts in this thread to each other. I'm just not sure if it was obvious enough. :)
« Last Edit: March 12, 2015, 11:39:20 AM by Mike Lobanovsky »
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, 2 x nVidia GTX 650Ti w/ 2GB VRAM, Windows 7 Ultimate Sp1)

John

  • Hero Member
  • *****
  • Posts: 3249
Re: The Outer Limits
« Reply #10 on: April 09, 2015, 02:16:00 PM »
PC shipments mark lowest recorded volume since Q1 2009: IDC

Quote
It should be noted IDC defines the PC category a bit more broadly than Gartner, specificing data spans desktops, laptops, Chromebooks, Workstations and Ultraslim notebooks but not handhelds, x86 servers and tablets.


Mike Lobanovsky

  • Admin Support Member
  • *****
  • Posts: 1856
Re: The Outer Limits
« Reply #11 on: April 10, 2015, 05:22:23 AM »
The last year's springtime saw the deprecation of installed XP base worldwide, which naturally led to a boost in volume sales of newer machines in that period onward. Now that the transition period is evidently over, a certain decline in net sales would be an expected phenomenon. It is yet too early to regard this figure as an onset of the trend IMO.

Note also that the US figures are not that bad at all.
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, 2 x nVidia GTX 650Ti w/ 2GB VRAM, Windows 7 Ultimate Sp1)

John

  • Hero Member
  • *****
  • Posts: 3249
Re: The Outer Limits
« Reply #12 on: April 10, 2015, 07:08:07 PM »
I hope some of those ancient PC's (unable to run current Windows OS) will find a new home with Linux rather than a scrap yard. (remember A.I.)



John

  • Hero Member
  • *****
  • Posts: 3249
Re: The Outer Limits
« Reply #13 on: April 23, 2015, 01:52:59 PM »

Charles Pegge

  • Admin Support Member
  • *****
  • Posts: 3745
    • Oxygen Basic
Re: The Outer Limits
« Reply #14 on: April 24, 2015, 02:36:18 PM »



https://www.youtube.com/watch?v=KcBuqUDLg7w


the gigital resources used in the production of Avatar (2009)

Quote
The lead visual effects company was Weta Digital in Wellington, New Zealand, at one point employing 900 people to work on the film.[103] Because of the huge amount of data which needed to be stored, cataloged and available for everybody involved, even on the other side of the world, a new cloud computing and Digital Asset Management (DAM) system named Gaia was created by Microsoft especially for Avatar, which allowed the crews to keep track of and coordinate all stages in the digital processing.[104] To render Avatar, Weta used a 10,000 sq ft (930 m2) server farm making use of 4,000 Hewlett-Packard servers with 35,000 processor cores with 104 terabytes of RAM and three petabytes of network area storage running Ubuntu Linux, Grid Engine cluster manager, and 2 of the animation software and managers, Pixar's RenderMan and Pixar's Alfred queue management system.[105][106][107][108] The render farm occupies the 193rd to 197th spots in the TOP500 list of the world's most powerful supercomputers. A new texturing and paint software system, called Mari, was developed by The Foundry in cooperation with Weta.[109][110] Creating the Na'vi characters and the virtual world of Pandora required over a petabyte of digital storage,[111] and each minute of the final footage for Avatar occupies 17.28 gigabytes of storage.[112] Often, it would take each frame of the movie several hours to render.[113] To help finish preparing the special effects sequences on time, a number of other companies were brought on board, including Industrial Light & Magic, which worked alongside Weta Digital to create the battle sequences. ILM was responsible for the visual effects for many of the film's specialized vehicles and devised a new way to make CGI explosions.[114] Joe Letteri was the film's visual effects general supervisor.[115]
http://en.wikipedia.org/wiki/Avatar_%282009_film%29