Re: PSA: Quick startup on the dedicated Duck.ai LLM/AI WebView2 chat mechanism
Maria Sophia <[email protected]>
| Newsgroups | alt.comp.os.windows-10,alt.comp.microsoft.windows,alt.comp.os.windows-11 |
|---|---|
| Organization | BWH Usenet Archive (https://usenet.blueworldhosting.com) |
| Message-ID | <[email protected]> |
Paul wrote:
> That's the packaging method for a Windows.App .
>
> At one time, the "blah.exe" file was a PE32 stub with zero execution time,
> that could cause the screen to flash. The file was actually a manifest file,
> with the manifest text staged after the PE32 stub.
>
> They liked the scheme so much, they reduced "blah.exe" to zero length.
> Now, you cannot click on it and make things blink. The manifest is
> still in the folder, somewhere. The manifest has sufficient signing
> and crypto, to ensure the thing loaded is "authentic" and has not
> been modified. If a hash of a file is incorrect, that should trigger
> a re-download of the materials.
>
> And for some of those, the folder is "access denied". Making your
> study of the materials a bit more difficult. That's not really a problem
> of course.
>
> The SHA checksum of a zero length file is not 0.
> It would be Bad Karma if that were to be true.
>
> Name: BadKarma
> Size: 0 bytes
> SHA256: E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855
>
> What happened there might well be Access Denied.
>
> I dare you, to make a source file, where the SHA256 output is all zeros :-)
> I'll wait. If you could do that, if you could manage to make an
> all zeros SHA256 legitimately, all the Bitcoins in the world
> would be worthless. A worthy objective.
Ah. That makes sense now. Windows is weird. They're using weird stuff.
Thanks Paul for summarizing that seemingly 0-length DuckDuckGo.exe file,
which was the target of the desktop shortcut, which had confused me so.
I looked up your statement. You are correct. It would be almost impossible
to make a file have all zeroes as the SHA256 hash.
python zero.py
nonce: 97169
sha256: 0000c858d777129d3cce827da7d78013efb6aedbaa4d08173f779541e8eeb2d1
saved as match.txt
# -----------------------------------------------------------------
# zero.py
# Use model: python zero.py => it will generate match.txt whose
# sha256 hash will start with the desired number of 0's
# -----------------------------------------------------------------
# v1p0 20260808 Generates files with 0000 hashes in a few seconds
# -----------------------------------------------------------------
import hashlib
base = b"hello world\n"
nonce = 0
while True:
data = base + str(nonce).encode()
digest = hashlib.sha256(data).hexdigest()
if digest.startswith("0000"):
with open("match.txt", "wb") as f:
f.write(data)
print("nonce:", nonce)
print("sha256:", digest)
print("saved as match.txt")
break
nonce += 1
# end of zero.py
--
If we don't understand how the OS works, we have no business being here.