Recent Posts

Pages: [1] 2 3 ... 10
1
UASM Assembler Development / Re: UASM 2.46 Release
« Last post by johnsa on Today at 07:53:50 AM »
Hi,

I've just written the same code in C for comparison and run both. Your code works for me here and sets the desktop wallpaper.

The C-code looks as follows for a COM invocation:

Code: [Select]
pAD->SetWallpaper((PCWSTR)&DesktopImg, 0);
013D17E4 6A 00                push        0 
013D17E6 8D 45 C0             lea         eax,[DesktopImg] 
013D17E9 50                   push        eax 
013D17EA 8B 4D F4             mov         ecx,dword ptr [pAD] 
013D17ED 8B 11                mov         edx,dword ptr [ecx] 
013D17EF 8B 45 F4             mov         eax,dword ptr [pAD] 
013D17F2 50                   push        eax 
013D17F3 8B 4A 14             mov         ecx,dword ptr [edx+14h] 
013D17F6 FF D1                call        ecx 

and from uasm:

Code: [Select]
  _VCOMINVOKE    pAD,IActiveDesktop,SetWallpaper,ADDR DesktopImg,0
  ; pAD->SetWallpaper(OFFSET DesktopImg,0) identical code generated
01081031  mov         eax,dword ptr ds:[01083032h] 
01081036  mov         eax,dword ptr [eax] 
01081038  push        0 
0108103A  push        1083020h 
0108103F  push        dword ptr ds:[1083032h] 
01081045  call        dword ptr [eax+14h] 

As you can see in the C version, we have PUSH 0, PUSH ADDRESS OF ImageName, and most importantly.. the THIS ptr...
013D17EF 8B 45 F4             mov         eax,dword ptr [pAD] 
013D17F2 50                   push        eax

So we're doing it the same and both have identical results for me in C and ASM.

C code for reference:
Code: [Select]
// ConsoleApplication1.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"

int main()
{
IActiveDesktop *pAD = NULL;
WALLPAPEROPT wpo;

wchar_t DesktopImg[] = L"apicture.jpg";

CoInitializeEx(0,COINIT_APARTMENTTHREADED);
CoCreateInstance(CLSID_ActiveDesktop, NULL, CLSCTX_INPROC_SERVER, IID_IActiveDesktop, (void**)&pAD);

memset(&wpo, 0, sizeof(WALLPAPEROPT));
wpo.dwSize = sizeof(WALLPAPEROPT);
wpo.dwStyle = WPSTYLE_CENTER;

pAD->SetWallpaper((PCWSTR)&DesktopImg, 0);

pAD->Release();

CoUninitialize();

    return 0;
}
2
The Soap Box / Re: What happened this weekend
« Last post by GoneFishing on Today at 07:29:36 AM »
You're welcome!

HD with Windows 8.1 has died and I migrated to Linux  :biggrin:

In those times I played a lot with graphics. If you wish I can advice a lot of interesting ( and outdated stuff ) :
NVIDIA OpenGl and DirectX  SDKs: 9,10,11.
NVIDIA CgFx Viewer: http://www.nvidia.ru/object/IO_CgFXViewer.html
Cg, CgFx are also discontinued long ago projects
FxComposer + effects library 
MentalMill - visual environment for building shaders and export to various formats ( legacy tool )
AMD RenderMonkey

and lot more

3
The Soap Box / Re: What happened this weekend
« Last post by Siekmanski on Today at 07:01:19 AM »
@Siekmanski:
One time I was getting close to playing with shaders programmatically.

What made you stop at this close point?

Thanks for the links.

Had a look at the shaders part of the directx sdk. No examples without the bulky directx wrapper lib.
Maybe I can use the offline compiler FXC.exe to compile the shaders and include them as binary files.

I have the whole evening for myself and decided to explore the possibilities to use shaders without those bulky dll's
Of course it must be able to run in my d3d9 framework without the d3dx9 wrapper library, or else I quit...

There's a lot of mathematics involved in writing pixel shaders, or should I say it's only mathematics.
4
UASM Assembler Development / Re: UASM 2.46 Release
« Last post by Vortex on Today at 06:08:04 AM »
Hi johnsa,

Thanks for the update. Here are the results of my tests.

Trying the _VCOMINVOKE macro :

Code: [Select]
_VCOMINVOKE pAD,IActiveDesktop,SetWallpaper,ADDR DesktopImg,0
_VCOMINVOKE pAD,IActiveDesktop,SetWallpaperOptions,OFFSET wpo,0
_VCOMINVOKE pAD,IActiveDesktop,ApplyChanges,AD_APPLY_ALL
_VCOMINVOKE pAD,IActiveDesktop,Release

Uasm is assembling my code without any error messages but the executable is crashing on Windows 7.

Investigating the case with the /EP option :

Code: [Select]
uasm32.exe /EP /c /coff SetWallpaper.asm
Code: [Select]
mov eax, pAD
mov eax,[eax]
invoke(_IActiveDesktop_SetWallpaperPto PTR[eax].IActiveDesktop.SetWallpaper), pAD, ADDR DesktopImg,0
mov eax, pAD
mov eax,[eax]
invoke(_IActiveDesktop_SetWallpaperOptionsPto PTR[eax].IActiveDesktop.SetWallpaperOptions), pAD, OFFSET wpo,0
mov eax, pAD
mov eax,[eax]
invoke(_IActiveDesktop_ApplyChangesPto PTR[eax].IActiveDesktop.ApplyChanges), pAD, AD_APPLY_ALL
mov eax, pAD
mov eax,[eax]
invoke(_IActiveDesktop_ReleasePto PTR[eax].IActiveDesktop.Release), pAD

