News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Recent posts

#61
The Laboratory / Re: Invoke, call, jump. Simple...
Last post by sinsi - June 24, 2025, 08:46:42 PM
Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz (SSE4)
Microsoft Windows [Version 10.0.26100.4351]

==== TEST #1 CALLER ==============================================================
invoke: 33.84450        call: 33.37450  jmp: 26.55270   jmp_pushing: 33.06370
invoke: 33.45990        call: 33.31720  jmp: 26.50350   jmp_pushing: 33.07700
invoke: 33.25490        call: 33.28840  jmp: 26.54130   jmp_pushing: 33.15580
invoke: 33.10430        call: 33.11740  jmp: 26.47120   jmp_pushing: 32.96570
invoke: 33.10170        call: 33.15360  jmp: 26.49780   jmp_pushing: 33.04690
invoke: 33.12710        call: 33.10910  jmp: 26.46390   jmp_pushing: 33.08420
invoke: 33.08330        call: 33.10080  jmp: 26.48590   jmp_pushing: 32.87880
invoke: 33.12980        call: 33.17760  jmp: 26.49480   jmp_pushing: 32.99880
invoke: 33.12840        call: 33.12720  jmp: 26.48530   jmp_pushing: 33.06950
invoke: 33.18710        call: 33.09230  jmp: 26.50570   jmp_pushing: 32.88170
==== TEST #2 CALLER ==============================================================
invoke: 59.59570        call: 59.60400  jmp: 47.12650   jmp_pushing: 42.29450
invoke: 59.57080        call: 59.60340  jmp: 45.90970   jmp_pushing: 43.78430
invoke: 59.60710        call: 59.63960  jmp: 43.21370   jmp_pushing: 41.32330
invoke: 59.64870        call: 59.58620  jmp: 44.30890   jmp_pushing: 43.92940
invoke: 59.61300        call: 59.61520  jmp: 46.55210   jmp_pushing: 42.90500
invoke: 59.73040        call: 59.57440  jmp: 47.17210   jmp_pushing: 43.60190
invoke: 59.57470        call: 59.62530  jmp: 46.62040   jmp_pushing: 41.76730
invoke: 59.59960        call: 59.58450  jmp: 46.19870   jmp_pushing: 43.31890
invoke: 59.60240        call: 59.57950  jmp: 46.96230   jmp_pushing: 40.04710
invoke: 59.60350        call: 59.60040  jmp: 47.15910   jmp_pushing: 43.01760

231     cycles for 100 * proc aligned 16
194     cycles for 100 * proc aligned 16+3

227     cycles for 100 * proc aligned 16
181     cycles for 100 * proc aligned 16+3

224     cycles for 100 * proc aligned 16
195     cycles for 100 * proc aligned 16+3

229     cycles for 100 * proc aligned 16
184     cycles for 100 * proc aligned 16+3

221     cycles for 100 * proc aligned 16
185     cycles for 100 * proc aligned 16+3

15      bytes for proc aligned 16
19      bytes for proc aligned 16+3

2       = eax proc aligned 16
2       = eax proc aligned 16+3
#62
The Laboratory / Re: Invoke, call, jump. Simple...
Last post by jj2007 - June 24, 2025, 07:56:40 PM
Might be different on an Intel, though. Exe attached.
#63
The Laboratory / Re: Invoke, call, jump. Simple...
Last post by NoCforMe - June 24, 2025, 06:54:23 PM
Looks like a draw to me ...
#64
The Laboratory / Re: Invoke, call, jump. Simple...
Last post by jj2007 - June 24, 2025, 06:34:21 PM
Quote from: LordAdef on June 24, 2025, 06:57:25 AMjust a quick test to confirm or disprove myths

AMD Athlon Gold 3150U with Radeon Graphics      (SSE4)

396     cycles for 100 * proc aligned 16
419     cycles for 100 * proc aligned 16+3

401     cycles for 100 * proc aligned 16
400     cycles for 100 * proc aligned 16+3

409     cycles for 100 * proc aligned 16
399     cycles for 100 * proc aligned 16+3

401     cycles for 100 * proc aligned 16
418     cycles for 100 * proc aligned 16+3

397     cycles for 100 * proc aligned 16
398     cycles for 100 * proc aligned 16+3

15      bytes for proc aligned 16
19      bytes for proc aligned 16+3
#65
The Laboratory / Re: Invoke, call, jump. Simple...
Last post by NoCforMe - June 24, 2025, 07:41:48 AM
Trying to figure out what you're trying to figure out here.

