Author Topic: MasmBasic  (Read 143727 times)

jj2007

  • Moderator
  • Member
  • *****
  • Posts: 7549
  • Assembler is fun ;-)
    • MasmBasic
MasmBasic bugfix
« Reply #165 on: March 01, 2014, 10:46:41 PM »
Update 1 March with two minor bugfixes:
- Launch could give a wrong ExitProcess return value
- buffers created with SetGlobals choked when invoked as e.g. MsgBox 0, addr buffer, ...

jj2007

  • Moderator
  • Member
  • *****
  • Posts: 7549
  • Assembler is fun ;-)
    • MasmBasic
ArrayMerge Dest$(), Src$()
« Reply #166 on: March 27, 2014, 03:13:28 PM »
EDIT: Version SetupMasmBasic27March14.zip fixes a bug that prevented \Masm32\MasmBasic\Res\XlsViewer.asc to send text to Excel.

Update 27 March 2014:
- ArrayMerge does what the name says, it merges two string arrays:

include \masm32\MasmBasic\MasmBasic.inc      ; download
  Init                  ; ## merge two string arrays ##
  Dim Dest$()
  Dim Src$()
  xor ecx, ecx
  .Repeat
      Let Dest$(ecx)=Str$("Destination #%i", ecx)
      Let Src$(ecx)=Str$("Source #%i", ecx)
      inc ecx
  .Until ecx>=5
  ArrayMerge Dest$(), Src$()
  push Dest$(?)      ; put the new element counter on the stack
  xor ecx, ecx
  .Repeat
      Print Str$("\n#%i\t", ecx), Dest$(ecx)      ; see dest 0...4, then source 0...4
      inc ecx
  .Until ecx>=stack
  pop eax
  Exit
end start


Output:
#0      Destination #0
#1      Destination #1
#2      Destination #2
#3      Destination #3
#4      Destination #4
#5      Source #0
#6      Source #1
#7      Source #2
#8      Source #3
#9      Source #4


- Str$() can now handle leading spaces or zeros:

include \masm32\MasmBasic\MasmBasic.inc      ; download
  Init                  ; ## leading spaces for Str$() ##
  Print Str$("\nA number: %__i", 1)
  Print Str$("\nA number: %__i", 12)
  Print Str$("\nA number: %__i", 123)
  Print Str$("\nA number: %000i", 1)
  Print Str$("\nA number: %000i", 12)
  Print Str$("\nA number: %000i", 123)
  Exit
end start

Output:
A number:   1
A number:  12
A number: 123
A number: 0001
A number: 0012
A number: 0123
« Last Edit: March 27, 2014, 10:12:14 PM by jj2007 »

sinsi

  • Member
  • ****
  • Posts: 996
Re: MasmBasic
« Reply #167 on: April 12, 2014, 10:27:40 PM »
Installing the latest version
I can walk on water but stagger on beer.

sinsi

  • Member
  • ****
  • Posts: 996
Re: MasmBasic
« Reply #168 on: April 12, 2014, 10:38:32 PM »
I see the menu problem is still there, in my case the text is yellow and unreadable.
Clicking one seems to stop it from working from then on too, unless you click another menu..
I can walk on water but stagger on beer.

jj2007

  • Moderator
  • Member
  • *****
  • Posts: 7549
  • Assembler is fun ;-)
    • MasmBasic
Re: MasmBasic
« Reply #169 on: April 12, 2014, 10:46:32 PM »
The crash box is the equivalent to MS Word auto recovery. It happens when user exited an edit session in an, ehm, unusual way. Normally it shouldn't happen, RichMasm is pretty stable, but a forced reboot could cause that, for example. Or killing the editor with Task Manager. I usually click Yes.

Re menus, yes the yellow-brownish font was the compromise for Vista Aero, and I also don't like it. Do the menus work at least? And can you reproduce the hanging?

jj2007

  • Moderator
  • Member
  • *****
  • Posts: 7549
  • Assembler is fun ;-)
    • MasmBasic
