Author Topic: Radasm3 Get filename  (Read 3533 times)


  • Member
  • ****
  • Posts: 609
Radasm3 Get filename
« on: January 20, 2019, 09:29:01 PM »

For my addin need i information about the project Main.rc,main.asm etc

But the AddinData struct is this both empty

Code: [Select]
invoke SendMessage,hWnd,AIM_GETDATA,NULL,NULL
mov esi,eax
invoke TextOutput, addr [esi].ADDINDATA.szMainRC
invoke TextOutput, addr [esi].ADDINDATA.szMain
invoke TextOutput, addr [esi].szMainAsm

radasm open a project in store it correctly to this structur

Code: [Select]

invoke GetTheFileType,addr pbi.szitem
.if eax==ID_EDITCODE
invoke strcpy,addr da.szMainAsm,addr buffer
.elseif eax==ID_EDITRES
invoke strcpy,addr da.szMainRC,addr buffer

if i debug Radasm da.szMainAsm,da.szMainRC is filled with the correct filenames.

Has any an idea how i can get it?


  • Member
  • ****
  • Posts: 564
    • Github
Re: Radasm3 Get filename
« Reply #1 on: January 21, 2019, 12:20:37 AM »
The FlipCase addin project has an example.
It gets the pointer to the addindata during the InstallDll proc:
Code: [Select]
    ;Get pointer to data struct
    invoke SendMessage,hWin,AIM_GETDATA,0,0
    mov        lpDStruct,eax
and during the DllProc it uses this info:
Code: [Select]
                        ;Change from .tmp to .asm
                        lea        edx,[buffer+eax-3]
                        mov        dword ptr [edx],'msa'
                        mov        eax,lpDStruct
                        mov        edx,[eax].ADDINDATA.lpFile
and has a commented section showing project opened:
Code: [Select]
;    .elseif eax==AIM_PROJECTOPENED
;        ;Always return false
;        ;hWin        handle of mdi frame
;        ;lParam        pointer to ProjectFile
;        ;Added by NEMO
;        mov        eax,[lpDStruct]
;        mov        edx,(ADDINDATA ptr [eax]).lpProject
;        push    ebx
;        mov        ebx,(ADDINDATA ptr [eax]).lpFile
;        invoke lstrcpy,ebx,edx
;        invoke lstrlen,ebx
;        mov        dword ptr [ebx+eax-4],4D53412Eh
;        invoke GetFileAttributes,ebx
;        pop ebx
;        .if eax!=-1
;            ;Open the file
;            push    TRUE
;            mov        eax,[lpPStruct]
;            mov        eax,(ADDINPROCS ptr [eax]).lpOpenProjectFile
;            call    eax
;        .endif
you might have to check the values in eax and ecx you are returning at end of InstallDll to check that the correct hooks are being used, so that the RadASM knows which stuff to handle.

ASUS Crosshair 8 Hero, AMD 5950X, 32GB, MSI 5700XT, NZXT Kraken Z73, Seasonic 1000W PSU

Github Twitter Mastodon Gitbook


  • Member
  • ****
  • Posts: 609
Re: Radasm3 Get filename
« Reply #2 on: January 21, 2019, 02:26:24 AM »

My problem is solved it works.
accidentally i used an older include and with a older structur. :icon_rolleyes: