Search found 286 matches

by pneumatic
24 Nov 2019, 16:39
Forum: Ask For Help
Topic: Convert number to string with StrGet()
Replies: 19
Views: 647

Re: Convert number to string with StrGet()

Damn, so what is the number retrieved by NumGet()? It does change for certain strings (long ones vs short ones) just not the strings you happened to specify. But it doesn't change enough to provide security.

Similar thing with MsgBox, % Format( "{1:i}" , "3bea1dd4dec09f279d24ccea3c138735" )
by pneumatic
24 Nov 2019, 15:33
Forum: Ask For Help
Topic: Convert number to string with StrGet()
Replies: 19
Views: 647

Re: Convert number to string with StrGet()

For fun, here's how my system would work. Criticism encouraged! 1. Compile and MPRESS the script to an exe 2. Generate hash of exe and convert to number with NumGet() 3. "Encrypt" the number by performing some arbitrary convoluted maths on the number 4. Store result of (3) on disk somewhere, prefera...
by pneumatic
24 Nov 2019, 15:13
Forum: Ask For Help
Topic: Convert number to string with StrGet()
Replies: 19
Views: 647

Re: Convert number to string with StrGet()

I just realised, I don't need to convert it back to a string when I could just compare the result of NumGet() to a copy stored on disk.

But I'm still curious to know if there is a way to convert a var's binary data to a string.
by pneumatic
24 Nov 2019, 15:01
Forum: Ask For Help
Topic: Convert number to string with StrGet()
Replies: 19
Views: 647

Re: Convert number to string with StrGet()

Chunjee wrote:
24 Nov 2019, 14:47
I always just append the number to a blank string:

Code: Select all

number := 8
str := "" number
msgbox, % str
; => "8"
But I want to convert its binary data back to Unicode characters.

I think this does the same as your example

Code: Select all

string := Format( "{1:s}" , 123)
msgbox % string
by pneumatic
24 Nov 2019, 14:52
Forum: Ask For Help
Topic: Convert number to string with StrGet()
Replies: 19
Views: 647

Re: Convert number to string with StrGet()

don't But I don't trust the algorithms in crypt32.dll, bcrypt.dll, msvcrt.dll to produce the same output on all Windows systems. I'd rather just write my own simple encryption, like just multiplying the string (which is a hash of my app's exe) by, say, my birthdate and then divide by some other num...
by pneumatic
24 Nov 2019, 14:16
Forum: Ask For Help
Topic: Convert number to string with StrGet()
Replies: 19
Views: 647

Convert number to string with StrGet()

I'm trying to implement my own [very basic] encryption algorithm to perform mathematical operations on a string. My idea is to convert the string to a number first, then perform maths on that number, before converting it back to string. string1 := "string" string2 := NumGet(string1) ;convert string ...
by pneumatic
23 Nov 2019, 17:11
Forum: Scripts and Functions
Topic: CNG (Cryptography API: Next Generation)
Replies: 64
Views: 14781

Re: CNG (Cryptography API: Next Generation)

pneumatic , Every implementation of a given hash function (say, SHA256) must give the same hash, under any OS, under any circumstance. If it does not, the implementation is faulty. Yes, that does make sense. I guess one other worry I have is that different versions of that dll might use different f...
by pneumatic
23 Nov 2019, 10:30
Forum: Scripts and Functions
Topic: CNG (Cryptography API: Next Generation)
Replies: 64
Views: 14781

Re: CNG (Cryptography API: Next Generation)

Since the library uses advapi32.dll to generate hashes, I am worried that maybe different Windows systems will have different versions of advapi32.dll in their System32 folder, which might use slightly different implementation, causing a different hash to be generated, which would break my entire ap...
by pneumatic
22 Nov 2019, 05:29
Forum: Ask For Help
Topic: DllCall return type Topic is solved
Replies: 5
Views: 235

Re: DllCall return type Topic is solved

I think I understand what you're saying, insofar as the underlying binary data being the same for practical purposes, regardless of signness. But I was concerned that perhaps when ahk's source code for DllCall interacts with WinAPI, that ahk might be telling WinAPI "please return me a value of type ...
by pneumatic
22 Nov 2019, 03:54
Forum: Ask For Help
Topic: DllCall return type Topic is solved
Replies: 5
Views: 235

Re: DllCall return type Topic is solved

