The MASM Forum

General => The Workshop => Topic started by: ThomasJaeger on March 07, 2015, 03:43:15 AM

Title: New Member (re: Visual MASM IDE)
Post by: ThomasJaeger on March 07, 2015, 03:43:15 AM
Hello,

I'm a new member and I just joined. I knew about masm32 since 2000 but I have renewed interest in assembly programming. I've been programming for 30 years now starting on a Z80 Amstrad and doing it professionally for 24 years now. I may ask stupid questions, please bare with me. I'm fascinated by the power and absolute control of assembly programming and I wish more people would start learning it. Looking around, I was not impressed with the existing IDE's available especially for beginners whip want to get their feet wet with assembly programming.

So, I created an IDE for MASM called Visual MASM. It supports Win32, Win64, and MS-DOS applications all in one. It's not perfect and it misses some major features but I just released the first version on my site at http://www.visualmasm.com (http://www.visualmasm.com). Please let me know what you think. Visual MASM supports masm32 and the Windows SDK (32 & 64 bit ML64).

Back in the day (2001) I started an IDE project named VASM but I never finished it. Today, I'm proud to say that I created a new IDE and it actually works really well. Let me know if you find any issues with it.

I know Visual MASM is missing the "visual" part but I wanted to release it anyways because you can already be very productive with it. It supports very large assembly projects and you can even mix different types of projects into one group.

