Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some thoughts on optimizations... #292

Open
zedd-0 opened this issue Dec 22, 2024 · 6 comments
Open

some thoughts on optimizations... #292

zedd-0 opened this issue Dec 22, 2024 · 6 comments

Comments

@zedd-0
Copy link

zedd-0 commented Dec 22, 2024

Hello,
I wanted to ask which platform the autobuild scripts are designed for?
Since they use *.cmd, it’s clear they are meant for NT-Windows.

I would recommend using 'curl.exe' (available since Windows 10 1803) or 'PowerShell.exe' instead of delivering a custom 'dwnl.exe'.

I’m not sure if 'winfuture.de' allows direct downloads, but the ISO file can be downloaded directly, which could further automate the script. However, I suggest sourcing the ISO from 'archive.org', as they focus on archiving data, unlike WinFuture, where long-term availability isn’t guaranteed.

I also wonder why a German ISO was chosen?
An English ISO might reduce potential compatibility issues with language settings.

Another question: Why was Windows 7 selected?
NTVDM is still available in 32-bit Windows 10, making it a viable and more recent option.

Here are some direct download commands I’m currently using:

::archive.org (W7x32ger)
	PowerShell.exe  " Start-BitsTransfer 'https://ia902202.us.archive.org/14/items/windows-7-iso/Professional/32bit/de_windows_7_professional_with_sp1_x86_dvd_u_677093.iso' 'de_windows_7_professional_with_sp1_x86_dvd_u_677093.iso' "
::archive.org (W7x32eng)
::	PowerShell.exe  " Start-BitsTransfer 'https://ia902202.us.archive.org/14/items/windows-7-iso/Professional/32bit/en_windows_7_professional_with_sp1_x86_dvd_u_677056.iso' 'en_windows_7_professional_with_sp1_x86_dvd_u_677056.iso' "

::other
	PowerShell.exe  " Start-BitsTransfer https://web.archive.org/web/20191230001029if_/http://file.opennt.net/release/snapshot/MinNT-20170416-85fac4faadc77203db8ddc66af280a75c1b717b0.zip MinNT-20170416-85fac4faadc77203db8ddc66af280a75c1b717b0.zip "
	PowerShell.exe  " Start-BitsTransfer https://web.archive.org/web/20191230000639if_/http://file.opennt.net/release/obsolete/sr687/old-src-sr687.7z old-src.trunk.r687.20150728.7z "


EDIT:

Okay, the scripts have more problems than just missing download components.
For example, the improper unmounting of virtual drives of prematurely aborted scripts.
And the independent portable execution, despite the protected folder monitoring being activated in Bitdefender.
In the end, I was not able to successfully generate the files.

I hope you will find some time to revise your script eventually.

@leecher1337
Copy link
Owner

Hi,

Hello, I wanted to ask which platform the autobuild scripts are designed for? Since they use *.cmd, it’s clear they are meant for NT-Windows.

Correct, Windows NT4 or above.

I would recommend using 'curl.exe' (available since Windows 10 1803) or 'PowerShell.exe' instead of delivering a custom 'dwnl.exe'.

curl.exe is very big and not available per default on Windows XP, neither is Powershell a default component on Windows XP, dwnl.exe on the other hand is very tiny and we have a fallback to bitsadmin anyway which ships with Windows XP and above.

I’m not sure if 'winfuture.de' allows direct downloads, but the ISO file can be downloaded directly, which could further automate the script. However, I suggest sourcing the ISO from 'archive.org', as they focus on archiving data, unlike WinFuture, where long-term availability isn’t guaranteed.

No, it cannot be downloaded directly, the links expire after ~24h hours, please see #284

archive.org allows direct downloads, as you demonstrated, but usually archive.org downloads are pretty slow, so you are better off with just visiting winfuture.de website and download it with your browser.
`
Saving to: 'de_windows_7_professional_with_sp1_x86_dvd_u_677093.iso'

ofessional_with_sp1 0%[ ] 6,16M 971KB/s eta 43m 43s
`
If you have any FAST mirrors with real direct download links, feel free to provide a link.

I also wonder why a German ISO was chosen? An English ISO might reduce potential compatibility issues with language settings.

It doesn't matter, required components are language independent, I just found this ISO to bo on a fast download mirror, also see: #143

Another question: Why was Windows 7 selected? NTVDM is still available in 32-bit Windows 10, making it a viable and more recent option.

Because required components are not available within Windows 10 ISO.

Okay, the scripts have more problems than just missing download components. For example, the improper unmounting of virtual drives of prematurely aborted scripts.

Virtual drive is just a crude workaround for people not obeying the well-documented path limit, better use it in the way documented and use a work directory in the root of your drive.

And the independent portable execution, despite the protected folder monitoring being activated in Bitdefender. In the end, I was not able to successfully generate the files.

Not sure what is meant here.

@zedd-0
Copy link
Author

zedd-0 commented Dec 22, 2024

"And the independent portable execution, despite the protected folder monitoring being activated in Bitdefender. In the end, I was not able to successfully generate the files."

this was lost in translation...
it is from german windows "Defender\Ransomware-Schutz\Überwachter Ordnerzugriff"
i try GPT-translation: "Defender\Ransomware protection\Controlled Folder Access"

It is enabled by default by me.
It blocks access to the home directory and blocks apps that perform deep system access.
For example, low-level drive queries.

"archive.org"
Yes, it's not the fastest, but maybe consider it as a backup.

"ntvdmx64"
For which platform should the tool be? Currently, Windows 10 & 11 are mostly used. Or should it also work for Windows XP x64?
From Windows 7 SP1 onwards, PowerShell could be used.

