Jump to content

costum restore executeable x64


Recommended Posts

This is the Vista´s code:

#include"stdafx.h"
#include"windows.h"


int _tmain(int argc, _TCHAR* argv[])
{


ShellExecute(NULL,_T("open"),_T("x:\\Windows\\System32\\Mshta.exe"),_T("x:\\sources\\recovery\\tools\\CostumRestore.hta"),NULL,SW_SHOW);


return 0;
}

As i read from the TechNet...

http://technet.microsoft.com/en-us/library/dd744576%28WS.10%29.aspx

Windows 7 Recovery Environment extracts the ICON for the options-menu from the Executeable. Vista takes it from OEMFactoryRestore.hta.

As I read in Creating_a_Windows_Vista_Hard_Disk_Recovery_Solution.pdf, the Icon and Description can be included :w00t:

I will try to build an EXE compatible for Windows 7 x64.... But i have no experiences with C++ :lol: . I just did an dos-programm with Turbo C++, but i just could accomplish with help.

I am installing MS Visual C++ Express right now. Do not know, if the *.h files are available there... Let´s see :rolleyes:

Will update when i have tryed it

<Edit />

1. Problem:

Can´t add a "Resource File" as discribed in Creating_a_Windows_Vista_Hard_Disk_Recovery_Solution.pdf

Is that a limitation of Visual C++ Express? :(

Edited by Yzöwl
Link to comment
Share on other sites


Visual C++ Express Edition is very limited (none of the MFC/ATL/WTL bits for starters), and indeed, there is no resource editor included. It's by far the most limited of all the "Express Edition" compilers.

Then again, if you're new to programming then perhaps using C++ isn't the best choice. Any programming language will let you do this easily (use ShellExecute on that HTA). You're making this a lot harder than it has to be (unless this runs under WinPE which very much narrows down your choices).

Link to comment
Share on other sites

Visual C++ Express Edition is very limited (none of the MFC/ATL/WTL bits for starters), and indeed, there is no resource editor included. It's by far the most limited of all the "Express Edition" compilers.

Then again, if you're new to programming then perhaps using C++ isn't the best choice. Any programming language will let you do this easily (use ShellExecute on that HTA). You're making this a lot harder than it has to be (unless this runs under WinPE which very much narrows down your choices).

Just wanted to add:

EDIT:

JUST FOUND:

Visual C++ Express editions don't have a resource editor. That is one of its limitations. :realmad:

But i need a executeable with a valid description and icon to display my EXE in the recovery-options-menu when i boot to winre... And the only code i found was c++

Link to comment
Share on other sites

My brother is in a computer science apprenticeship.... he is able to compile for me :thumbup

Let´s see, if it will success

BTW.: Why did you edit my post CoffeeFiend. And why are you a coffeefiend :o

Link to comment
Share on other sites

Visual C++ Express editions don't have a resource editor. That is one of its limitations. :realmad:

You could have just read what I wrote directly above:

there is no resource editor included

I thought that was pretty clear...

Why did you edit my post CoffeeFiend

I didn't.

Please stop using the acute accent (´) as if it's some sort of single quote!

Link to comment
Share on other sites

You could have just read what I wrote directly above:

I know

I thought that was pretty clear...

I just found out while u where answering

I didn't.

Strange... thought i've read "This post has been edited by CoffeeFiend" ...Now it has been edited by Yzöwl :wacko:

Please stop using the acute accent (´) as if it's some sort of single quote!

OK, i'll try

Now my brother has compiled the EXE and it works fine, but just in the normal OS... When I boot to WinRE, it says something about a missing subsystem. I guess it is because of the wrong architecture. My WinRE is x64, but the Application created with Visual C++ is an Win32-Application :realmad:

The Recovery-Environment does well with the Icon and Description, but when i click on the option, a window pops up that there´s something wrong!

When I open the CMD and try to run, it returns the error with the missing subsystem! ... Now got stuck ... No idea how to continue :}

I Also tryed to compile the EXE with


Quick Batch File Compiler

Like robbo101 here:

But with the same result (missing subsystem) ....

Link to comment
Share on other sites

OK, i'll try

Very much appreciated! :thumbup

Now my brother has compiled the EXE and it works fine, but just in the normal OS... When I boot to WinRE, it says something about a missing subsystem.

Chances are that it's compiled in a way that requires you to install the Visual C++ redist first.

I guess it is because of the wrong architecture. My WinRE is x64, but the Application created with Visual C++ is an Win32-Application :realmad:

No. 32 bit apps work fine on a 64 bit OS.

The Recovery-Environment does well with the Icon and Description, but when i click on the option, a window pops up that there´s something wrong!

When I open the CMD and try to run, it returns the error with the missing subsystem! ... Now got stuck ... No idea how to continue :}