(prefix u or not doesn't matter). Are you sure because Prepend the letter U to any of the integer types above to interpret it as an unsigned integer. Strictly speaking, this is necessary only for return values and asterisk variables because it does not matter whether an argument passed by value is ...
by pneumatic
21 Nov 2019, 16:13
Forum: Ask For Help
Topic: DllCall return type Topic is solved
Replies: 5
Views: 235

DllCall return type Topic is solved

DllCall("LoadLibrary", "Str", "Psapi.dll") Why does the above work, given the LoadLibrary function returns a HMODULE, and we haven't specified a return type, as per: ReturnType: If the function returns a 32-bit signed integer (Int), BOOL, or nothing at all, ReturnType may be omitted. Otherwise, spe...
by pneumatic
21 Nov 2019, 07:46
Forum: Ask For Help
Topic: Does ahk automatically load ntdll.dll? Topic is solved
Replies: 2
Views: 113

Does ahk automatically load ntdll.dll? Topic is solved

DllFile may be omitted when calling a function that resides in User32.dll, Kernel32.dll, ComCtl32.dll, or Gdi32.dll. For example, "User32\IsWindowVisible" produces the same result as "IsWindowVisible". However it seems I can call functions inside ntdll.dll, without having to specify ntdll.dll, whic...
by pneumatic
21 Nov 2019, 07:07
Forum: Scripts and Functions
Topic: XGraph v1.1.1.0 : Real time data plotting.
Replies: 27
Views: 22624

Re: XGraph v1.1.1.0 : Real time data plotting.

I notice XGraph uses DllCall("RtlMoveMemory") According to WinAPI here , it resides in ntdll.dll, which is not part of ahk's automatically loaded .dlls (User32.dll, Kernel32.dll, ComCtl32.dll, and Gdi32.dll). According to ahk doc, the only time we can omit DllFile name, is if the function is inside ...
by pneumatic
19 Oct 2019, 20:04
Forum: Ask For Help
Topic: FileSelectFile sometimes ignores my Rootdir (ahk2exe or 32/64bit issue?) Topic is solved
Replies: 12
Views: 848

Re: FileSelectFile sometimes ignores my Rootdir (ahk2exe or 32/64bit issue?) Topic is solved

Here is my workaround if anyone's interested. Please see the "important" note in the comment, otherwise it may not work. FileSelectFile ,,, % GetFileSelectFileDir( "C:\StartingDirectory" ) GetFileSelectFileDir( ThisPath:="" ){ /* Workaround issue where Windows ignores your specified starting directo...
by pneumatic
18 Oct 2019, 14:28
Forum: Ask For Help
Topic: FileSelectFile sometimes ignores my Rootdir (ahk2exe or 32/64bit issue?) Topic is solved
Replies: 12
Views: 848

Re: FileSelectFile sometimes ignores my Rootdir (ahk2exe or 32/64bit issue?) Topic is solved

I've encountered some inconsistent behaviour in the way Windows writes the FirstFolder value to registry. i.e Delete registry's FirstFolder key -> run app -> FileSelectFile , , , C:\Path1 -> C:\Path1 gets written to registry FirstFolder value. FileSelectFile , , , (no path) -> select C:\Path2\File.e...
by pneumatic
15 Oct 2019, 07:39
Forum: Ask For Help
Topic: FileSelectFile sometimes ignores my Rootdir (ahk2exe or 32/64bit issue?) Topic is solved
Replies: 12
Views: 848

Re: FileSelectFile sometimes ignores my Rootdir (ahk2exe or 32/64bit issue?) Topic is solved

Just adding "\" sometimes works, sometimes fails. I finally got to the bottom of this. So the first time an application opens a FileSelectFile, Windows saves the starting directory parameter to HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\FirstFolder Then, if your a...
by pneumatic
13 Aug 2019, 05:07
Forum: Ask For Help
Topic: Timer threads interruptability
Replies: 5
Views: 480

Re: Timer threads interruptability

the takeaway is timers are interruptible, loops arent Loops can be interrupted as long as they're not Critical, or at a higher Priority than the thread trying to interrupt it, or inside the script's exit routine. Can't understand why in the following only first Sub1 works and never Sub2, they must ...
by pneumatic
13 Aug 2019, 04:36
Forum: Bug Reports
Topic: Trivial parsing issue with Gui , Add
Replies: 1
Views: 508

Trivial parsing issue with Gui , Add

#SingleInstance , Force ;Works Gui , Add , Text , % "x" . (2+2) . " y4 w35 h15" , Text ;Doesn't work Gui , Add , Text , % "x" . (2+2) . " y24 w35 h15" , Text: ;Works Gui , Add , Text , % "x" . (2+2) . " y44 w35 h15" , % "Text:" Gui , Show , w250 h65 Center , Gui return GuiClose: ExitApp return http...
by pneumatic
12 Jul 2019, 20:42
Forum: Ask For Help
Topic: COM object CPU leak in Win 10 Topic is solved
Replies: 3
Views: 470

Re: COM object CPU leak in Win 10 Topic is solved

Found the culprit, it was the motherboard's ethernet controller driver ("Killer E2200 Gigabit Ethernet Controller"). Motherboard is an Asrock Z97X Killer. I already knew that Killer ethernet software was dodgy as its "bandwidth control" feature was randomly turning itself on and throttling my networ...
by pneumatic
12 Jul 2019, 06:42
Forum: Ask For Help
Topic: COM object CPU leak in Win 10 Topic is solved
Replies: 3
Views: 470

Re: COM object CPU leak in Win 10 Topic is solved

Thanks.

I guess it must be something about my system configuration causing it. I will try a fresh install of Windows.

Go to advanced search