For 'MinNT*.zip' and 'old-src.trunk.r687.20150728.7z', I would still recommend adding the archive.org links.
I had to search for a while, and I couldn't find other sources.

"If you have any FAST mirrors with real direct download links, feel free to provide a link."
Actually, there used to be entire lists of direct downloads for Windows ISOs from "*.microsoft.com".
Strangely, I can't find these lists anywhere anymore...

"Virtual drive is just a crude workaround for people not obeying the well-documented path limit, better use it in the way documented and use a work directory in the root of your drive."
Maybe it would be a good idea to search all drives for an identifying file.
This way, the script doesn't get stuck with too many drive letters.
I had 4 drives left in Explorer, who knows what happens if all drive letters are used up...

@leecher1337
Copy link
Owner

this was lost in translation... it is from german windows "Defender\Ransomware-Schutz\Überwachter Ordnerzugriff" i try GPT-translation: "Defender\Ransomware protection\Controlled Folder Access"

It is enabled by default by me. It blocks access to the home directory and blocks apps that perform deep system access. For example, low-level drive queries.

Aha, überwachter Ordnerzugriff, was ist denn das schon wieder für ein Schmarrn, den sich Microsoft da einfallen hat lassen?
Was ist da jetzt konkret gewünscht? Irgendwie erkennen, dass das eingeschaltet ist und den Benutzer dann warnen, dass er das vor der Installation abdrehen soll?
Gibts dazu ein Kommando? Falls ja, vmtl am Einfachsten einen Pull-Request machen, nachdem das Ganze getestet wurde.

"archive.org" Yes, it's not the fastest, but maybe consider it as a backup.

"ntvdmx64" For which platform should the tool be? Currently, Windows 10 & 11 are mostly used. Or should it also work for Windows XP x64? From Windows 7 SP1 onwards, PowerShell could be used.

It must remain compatible with Windows XP 64bit / Server 2003, a lot of effort went into making this compatible with these Windows Versions (as writing the loader is more complicated for these Versions), as there is no hook that gets called by the loader unlike on Windows 7 and above.
I reserved the right to skip support for Windows Vista however.

For 'MinNT*.zip' and 'old-src.trunk.r687.20150728.7z', I would still recommend adding the archive.org links. I had to search for a while, and I couldn't find other sources.

Iirc there is a planetkode.*** mirror, but putting no links to these code bases is intentional. This has legal reasons and helps that the project doesn't get DMCAed so easily (MINNT was on github once, but got DMCAed after a relatively short amount of time which indicates that it is not safe to include or auto-download it. This is because it contains leaked Windows Sourcecode). NTVDMx64 is up for years and still there. The whole reason behind the complicated build process and the release as patch set is that NTVDMx64 doesn't pull in copyrighted leaked material.

"Virtual drive is just a crude workaround for people not obeying the well-documented path limit, better use it in the way documented and use a work directory in the root of your drive." Maybe it would be a good idea to search all drives for an identifying file. This way, the script doesn't get stuck with too many drive letters. I had 4 drives left in Explorer, who knows what happens if all drive letters are used up...

Should be fixed now.

@zedd-0
Copy link
Author

zedd-0 commented Dec 27, 2024

"Aha, überwachter Ordnerzugriff, was ist denn das schon wieder für ein Schmarrn"

I've nonetheless translated the answer into English.

This "Schmarrn" has saved my ass before,
but unfortunately, it didn't protect me from my own incompetence. :D
If you mindlessly throw everything into the whitelist, the protection ends up being pointless.
With people who have no basic computer knowledge, I always enable it,
and so far, there have been no questions or complaints.

There’s no decent way to properly configure Defender via PowerShell.
(Too tightly locked down)
But my intention was never to disable Defender,
but rather to avoid the "critical" features.
I can understand why virtual drives are used here.

Personally, I try to make my scripts work mostly with relative paths, so they remain portable.
If it doesn’t work because of faulty special characters,
I resort to "Temp directories" in standard paths or in the root directory of the current drive.

Note that this is just my style and not a lecture. ;)

As for the rest, I agree,
and I thank you for the fix.

@leecher1337
Copy link
Owner

Ah, ok, so it was just a note what could cause problems for a user using this feature, I must admit I never heard of it before. Well, thanks for that hint. Maybe I should check subst return code too and abort if virtual drive creation is blocked by such a lockdown feature?

I can't imagine any possible security implication of creating virtual drive letters, but on the other hand, people with such locked down systems wouldn't be able to install NTVDMx64 anyway, so I guess no real-life usage implications here.
There is no real other non-invasive solution for shorteining to MAX_PATH anyway.

@zedd-0
Copy link
Author

zedd-0 commented Dec 28, 2024

Sure, I know that such a project will definitely annoy Windows somewhere.
But since I've been using 'Controlled Folder Access' and have whitelisted* 'cmd' and 'powershell',
I haven't really noticed any other blockages.

(* I know myself that whitelisting 'cmd' and 'powershell' is not a good idea,
as any other script could eventually spread chaos unchecked.
Unfortunately, I rely on this for my workflow.)

As I said, it mainly protects the user's data,
but if you use directories outside of those, you can pretty much do whatever you want.

The only other blockage I've encountered was with low-level access to hard drives when partitioning or creating backups..."

Well, to be honest, I usually avoid modifying my Windows, but as far as I remember,
the script didn't even get that far, as it failed during the package build process.

However, I won't continue following your project, as I prefer a different approach for 16-bit programs.
Still, I find it interesting that someone is diving so deep into Windows. :D

Thanks a lot, have a nice day.
Bye.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants