Search found 1053 matches

by geek
30 Jan 2024, 10:50
Forum: Ask for Help (v2)
Topic: VarSetCapacity() and NumPut() to V2? Topic is solved
Replies: 2
Views: 275

Re: VarSetCapacity() and NumPut() to V2? Topic is solved

monitorInfo := Buffer(40) NumPut("UPtr", 40, monitorInfo) Though technically speaking, the original code should have specified "Int" or "UInt" type instead of letting it default to "UPtr". The MONITORINFO struct's first field is DWORD type, which is equivalent to AHK's "UInt" type. monitorInfo := B...
by geek
20 Jan 2024, 09:31
Forum: Wish List
Topic: Make global keyword at top level throw
Replies: 2
Views: 598

Make global keyword at top level throw

Especially with the transition from v1, we have a lot of users come into the Discord to ask why code such as this is not working: global counter := 1 x::{ MsgBox counter++ } but instead throwing "Error: Expected a Number but got an unset variable." Instead, I think this code should throw a load-time...
by geek
19 Jan 2024, 16:31
Forum: Wish List
Topic: The help file of v2 need more examples.
Replies: 2
Views: 397

Re: The help file of v2 has too few examples.

The documentation is editable by anyone who signs up for GitHub. You are allowed, even encouraged, to submit new examples whenever you look for an example to show something, do not find it, then write code to do that on your own. To do this, open the documentation page online at https://autohotkey.c...
by geek
19 Jan 2024, 15:02
Forum: Bug Reports
Topic: Exploit PoCs
Replies: 36
Views: 2607

Re: Exploit PoCs

I realized I didn't point out how the first exploit is to some extent an AHK vulnerability and not just a Microsoft vulnerability. When we decompile and recompile the CHM file it still continues to work as expected, it just does whatever malicious deeds an attacker wants it to do. Like all CHM file...
by geek
19 Jan 2024, 14:31
Forum: Bug Reports
Topic: Exploit PoCs
Replies: 36
Views: 2607

Re: Exploit PoCs

I haven't seen the PoC to know what's going on here, but I'd say any class of "vulnerability" that results in code execution under the current user context is really not a concern, in terms of AutoHotkey. Wherever AHK is available, just running code through AHK is immediately the better choice than ...
by geek
15 Jan 2024, 13:56
Forum: Ask for Help (v2)
Topic: Image list memory leak Topic is solved
Replies: 4
Views: 366

Re: Image list memory leak Topic is solved

According to the AutoHotkey documentation here https://www.autohotkey.com/docs/v2/misc/ImageHandles.htm , handles provided to an ImageList by HICON: or HBITMAP: are automatically freed by AutoHotkey when appropriate. Your HandleFromBase64 function is creating a bitmap pointer, which is not freed app...
by geek
15 Jan 2024, 10:29
Forum: Ask for Help (v2)
Topic: Image list memory leak Topic is solved
Replies: 4
Views: 366

Re: Image list memory leak Topic is solved

Can you please share the content of HandleFromBase64
by geek
10 Jan 2024, 07:05
Forum: Scripts and Functions (v2)
Topic: Geek's HashMap.ahk
Replies: 0
Views: 946

Geek's HashMap.ahk

HashMap.ahk This library provides a hash map based alternative implementation of AutoHotkey's Map class, with the goal of allowing drop-in replacement for situations where the native Map's performance limitations have been reached. Why AutoHotkey's native Maps, as well as its basic Objects, use sor...
by geek
04 Jan 2024, 13:28
Forum: Scripts and Functions (v2)
Topic: mm() a MsgBox alternative for debugging that shows not just the value but the source-code expression evaluated
Replies: 9
Views: 2144

Re: mm() a MsgBox alternative for debugging that shows not just the value but the source-code expression evaluated

I just had a thought, about using the Error's stack trace to extract the expression text rather than trying to read it out of the file. It seems to work ok, but I did not think about this extensively to understand if it will work everywhere. But to the extent that it does work, it works without need...
by geek
28 Dec 2023, 10:12
Forum: Tutorials (v2)
Topic: MCode Tutorial (Compiled Code in AHK)
Replies: 17
Views: 3920

Re: MCode Tutorial (Compiled Code in AHK)

In section "3. Multiple Functions" at "If you look in the code" add a godbolt link https://godbolt.org/z/G16YrYWsY I hesitate to post just godbolt share links, with the concern that the content at that link may expire or change at some point in the future which would cause confusion. Though, the go...
by geek
27 Dec 2023, 23:46
Forum: Tutorials (v2)
Topic: MCode Tutorial (Compiled Code in AHK)
Replies: 17
Views: 3920