SetLaunchTimeout
« Reply #170 on: April 15, 2014, 08:27:27 AM »
Update 15 April (download here):
Quote
Launch
...
- the default timeout for a "normal" Launch is ten seconds; if you mostly need asynchronous launches,
  you can modify this value with e.g. SetLaunchTimeout 1 (in ms)

And this solved also the little problem with the ten seconds "hanging" of RichMasm ;-)

jj2007

  • Moderator
  • Member
  • *****
  • Posts: 7549
  • Assembler is fun ;-)
    • MasmBasic
Windows Safer
« Reply #171 on: April 18, 2014, 09:29:40 AM »
Update 18 April features some improvements of the registry functions:
- SetReg64 allows to read the registry on a 64-bit system
- GetRegVal returns now
  1. a pointer to the string or the data in eax
  2. the type (REG_DWORD ...) in edx
  3. REG_QWORD values in xmm0; same for the first 16 bytes of REG_BINARY
- finally, xmm0 is now a valid argument for the fDate$() and fTime$() macros.

Below an example which reads the "Safer" keys and displays first the "official" LastModified value, and second, the real modification date and time as reported by the registry's timestamp.

include \masm32\MasmBasic\MasmBasic.inc      ; download
  Init
  Let esi="HKLM\SOFTWARE\Policies\Microsoft\Windows\Safer\CodeIdentifiers\0\Hashes\"
  GetRegKeyArray esi, My$(), LastMod()
  .if eax
      push eax

      xor ecx, ecx
      PrintLine esi, CrLf$, "... modified according to LastModified value:"
      .Repeat
            ; GetRegVal returns the LastModified REG_QWORD in xmm0:
            void GetRegVal(Cat$(esi+My$(ecx)), "LastModified", 0)
            PrintLine fDate$(xmm0, "dd MMMM yyyy   "), Tb$, fTime$(xmm0), Spc2$, My$(ecx)
            inc ecx
      .Until ecx>=stack

      xor ecx, ecx
      PrintLine CrLf$, "Hashes modified according to registry timestamp:"
      .Repeat
            PrintLine fDate$(LastMod(ecx), "dd MMMM yyyy   "), Tb$, fTime$(LastMod(ecx)), Spc2$, My$(ecx)
            inc ecx
      .Until ecx>=stack

      pop eax
  .endif
  Inkey Str$("\n%i keys found\n", eax)
  Exit
end start


Source & exe attached. The second attachment (RADAR) lists all software on your PC that suffered from a heap leak. Very interesting, but it works only on Windows 7 and higher, so right now I can't test it. Please post some example output :icon_mrgreen:

sinsi

  • Member
  • ****
  • Posts: 996
Re: MasmBasic
« Reply #172 on: April 18, 2014, 10:00:47 AM »
Quote
Please post some example output
0 keys found
0 keys found

 :biggrin:
I can walk on water but stagger on beer.

jj2007

  • Moderator
  • Member
  • *****
  • Posts: 7549
  • Assembler is fun ;-)
    • MasmBasic
RADAR
« Reply #173 on: April 18, 2014, 03:44:17 PM »
Hi sinsi,

Yesterday I tested it on Win7, and got the Who's Who of the software industry, Acrobat.exe on top... do you see HKLM\SOFTWARE\Microsoft\RADAR\HeapLeakDetection\DiagnosedApplications\ in regedit, or is it simply absent?

But wait - you are on Win8-64, right? This could do the trick:

  Init
  SetReg64
  Let esi="HKLM\SOFTWARE\Microsoft\RADAR\HeapLeakDetection\DiagnosedApplications\"
  GetRegKeyArray esi, Radar$(), Modified()


Modified package attached.

BTW first tests with SetReg64 failed miserably until I discovered that KEY_WOW64_32KEY was 100h, not 100 as set in Windows.inc (see also Don57,
windows.inc KEY_WOW64_32KEY def'n error
)

sinsi

  • Member
  • ****
  • Posts: 996
Re: MasmBasic
« Reply #174 on: April 18, 2014, 03:51:29 PM »
 :t