The pAD parameter should not be pushed to the stack.

Disassembling the object file with objconv :

Code: [Select]
_VCOMINVOKE    pAD,IActiveDesktop,SetWallpaper,ADDR DesktopImg,0
Code: [Select]
mov     eax, dword ptr [_pAD]                   
mov     eax, dword ptr [eax]                   
push    0                                       
push    offset _DesktopImg                     
push    dword ptr [_pAD] ; <--- This line causing problem
call    dword ptr [eax+14H]

Assuming that _VCOM is equivalent to _VCOMINVOKE :

Code: [Select]
_VCOMINVOKE MACRO pInterface : REQ, Interface : REQ, Function : REQ, args : VARARG
_VCOM MACRO pInterface : REQ, Interface : REQ, Function : REQ, args : VARARG

Replacing _VCOMINVOKE  with  _VCOM :

Code: [Select]
SetWallpaper.asm(41) : Error A2210: Syntax error: _VCOM
SetWallpaper.asm(43) : Error A2210: Syntax error: _VCOM
SetWallpaper.asm(45) : Error A2210: Syntax error: _VCOM
SetWallpaper.asm(47) : Error A2210: Syntax error: _VCOM
SetWallpaper.asm: 53 lines, 1 passes, 4 ms, 0 warnings, 4 errors

Testing the arrow operator with OPTION VTABLE:ON and OPTION VTABLE:OFF

Code: [Select]
pAD->SetWallpaper(OFFSET DesktopImg,0)
pAD->SetWallpaperOptions(OFFSET wpo,0)
pAD->ApplyChanges(AD_APPLY_ALL)
pAD->Release()

pAD is again pushed to the stack :

Code: [Select]
mov eax, pAD
mov eax,[eax]
invoke(_IActiveDesktop_SetWallpaperPto PTR[eax].IActiveDesktop.SetWallpaper), pAD, OFFSET DesktopImg,0
mov eax, pAD
mov eax,[eax]
invoke(_IActiveDesktop_SetWallpaperOptionsPto PTR[eax].IActiveDesktop.SetWallpaperOptions), pAD, OFFSET wpo,0
mov eax, pAD
mov eax,[eax]
invoke(_IActiveDesktop_ApplyChangesPto PTR[eax].IActiveDesktop.ApplyChanges), pAD, AD_APPLY_ALL
mov eax, pAD
mov eax,[eax]
invoke(_IActiveDesktop_ReleasePto PTR[eax].IActiveDesktop.Release), pAD
5
The Campus / Re: Bass.dll problem
« Last post by ragdog on Today at 05:25:04 AM »
I like it good sound and many function :t
6
MasmBasic & the RichMasm IDE / Re: GetFolders
« Last post by jj2007 on Today at 04:52:05 AM »
Congrats ;)
But there was a buffer overflow risk, and you helped me find it, thanks :icon14:
Btw it seems many people had problems with that folder, the web is full of desperate people trying to delete Windows.old :P
7
MasmBasic & the RichMasm IDE / Re: GetFolders
« Last post by clamicun on Today at 04:41:51 AM »
Thank you,
and btw.  I see Windows.old is removable with Disk Cleanup.
So the problem with GetFolders has vanished anyway.
8
MasmBasic & the RichMasm IDE / Re: GetFolders
« Last post by jj2007 on Today at 04:35:37 AM »
I have to admit, I never understood the file.asc business.

The source does not build because it requires a debug version of MasmBasic.lib
I have solved the issue, new lib attached (temporary, for testing), to build it you have to comment out the stk_?? bits.
9
MasmBasic & the RichMasm IDE / Re: GetFolders
« Last post by clamicun on Today at 04:00:55 AM »
include \masm32\MasmBasic\MasmBasic.inc   ; requires jjRecTest lib version!
;include Include\cmc_macros.inc
 Init
  Let esi="C:\"
  GetFolders esi
 ; show_value eax,"folders"
  deb 4, "files", eax
  Externdef   stk_in:DWORD
  Externdef   stk_out:DWORD
  Externdef   stk_flen:DWORD
  mov ecx, stk_in
  sub ecx, stk_out
  deb 4, "GetFiles", stk_in, stk_out, stk_flen, stk_flen[4], ecx
  usedeb=16
  deb 4, "GetFiles", stk_in, stk_out, stk_flen
  Inkey "ok?"
EndOfCode

OPT_Debug   1



I have to admit, I never understood the file.asc business.
This one in RichMasm.exe gives me:

POLINK: error: Unresolved external symbol '_stk_in'.
POLINK: error: Unresolved external symbol '_stk_out'.
POLINK: error: Unresolved external symbol '_stk_flen'.
POLINK: fatal error: 3 unresolved external(s).
*** Link error ***

10
The Orphanage / Re: Could have been worse
« Last post by felipe on Today at 03:59:43 AM »
That's true.  :icon_exclaim:

Other reason to hate those cellular phones!  :badgrin:
Pages: [1] 2 3 ... 10