Humbly,
Thomas Jaeger
http://www.visualmasm.com (http://www.visualmasm.com)
Title: Re: New Member
Post by: jj2007 on March 07, 2015, 05:37:33 AM
Looks impressive! Why does an IDE need WriteProcessMemory, a whole bunch of wsock32 functions and the like?
Title: Re: New Member
Post by: GoneFishing on March 07, 2015, 05:50:16 AM
Looks very nice but be ready for a lots of questions.
First, the size of executable . Which gui framework did you use ?
Tested it a little bit and often got Access violation writing process memory ( or so , didn't remember the exact text) message boxes .
Also, "sticky" tooltips . Your IDE found MASM32 installation but could not build the sample
Win32 project (the screenshot below) . It's interesting that the linker issued an attempt to build "Program" executable at the root of drive C .


Title: Re: New Member
Post by: ragdog on March 07, 2015, 06:06:31 AM
QuoteWhich gui framework did you use ?

Delphi with a skin libaray (AlphaControls) or other

QuoteI was not impressed with the existing IDE's available especially for beginners whip want to get their feet wet with assembly programming.

Radasm,Winasm not good enough?

But i think a dark gui and theme is to depressed

Title: Re: New Member
Post by: Vortex on March 07, 2015, 06:11:29 AM
Hi Thomas,

Double clicking the application, the installer starts to download immediately a file named Win32.7z  You should provide an option if the user is desiring to download that file. Canceling the download, the installer gets stuck. OS = XP Sp3
Title: Re: New Member
Post by: ThomasJaeger on March 07, 2015, 06:13:22 AM
Yup, I used Delphi 7 with AlphaControls.

I does check for a new version when it starts. If a new version is available, it would prompt you and then download it. Also, it offers to download the masm32 and WinSDK ISO file if you wish. This is during the Setup wizard.

Looks like I forgot to include the " for path names with spaces (c:\program files...) hence the c:\program. I will try to fix this later today.

I like the dark theme, that's why I did it. I plan on letting the user change to different themes, though.
Title: Re: New Member
Post by: ragdog on March 07, 2015, 06:23:23 AM
As gui theme use i my own theme from Windows theme
the color syntax of the editor must  decide the user.

But is your project.

greets,
Title: Re: New Member
Post by: ThomasJaeger on March 07, 2015, 06:28:29 AM
Win32.7z is the win32.hlp file in compressed format. You are right, I'll let the user decide. The thing is that if the win32.hlp can not be found, the F1 help won't work when you try to read more about a WinAPI function. Hmm, maybe I should make it part of the package.
Title: Re: New Member
Post by: dedndave on March 07, 2015, 06:36:43 AM
hi Thomas - welcome to the forum   :t

the project looks great - i know it's a lot of work
these guys will help you iron out the bugs, as you can see   :P
Title: Re: New Member
Post by: jj2007 on March 07, 2015, 07:35:38 AM
Quote from: jj2007 on March 07, 2015, 05:37:33 AM
Looks impressive! Why does an IDE need WriteProcessMemory, a whole bunch of wsock32 functions and the like?

No answer to a simple question?
Title: Re: New Member
Post by: GoneFishing on March 07, 2015, 08:56:17 AM
@ragdog  and @ThomasJaeger:
   thanks for your  replies

I like the dark color theme , it's eye-friendly and gives  "VS 2012 look and feel" to your IDE. 
Do you plan to add other items to View toolbar menu ? It would be better if we had an opportunity to customize layout , hide output  or project explorer window and switch off the tooltips , for example.

Regards
Title: Re: New Member
Post by: rrr314159 on March 07, 2015, 10:50:09 AM
Hi Thomas, welcome,

I like the dark color also, easier on the eyes. I'm also curious about jj2007's question, undoubtedly there's a good answer but we have a lot of "suspicious minds" (to quote the King - Elvis) around here. You've come to the right place if u want to give your IDE a good workout!
Title: Re: New Member
Post by: ThomasJaeger on March 07, 2015, 12:08:50 PM
I'm using a third party communications library to download the masm32 or the WinSDK ISO files. I'm also using the same library to check for a new version via a simple http get on my S3 storage. So, I guess it must be using wsock for the communication. The library is made by Eldos, a commercial library (https://www.eldos.com). Does that help?

I can't release the source since I'm using commercial libraries. Hope this helps.
Title: Re: New Member
Post by: rrr314159 on March 07, 2015, 02:11:52 PM
Sure, that helps! Personally I don't use IDE's since I'm already confused enuff by Windows, MASM, and Intel - don't need yet another package to get confused by. But I know a lot of people like them. jj2007's the expert; wrote the RichMASM editor, among other things; and if he's satisfied, so am I.

QuoteLooking around, I was not impressed with the existing IDE's available...

If you haven't already, check out EasyCode, RadAsm, WinAsm (not sure if RichMASM qualifies as an "IDE"). There are people here who like these and u could explain what's better/different about your approach. (One thing, they don't all support ML64). Of course u already have lots to do, just a suggestion for the future. But a basic feature comparison would be cool.

But, concerning extra features - I would much rather have a product that does what it does 100% reliably, than one that does 3 times as much 33% of the time

I admire your initiative, good luck!
Title: Re: New Member
Post by: Siekmanski on March 07, 2015, 05:46:05 PM
Hi Thomas,
Welcome to the forum.
Good luck with your project. Nice dark color theme.  :t

Marinus
Title: Re: New Member
Post by: jj2007 on March 07, 2015, 06:39:37 PM
Quote from: ThomasJaeger on March 07, 2015, 12:08:50 PM
I'm using a third party communications library to download the masm32 or the WinSDK ISO files. I'm also using the same library to check for a new version via a simple http get on my S3 storage. So, I guess it must be using wsock for the communication. The library is made by Eldos, a commercial library (https://www.eldos.com). Does that help?

I can't release the source since I'm using commercial libraries. Hope this helps.

OK, that explains the wsock. Now to WriteProcessMemory. Where and why does your IDE write to other people's processes?
Title: Re: New Member
Post by: ThomasJaeger on March 08, 2015, 02:48:56 AM
jj2007,

The only reference I could find about WriteProcessMemory is in my syntax highlighter for the API's. WriteProcessMemory is listed as one of the API commands. I did a windows grep search on my source and the third party libraries just to be sure and that's the only reference I could find.

Why do you say I'm writing to other people's memory? Why all this suspicion? I created Visual MASM actually mainly for myself because I wanted an IDE that helps me with my assembly. I wanted to get learn Windows assembly because my old DOS assembly knowledge is minimal. If you do not like it, do not use it. I'm simply sharing what I thought would be a nice gesture.
Title: Re: New Member
Post by: jj2007 on March 08, 2015, 03:29:09 AM
Quote from: ThomasJaeger on March 08, 2015, 02:48:56 AM
jj2007,

The only reference I could find about WriteProcessMemory is in my syntax highlighter for the API's. WriteProcessMemory is listed as one of the API commands. I did a windows grep search on my source and the third party libraries just to be sure and that's the only reference I could find.

Why do you say I'm writing to other people's memory? Why all this suspicion?

Because I have written my own IDE (like several other people here), and never saw a need for using wsock functions, hooks and, worst case, WriteProcessMemory. If it is your syntax highlighter, just post the code (+- 50 lines) that uses WriteProcessMemory. We will understand it.
Title: Re: New Member
Post by: rrr314159 on March 08, 2015, 03:47:41 AM
Evidently jj2007 is using some utility, grep, or a virus checker, that flagged your prog. If something unimportant like merely mentioning a questionable API call in a syntax highlighter causes an anti-virus to finger your prog, you need to know about it. Undoubtedly the question will come up again; it will be good to have an answer ready; or maybe you'd want to spell that one API reference with asterisks in the middle, or something. As for suspicion - of course people are suspicious on the internet, and they should be! No reason to take it personally; u wanted your program examined for any problems, that's exactly what we (well, not me - some of our less lazy members) are doing.
Title: Re: New Member
Post by: qWord on March 08, 2015, 04:19:58 AM
Quote from: ThomasJaeger on March 08, 2015, 02:48:56 AM
jj2007,
[...]Why all this suspicion?
Because he is the author of the best software library of the world and thus measure of all things.
But don't worry, the more infallible MasmBasic installer also marked me as potential criminal.
Title: Re: New Member
Post by: adeyblue on March 08, 2015, 05:15:14 AM
It's obviously a legit program, but you can see where he's coming from. Connecting to who knows where and downloading code, unpacking and executing embedded executables (its resources contain the 7-zip exe), and importing of the cryptographic and more furtive parts of the API (its skinning engine hooks GDI) are hallmarks of undesirable software
Title: Re: New Member
Post by: jj2007 on March 08, 2015, 06:15:53 AM
Quote from: qWord on March 08, 2015, 04:19:58 AM
Because he is the author of the best software library of the world and thus measure of all things.
But don't worry, the more infallible MasmBasic installer also marked me as potential criminal.

Hmmm.... how does your shrink evaluate these symptoms? Simple inferiority complex, or something more serious?
Title: Re: New Member
Post by: ThomasJaeger on March 08, 2015, 06:27:32 AM
I understand. You guys are a tough crowd but I do understand your concerns.  :icon_cool:

Here is a sample Delphi source that I use in my heavily customized SunEdit control in my SynHighlighterAsmMASM unit. This simply has a very large Unicode string that lists all API functions:

  Apis: UnicodeString =
    '__chkstk,__cppvalidateparameters,__glsparser_create,'+
    '__glsparser_print,__glsstring_appendchar,__glsstring_assign,__glsstring_init,'+
    '__pdxgetcmdline,__pdxinitializedata,__validateparameters,__wsafdisset,'+
   ...
    'writeprocessmemory,writeprocessorpwrscheme,writeprofilesection,'+
   ...

This is where you will see WriteProcessMemory listed. I do embed the the 7zip.dll because some of the code completion lists are ver large (almost 40,000 EQU's and API function names) and I simply reached the limit to hard code these things inside a function (more than 64 Kb in Delphi). So, I embedded the lists compressed as resources and then extract them in memory as streams and feed them to my customized SynEdit control. This controls is customized for MASM specifically and only MASM, like the MASM directives etc.

I was always fascinated with having a single EXE file. It's so simple. But, if you guys think I should put these resources as external resources, I can make that change.

Thanks you all for your feedback so far.
Title: Re: New Member
Post by: qWord on March 08, 2015, 06:49:32 AM
Quote from: jj2007 on March 08, 2015, 06:15:53 AMor something more serious?
hopefully not!
Title: Re: New Member
Post by: jj2007 on March 08, 2015, 07:17:54 AM
Quote from: ThomasJaeger on March 08, 2015, 06:27:32 AMThis is where you will see WriteProcessMemory listed.

No, this is where you see writeprocessmemory listed. I see WriteProcessMemory, and it's not in the resource section. Besides, it seems you are actually using it somewhere, albeit not successfully:
Quote from: vertograd on March 07, 2015, 05:50:16 AMTested it a little bit and often got Access violation writing process memory

And the only legit use of WriteProcessMemory is code injection in the context of a debugger.
Title: Re: New Member
Post by: ThomasJaeger on March 08, 2015, 08:41:53 AM
Ok, so I did some further investigation and I found WriteProcessMemory used in the skinning library. The component is installed in a different folder than my source so my initial grep did not see it. I see it being used twice in the sSkinManager.pas unit:

procedure acHookProc(Proc, Dest: Pointer; var BackupCode: TXRedirCode);
var
  n: ACUInt;
  Code: TXRedirCode;
begin
  Proc := acGetActualAddr(Proc);
  if Proc <> nil then
    if ReadProcessMemory(GetCurrentProcess, Proc, @BackupCode, SizeOf(BackupCode), n) then begin
      Code.Jump := $E9;
      Code.Offset := PAnsiChar(Dest) - PAnsiChar(Proc) - SizeOf(Code);
      WriteProcessMemory(GetCurrentProcess, Proc, @Code, SizeOf(Code), n);
    end;
end;


procedure acUnhookProc(Proc: Pointer; var BackupCode: TXRedirCode);
var
  n: ACUInt;
begin
  if (BackupCode.Jump <> 0) and (Proc <> nil) then begin
    Proc := acGetActualAddr(Proc);
    Assert(Proc <> nil);
    WriteProcessMemory(GetCurrentProcess, Proc, @BackupCode, SizeOf(BackupCode), n);
    BackupCode.Jump := 0;
  end;
end;

These functions are called by

procedure HookGetSysColor;
begin
  if not SysColorsHooked then
    acHookProc(@Windows.GetSysColor, @acGetSysColor, WinGetSysColor);

  SysColorsHooked := True;
end;

procedure HookGetSysColorBrush;
begin
  if not SysColorsHookedBrush then begin
    SysColorsHookedBrush := True;
    acHookProc(@Windows.GetSysColorBrush, @acGetSysColorBrush, WinGetSysColorBrush);
  end;
end;

and others. When you buy the skinning library, you get all the source code with it, too. So, I honestly think there is nothing to worry about. But, if you still think there is something fishy, please feel free to purchase the library and investigate the source code further.
Title: Re: New Member
Post by: jj2007 on March 08, 2015, 09:32:11 AM
Quote from: ThomasJaeger on March 08, 2015, 08:41:53 AM
Ok, so I did some further investigation and I found WriteProcessMemory used in the skinning library.

Any idea why vertograd saw access violations for such usage?
Title: Re: New Member
Post by: ThomasJaeger on March 08, 2015, 11:07:07 AM
Quote from: jj2007 on March 08, 2015, 09:32:11 AM
Quote from: ThomasJaeger on March 08, 2015, 08:41:53 AM
Ok, so I did some further investigation and I found WriteProcessMemory used in the skinning library.

Any idea why vertograd saw access violations for such usage?

Another user reported this error:
Access violation at adress 0072BCC4 in module 'VisualMasm.exe'. Read of  address 00000030.

Access violations are very common in Delphi when an object is being accessed that is nil, for example. This is most likely one of my internal objects such as objects from the Project Explorer (my guess, because the project explorer and the management of it was one of the most complicated things). I'm trying to find out why and what caused it. This should not happen and I must have missed a check on a particular object. It's embarrassing that this error even happens and I thought I tested well enough.

I will spend some time the next few days and use all feedback so far to fix issues and apply some improvements on what I have got so far on feedback.
Title: Re: New Member
Post by: GoneFishing on March 08, 2015, 08:37:00 PM
Quote from: jj2007 on March 08, 2015, 09:32:11 AM
Quote from: ThomasJaeger on March 08, 2015, 08:41:53 AM
Ok, so I did some further investigation and I found WriteProcessMemory used in the skinning library.

Any idea why vertograd saw access violations for such usage?
It turned out  those access violation message boxes don't contain "writing process memory" text . Sorry for misleading , but in that post I stated that I didn't remember the exact error message . In the attached archive you'll find 2 screenshots which illustrate "sticky tooltip" bug and that access violation message box (in fact I got it way too often on Windows XP SP3 ) .

P.S.: Maybe it will help: Note those "adresses" in "Read of  address 000000xx" string.
       I think  it's a character mistakenly  treated as an address
Title: Re: New Member
Post by: jj2007 on March 08, 2015, 10:12:01 PM
Quote from: vertograd on March 08, 2015, 08:37:00 PMMaybe it will help: Note those "adresses" in "Read of  address 000000xx" string.
       I think  it's a character mistakenly  treated as an address

It's a number actually: 30h = "0", 34h="4".
Title: Re: New Member
Post by: GoneFishing on March 08, 2015, 10:17:52 PM
I've seen many such errors and each of them with its unique "address" - and "4x" as well

Title: Re: New Member
Post by: dedndave on March 08, 2015, 11:50:56 PM
i had that problem when i first started programming with the win32 API

for a while, i thought "0xC0000005" was my name   :lol:

what helped me was to learn more about the Hungarian Notation convention

https://msdn.microsoft.com/en-us/library/aa260976%28v=vs.60%29.aspx (https://msdn.microsoft.com/en-us/library/aa260976%28v=vs.60%29.aspx)
http://en.wikipedia.org/wiki/Hungarian_notation (http://en.wikipedia.org/wiki/Hungarian_notation)

the errors usually happen when you pass a value as an argument, and the function wants a pointer to a value
there are even a few places where MSDN has an argument typed incorrectly, but that is rare