HKLM\SOFTWARE\Microsoft\RADAR\HeapLeakDetection\DiagnosedApplications\
... modified according to Modifiedified value:
03 March 2014           00:00:00  BurnoutParadise.exe
14 May 2013     05:14:28  CNC4.game
21 January 2014         03:50:13  CoDWaW LanFixed.exe
04 August 2013          23:56:45  DllHost.exe
03 February 2014        01:05:19  eduke32.exe
01 April 2014           08:45:25  firefox.exe
09 February 2014        11:13:45  GasGuzzlers.exe
15 September 2013       08:33:07  IEXPLORE.EXE
27 June 2013    09:35:22  Need for Speed The Run.exe
07 January 2014         06:52:41  NFS11.exe
05 April 2014           06:26:25  NFS13.exe
20 November 2013        05:35:14  shift2u.exe
22 December 2013        00:19:09  simnow.exe
30 April 2013           08:29:50  Stronghold3.exe
10 April 2014           06:43:19  TiWorker.exe

15 keys found
I can walk on water but stagger on beer.

jj2007

  • Moderator
  • Member
  • *****
  • Posts: 7549
  • Assembler is fun ;-)
    • MasmBasic
Re: RADAR
« Reply #175 on: April 18, 2014, 03:55:06 PM »
Thanks :biggrin:

Nice to see two competing browsers here. Would be even nicer to see how much they are leaking ;-)

01 April 2014           08:45:25  firefox.exe
15 September 2013       08:33:07  IEXPLORE.EXE

Gunther

  • Member
  • *****
  • Posts: 3515
  • Forgive your enemies, but never forget their names
Re: MasmBasic
« Reply #176 on: April 18, 2014, 10:38:03 PM »
Jochen,

Code: [Select]
HKLM\SOFTWARE\Microsoft\RADAR\HeapLeakDetection\DiagnosedApplications\
... modified according to Modifiedified value:
06 Februar 2014         00:00:00  ChessProgram13.exe
16 Januar 2014          19:00:27  firefox.exe
07 Oktober 2013         00:06:34  FlashPlayerPlugin_11_8_800_168.exe
12 Januar 2014          16:20:51  FlashPlayerPlugin_11_9_900_170.exe
17 Februar 2014         23:10:44  FlashPlayerPlugin_12_0_0_44.exe
02 April 2014           11:19:31  FlashPlayerPlugin_12_0_0_77.exe

6 keys found

Gunther
Get your facts first, and then you can distort them.

jj2007

  • Moderator
  • Member
  • *****
  • Posts: 7549
  • Assembler is fun ;-)
    • MasmBasic
Re: RADAR
« Reply #177 on: April 19, 2014, 08:25:29 PM »
Thanks. Gunther. How dare you run such old versions of Flash?? I haven't rebooted my machine today, but I am sure Adobe has a better version for us, with better performance and less risks, grosses Indianerehrenwort ;-)

Here results from a rarely used notebook with no Internet connection:

HKLM\SOFTWARE\Microsoft\RADAR\HeapLeakDetection\DiagnosedApplications\
... modified according to ModifiedValue:
05 January 2014         00:00:00  firefox.exe
20 March 2014           17:31:46  InsertDeleteNumArrays.exe
10 November 2012        23:13:25  OllyDbg.exe
04 January 2014         20:15:58  svchost.exe_netsvcs
10 November 2012        20:37:00  TrustedInstaller.exe

Hint: One of these leaky apps is from a well-known hobby coder testing his library ;-)

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 4812
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: MasmBasic
« Reply #178 on: April 19, 2014, 08:35:50 PM »
 :biggrin:

Flash is not the problem I have, its the McCafee crap that is bundled with it. I have to uninstall it every time Flash wants an upgrade.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :biggrin:

Gunther

  • Member
  • *****
  • Posts: 3515
  • Forgive your enemies, but never forget their names
Re: MasmBasic
« Reply #179 on: April 19, 2014, 09:03:29 PM »
:biggrin:
Flash is not the problem I have, its the McCafee crap that is bundled with it. I have to uninstall it every time Flash wants an upgrade.

that is the point.

Gunther
Get your facts first, and then you can distort them.