flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > bug in FASMW1.73.32

Author
Thread Post new topic Reply to topic
ProMiNick



Joined: 24 Mar 2012
Posts: 799
Location: Russian Federation, Sochi
ProMiNick 21 Sep 2024, 00:49
in proc CompilerSetup app not crashed only due to stack restoring in macro ret of macro proc
Code:
invoke  SetDlgItemInt,[hwnd_dlg],ID_PASSES,eax       ;- has incorrect number of arguments,can be reason of stack crashes in future
invoke  SetDlgItemInt,[hwnd_dlg],ID_PASSES,eax,FALSE ;+ must be    

_________________
I don`t like to refer by "you" to one person.
My soul requires acronim "thou" instead.
Post 21 Sep 2024, 00:49
View user's profile Send private message Send e-mail Reply with quote
macomics



Joined: 26 Jan 2021
Posts: 957
Location: Russia
macomics 21 Sep 2024, 02:35
I don't have the number of passes parameter in these settings in FASMW

This is most likely a typo in your code modification.

Original:
Code:
proc CompilerSetup hwnd_dlg,msg,wparam,lparam
        push    ebx esi edi
        cmp     [msg],WM_INITDIALOG
        je      .initdialog
        cmp     [msg],WM_COMMAND
        je      .command
        cmp     [msg],WM_CLOSE
        je      .close
  .notprocessed:
        xor     eax,eax
        jmp     .finish
  .initdialog:
        mov     [string_buffer],0
        invoke  GetEnvironmentVariable,_key_environment_include,string_buffer,1000h
        invoke  GetPrivateProfileString,_section_environment,_key_environment_include,string_buffer,path_buffer,4000h,ini_path
        invoke  SetDlgItemText,[hwnd_dlg],ID_INCLUDEPATH,path_buffer
        invoke  GetDlgItem,[hwnd_dlg],ID_MEMORY
        stdcall AddStrings,eax,_memory_settings
        invoke  GetDlgItem,[hwnd_dlg],ID_PRIORITY
        stdcall AddStrings,eax,_priority_settings
        cinvoke wsprintf,string_buffer,_value,[compiler_memory]
        invoke  SendDlgItemMessage,[hwnd_dlg],ID_MEMORY,CB_FINDSTRINGEXACT,-1,string_buffer
        cmp     eax,CB_ERR
        je      .set_memory
        invoke  SendDlgItemMessage,[hwnd_dlg],ID_MEMORY,CB_SETCURSEL,eax,0
        jmp     .memory_ok
  .set_memory:
        invoke  SetDlgItemText,[hwnd_dlg],ID_MEMORY,string_buffer
  .memory_ok:
        mov     eax,[compiler_priority]
        cmp     eax,2
        jg      .realtime
        cmp     eax,-2
        jl      .idle
        jmp     .priority_ok
  .idle:
        mov     eax,-4
        jmp     .priority_ok
  .realtime:
        mov     eax,4
  .priority_ok:
        sar     eax,1
        add     eax,2
        invoke  SendDlgItemMessage,[hwnd_dlg],ID_PRIORITY,CB_SETCURSEL,eax,0
        jmp     .processed
  .command:
        cmp     [wparam],IDCANCEL
        je      .close
        cmp     [wparam],IDOK
        jne     .finish
        invoke  GetDlgItemInt,[hwnd_dlg],ID_MEMORY,param_buffer,FALSE
        mov     [compiler_memory],eax
        invoke  SendDlgItemMessage,[hwnd_dlg],ID_PRIORITY,CB_GETCURSEL,0,0
        sub     eax,2
        sal     eax,1
        cmp     eax,4
        je      .set_realtime
        cmp     eax,-4
        je      .set_idle
        jmp     .set_priority
  .set_idle:
        mov     eax,-15
        jmp     .set_priority
  .set_realtime:
        mov     eax,15
  .set_priority:
        mov     [compiler_priority],eax
        invoke  GetDlgItemText,[hwnd_dlg],ID_INCLUDEPATH,path_buffer,4000h
        invoke  WritePrivateProfileString,_section_environment,_key_environment_include,path_buffer,ini_path
        invoke  EndDialog,[hwnd_dlg],TRUE
        jmp     .finish
  .close:
        invoke  EndDialog,[hwnd_dlg],FALSE
  .processed:
        mov     eax,1
  .finish:
        pop     edi esi ebx
        ret
endp    


Description:
Filesize: 9.27 KB
Viewed: 330 Time(s)

Screenshot_20240921_063245.png


Post 21 Sep 2024, 02:35
View user's profile Send private message Reply with quote
macomics



Joined: 26 Jan 2021
Posts: 957
Location: Russia
macomics 21 Sep 2024, 02:44
Downloaded it again from the website. There the setting was added. But I definitely had FASMW 1.73.32 when I was patching the debugger for it.
Post 21 Sep 2024, 02:44
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20343
Location: In your JS exploiting you and your system
revolution 21 Sep 2024, 03:06
It is at line 3000 in FASMW.ASM.
Post 21 Sep 2024, 03:06
View user's profile Send private message Visit poster's website Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 4043
Location: vpcmpistri
bitRAKE 21 Sep 2024, 04:02
This omission of the last parameter has followed through to fasmgw.asm.

_________________
¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup
Post 21 Sep 2024, 04:02
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.