Re: MCode Tutorial (Compiled Code in AHK)

I have made adjustments to the tutorial to start with the basics of MCode and with the simple examples that can be easily implemented using godbolt, before moving into MCode features that are challenging to implement with traditional tools (like multiple-function codes or codes with global variables...
by geek
24 Dec 2023, 08:22
Forum: Tutorials (v2)
Topic: MCode Tutorial (Compiled Code in AHK)
Replies: 17
Views: 3920

Re: MCode Tutorial (Compiled Code in AHK)

I don't understand the problem that is being solved The example set are fabricated problems that could absolutely be solved other ways. Problems that benefit from MCode are difficult to stage in a tutorial like this because they are typically very contextual. Yesterday, for example, I was helping t...
by geek
23 Dec 2023, 10:08
Forum: Tutorials (v2)
Topic: MCode Tutorial (Compiled Code in AHK)
Replies: 17
Views: 3920

Re: MCode Tutorial (Compiled Code in AHK)

I had a copy of the original content too, I've restored the original post content.
by geek
23 Dec 2023, 09:21
Forum: Tutorials (v2)
Topic: MCode Tutorial (Compiled Code in AHK)
Replies: 17
Views: 3920

Re: MCode Tutorial (Compiled Code in AHK)

Could you give an example where a script creator makes the AutoHotkey source available but still has a good reason to not make the C source for the included mcode available? My suggestions was made from the POV of users of code posted to the AutoHotkey forum. When someone posts only compiled .exe s...
by geek
22 Dec 2023, 17:50
Forum: Tutorials (v2)
Topic: MCode Tutorial (Compiled Code in AHK)
Replies: 17
Views: 3920

Re: MCode Tutorial (Compiled Code in AHK)

Suggestion: advise script creators to bundle C source code and mcode creation tips as comments next to the mcode in source that they publish. That way script users have the power to examine the C source, generate mcode from it and thus verify the mcode. Otherwise the user has to blindly trust the m...
by geek
20 Dec 2023, 10:52
Forum: Tutorials (v2)
Topic: MCode Tutorial (Compiled Code in AHK)
Replies: 17
Views: 3920

MCode Tutorial (Compiled Code in AHK)

With great appreciation of the original MCode Tutorial by nnnik, from which has been rewritten and extended. Please visit the Wiki for the full tutorial. Machine code is the lowest level of binary code that your computer can run on. Programming languages like C, C++, Rust, and Go all compile to mach...
by geek
19 Dec 2023, 07:26
Forum: Other Utilities & Resources
Topic: Syntax Check Utility
Replies: 6
Views: 8165

Re: Syntax Check Utility

I presume this is for V1. I’m on a Mac and would love to be able to check AHK scripts before testing on a PC at another site. Is the source available so I could build a MacOS version? AutoHotkey should run on MacOS via Wine, at least well enough to validate the syntax of a script. Other than that, ...
by geek
16 Dec 2023, 22:03
Forum: Scripts and Functions (v2)
Topic: New mcode generator with some cool features
Replies: 10
Views: 1452

Re: New mcode generator with some cool features

According to Cloaker, who wrote the code for linking and relocations, "clever solutions are too easy and not enough fun" and "I think I did want multiple object files originally before I realized that those objects are better off as dynamic objects". Also, just a heads up: the README, examples, and ...
by geek
16 Dec 2023, 14:43
Forum: Scripts and Functions (v2)
Topic: New mcode generator with some cool features
Replies: 10
Views: 1452

Re: New mcode generator with some cool features

Have you looked any at the work we're doing on the MCL Machine Code Library for AHK? A brief feature set: * Supports C and C++ (and includes some very trimmed down hand-written replacements for some of the standard headers) * Supports 32 and 64 bit * Includes an AutoHotkey-based Linker * Allows expo...
by geek
11 Dec 2023, 09:59
Forum: Scripts and Functions (v2)
Topic: mm() a MsgBox alternative for debugging that shows not just the value but the source-code expression evaluated
Replies: 9
Views: 2144

Re: mm() a MsgBox alternative for debugging that shows not just the value but the source-code expression evaluated

Interesting concept, though it's worth noting that it does not work with tools that pass the script code to AHK by StdIn instead of by a file (like CodeQuickTester, the wiki sandbox , and some other tools), and if you edit the file of a running script it will reflect the new version not the running ...

Go to advanced search