If you paste the actual error message (even if it's not in english) then we might know what the problem is for sure. It could be a number of other things, like your app working fine but WinRE not supporting HTA files (not having the winpe-hta package built-in). Not that I use WinRE or WinPE.

Link to comment
Share on other sites

If you paste the actual error message (even if it's not in english) then we might know what the problem is for sure. It could be a number of other things, like your app working fine but WinRE not supporting HTA files (not having the winpe-hta package built-in). Not that I use WinRE or WinPE.

This was really a fast answer ....

NOPE, HTA works well. I can call any hta with "MSHTA.EXE somehta.hta"

The actual massage, when i try to run the executeable via CMD, this will return:

The subsystem needed to support the image type is not present
Das zum Unterstützen des Abbildtyps erforderliche Subsystem ist nicht vorhanden.

Yeah... I can offer u 2 languages :lol:

And what do u use :sneaky:

EDIT

No. 32 bit apps work fine on a 64 bit OS.

The application works well under Windows but not under WinRE

Edited by Schiiwa
Link to comment
Share on other sites

The subsystem needed to support the image type is not present
Das zum Unterstützen des Abbildtyps erforderliche Subsystem ist nicht vorhanden.

Yeah... I can offer u 2 languages :lol:

That's ok. Ich spreche ein bisschen Deutsch ;) Et français aussi ;)

And what do u use :sneaky:

Instead of WinRE? Nothing. I simply don't have a use for it.

The reason which i figured out is, that WOW64 isn´t available for WinPE x64 :(

Ouch. Didn't see that one coming as I don't use WinPE or WinRE. But yeah, it's pretty limited -- no .NET framework built-in either. The good news is recompiling should fix that (or using the 32 bit version of WnPE)

Link to comment
Share on other sites

I already made it. After a little bit of googeling and taking over my brothers PC with remote-desktop i changed the platform to x64 and re-comiled.

2 Files were missing and after I implemented them into X:\Windows\System32 all works fine! :thumbup

Just have to edit the HTA-script for my needs :w00t:

I personally like a recovery-option because I have installed windows enough! I think more often than a normal user would in 10 lifes :rolleyes:

But this computer i am preparing is for my little brother (15 years) and I know what's gonna happen :angel

I will copy the nessessary partitions also to another disk, because i had some hdd-crashes also and this one isn´t new

Edited by Schiiwa
Link to comment
Share on other sites

I already made it. After a little bit of googeling and taking over my brothers PC with remote-desktop i changed the platform to x64 and re-comiled.

2 Files were missing and after I implemented them into X:\Windows\System32 all works fine! :thumbup

Are you going to post WHICH EXACTLY "2 files" were missing? :w00t:

Or do we need to apply some torture to extort you this information? :ph34r:

Boy, do I hate reports of success that completely FAIL to detail HOW EXACTLY the goal was reached.... :realmad:

jaclaz

Link to comment
Share on other sites

Boy, do I hate reports of success that completely FAIL to detail HOW EXACTLY the goal was reached....

HERE AGAIN FOR THE GRAND MASTER JAYCLAZ:

changed the platform to x64 and re-comiled.

Because of the Problem

The reason which i figured out is, that WOW64 isn´t available for WinPE x64

Don´t be rude my friend. I didn´t write in here EXACTLY the 2 files, because you will be informed through the executeable..... But If you want details...here we go!

First it said:

mfc100u.dll not found

and after placing it from C:\Windows\System32 into the RE-image:\Windows\System32 (as we all here know, which has normally the letter "X" assigned), the next message was:

msvcr100.dll not found

Then same procedure.... and ta-da.... The HTA was Popping up. And I didn´t write these details, because I am sure it hurts some copyrights :ph34r: because nearly everything is illegal. If MS haven´t changed the EULA of IMAGEX, i am not allowed to do a Image of my OS-Partition, right Jayclaz??

Maybe (but do not know) these files went to C:\Windows\System32 through the installation of Visual C++ (on my brothers Computer). But Maybe they are some standard WIN-Files

BTW... here´s the source-code

#include "stdafx.h"
#include "windows.h"
int _tmain(int argc, _TCHAR* argv[])
{
ShellExecute(NULL,_T("open"),_T("x:\\Windows\\System32\\Mshta.exe"),_T("x:\\sources\\recovery\\tools\\RestoreImage.hta"),NULL,SW_SHOW);
return 0;
}

And I saw the possibilities of Visual C++ the first time and was really flashed. So in my opinion, if someone buys and gets along with this programm, they already know the option to change the platform! It´s just because i have no idea of programming in C++

Additional Information: :w00t: :w00t: :w00t: :w00t: :w00t: :w00t:

You can change the platform in Visual C++ by opening the properties of your projekt and search for KONFIGURATION MANAGER!!!!!!!!!!!!!!!!!!

Win32, X64 and Itanium will be available. As this box here holds an AMD, i chose x64

Edited by Schiiwa
Link to comment
Share on other sites

Not all tests finished yet

one Problem left:

I did this one:

C:\Windows\System32\Reagentc.exe /setosimage /path Z:\ /target C:\Windows

My costum-tool is displayed without specified the /costumtool-parameter. I´ve just specified my costum exe in WinREConfig.xml. That´s OK, but how can I remove the option at the bottom now (Reinstall Windows) ???

when I do:

reagentc /info

Setup activated = 1

how can i reset it to 0

I´ve just ran:

C:\Windows\System32\Reagentc.exe /setosimage /customtool /target C:\Windows

But still Setup activated = 1 .... I'll reboot now and see the effects

SOLVED: The command directly above will hide the "Reinstall Windows" option, even though "Setup activated = 1" will leave

Wonderful... all works fine (UNTIL NOW.... not ran the HTA till now... have to edit some things first). I´ll also add the BOOTKEY for /SETREIMAGE to F11, because the other PCs where my brother lives have the Acronis Boot loader installed, which can be activated with F11 :whistle: Would be interesting, if F8 would be available anyway!? :sneaky:

Maybe I will reinstall windows again, to create the ID=27 Recovery-Partition. But I think I will keep that back for my own PC/Notebook and simply deactivate the access through windows with:

ATTRIBUTE VOLUME SET NODEFAULTDRIVELETTER=1

Maybe also HIDDEN=1 and READONLY=1, but don´t know if it is possible to boot to win-re then.... we´ll see

Cy@ soon in a HTA-Threat :lol:

Edited by Schiiwa
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...