Couple things:
  • Your invoke invoke_: doesn't that just amount to a CALL, since invoke_() is a parameter-less function?
    So your results for your "invoke" and "call" tests should be identical, no?
  • Your call_2(): looks like all that does is test a nested call sequence?
#66
The Laboratory / Invoke, call, jump. Simple ben...
Last post by LordAdef - June 24, 2025, 06:57:25 AM
Windows 11 - i7-7700HQ CPU @ 2.80GHz  2.80 GHz

Alignment is critical and will vary the results. It's just a quick test to confirm or disprove myths.


Quote==== TEST #1 CALLER ==============================================================
invoke: 51.18810        call: 44.13920  jmp: 35.24660  jmp_pushing: 44.74300
invoke: 44.96600        call: 44.10660  jmp: 34.26130  jmp_pushing: 42.71250
invoke: 43.77120        call: 45.44520  jmp: 35.09800  jmp_pushing: 46.52150
invoke: 43.47780        call: 43.58000  jmp: 34.77580  jmp_pushing: 43.93240
invoke: 43.99490        call: 43.36610  jmp: 39.00610  jmp_pushing: 48.52570
invoke: 43.75280        call: 43.35760  jmp: 34.31600  jmp_pushing: 42.59190
invoke: 44.27360        call: 44.22860  jmp: 34.54470  jmp_pushing: 42.56120
invoke: 43.04470        call: 42.56870  jmp: 35.17680  jmp_pushing: 42.03310
invoke: 44.51420        call: 42.30670  jmp: 33.87610  jmp_pushing: 43.54790
invoke: 43.75550        call: 42.78820  jmp: 34.55940  jmp_pushing: 42.61780
==== TEST #2 CALLER ==============================================================
invoke: 77.59330        call: 76.54300  jmp: 68.06050  jmp_pushing: 77.61630
invoke: 78.68050        call: 76.96140  jmp: 70.91430  jmp_pushing: 77.28310
invoke: 78.42120        call: 77.09150  jmp: 68.82880  jmp_pushing: 76.40940
invoke: 92.78660        call: 77.76970  jmp: 69.18330  jmp_pushing: 77.26350
invoke: 77.11010        call: 78.56060  jmp: 69.07500  jmp_pushing: 76.06720
invoke: 78.19980        call: 77.71200  jmp: 71.99470  jmp_pushing: 77.59610
invoke: 78.02620        call: 76.29750  jmp: 68.89000  jmp_pushing: 78.36600
invoke: 78.33900        call: 76.02230  jmp: 68.66480  jmp_pushing: 77.67070
invoke: 77.91140        call: 75.95980  jmp: 69.06700  jmp_pushing: 76.11040
invoke: 78.43950        call: 77.61860  jmp: 69.92810  jmp_pushing: 76.97630
#67
Windows API / Re: DLL pickle
Last post by NoCforMe - June 24, 2025, 05:56:59 AM
Yes? Please go on and elaborate. What about the instance handle?
#68
Hardware & Software Corner / EFI Boot Editor
Last post by Vortex - June 24, 2025, 05:08:13 AM
Boot Editor for (U)EFI based systems. The tool is providing a graphical user interface.

https://github.com/Neverous/efibooteditor
#69
ObjAsm / Re: New Editor
Last post by jj2007 - June 24, 2025, 04:50:35 AM
See your PMs :thumbsup:
#70
Windows API / Re: DLL pickle
Last post by tenkey - June 24, 2025, 03:49:32 AM
Quote from: NoCforMe on May 13, 2025, 05:44:14 AMSo I'm curious about how exactly processes work here. Does the DLL run in a separate process, or is it part of the debugee's process? Also, my understanding is that the DLL will be unloaded when the last program (process) that uses it terminates (i.e., when the reference count goes to zero); is that correct? It seems to work that way.

In any case, everything seems to be working OK. One possible snag occurs to me, though: what if there are multiple programs that are using that control? That means that the class will remain registered even after the DLL is unloaded.

IIRC, the HINSTANCE is a  memory pointer to where the EXE or DLL is loaded.  I believe It was in Win32 when HMODULE and HINSTANCE values became equated so that they are one and the same. That's why you get an HINSTANCE from GetModuleHandle.

To me, this implies that the DLL is loaded into the same process as the caller of LoadLibrary.