Fix Faild to load SDCzip.dll

This article has been written before more than 24months, information might old.

Am scris un fix pentru erroarea ” Faild to load SDCzip.dll ” ce apare uneori la Stardock IconPackager , il putei downloada de aici : http://fix-faild-to-load-sdczip-stardock.googlecode.com/files/FixForStardock.exe , codul sursa il gasiti la adresa http://code.google.com/p/fix-faild-to-load-sdczip-stardock/downloads/list este compatibil cu EasyCoder Ide , nu este pure asm dar poate fi transformat , relativ usor insa codul ar fi mult mai amplu , mai jos este un preview al codului care nu poate fi compilabil , daca veti sa il compilati descarcati sursa ..

Ps : sper ca nu se simte nimeni ofensat de icontia natzi … , trebuie sa recunoasteti ca e un design destul de reusit ….

Code :

.Const

.Data?
;dll
hMIDIres DD ?  ;
hMIDISize DD ?   ;
hMIDIdevID DD ?  ;
numchar DD ?
;dll


;path
szfolder DB ?
szstardf DB ?
szdllfpath DB ?

;path

.Data

lsta DB " Geting the path to 0X0026commun files ... " , 0
lstb DB " Creating necessary directory ... " , 0
lstc DB " Writing registry  ... " , 0
lstd DB " Finding embeded resource ... " , 0
lste DB " Geting the size of embeded dll ... " , 0
lstf DB " Creating necessary dll file ... " , 0
lstg DB " Done !!! " , 0

tkey DB "SoftwareStardockObjectDesktop" , 0
tsubkey DB "SDCzip" , 0
szpcom DB "Common FilesStardock", 0
DllName DB "SDCzip.dll" , 0

.Code

wmainProcedure Proc Private hWnd:HWND, uMsg:ULONG, wParam:WPARAM, lParam:LPARAM
	.If uMsg == WM_CREATE

	.ElseIf uMsg == WM_CLOSE
		Invoke IsModal, hWnd
		.If Eax
			Invoke EndModal, hWnd, IDCANCEL
			Return TRUE
		.EndIf
	.ElseIf uMsg == WM_COMMAND
		Mov Eax, wParam
		.If Ax == IDC_WMAIN_BN
            Shr Eax, 16
.If Ax == BN_CLICKED
Invoke GetWindowItem, [hWnd], IDC_WMAIN_LSTA
Invoke SetText, Eax, Addr lsta
Invoke GetWindowItem, [hWnd], IDC_WMAIN_PGB
Invoke SetValue, Eax, 10
; Paths ...
Mov szfolder, NULL
Mov szstardf, NULL
Mov szdllfpath, NULL

;The not so full path
Invoke SHGetSpecialFolderPath, NULL, Addr szstardf, CSIDL_PROGRAM_FILES, TRUE
Invoke str_cat, Addr szstardf, Addr szpcom
;;The not so full path
Invoke GetWindowItem, [hWnd], IDC_WMAIN_LSTB
Invoke SetText, Eax, Addr lstb
Invoke GetWindowItem, [hWnd], IDC_WMAIN_PGB
Invoke SetValue, Eax, 25
Invoke Sleep, 2500
Invoke CreateDirectory, Addr szstardf, NULL
;Full path
Invoke SHGetSpecialFolderPath, NULL, Addr szdllfpath, CSIDL_PROGRAM_FILES, TRUE
Invoke str_cat, Addr szdllfpath, Addr szpcom
Invoke str_cat, Addr szdllfpath, Addr DllName
;Full path


Invoke GetWindowItem, [hWnd], IDC_WMAIN_LSTC
Invoke SetText, Eax, Addr lstc
Invoke GetWindowItem, [hWnd], IDC_WMAIN_PGB
Invoke SetValue, Eax, 40
Invoke Sleep, 2500
; Registry ...
Invoke SetRegString, HKEY_LOCAL_MACHINE, Addr tkey, Addr tsubkey, Addr szdllfpath
; File ...
Invoke GetWindowItem, [hWnd], IDC_WMAIN_LSTD
Invoke SetText, Eax, Addr lstd
Invoke GetWindowItem, [hWnd], IDC_WMAIN_PGB
Invoke SetValue, Eax, 55
Invoke Sleep, 2500
Invoke  FindResource, NULL, ZIPDLL, RT_FILEDATA
Mov hMIDIres, Eax ;
Invoke GetWindowItem, [hWnd], IDC_WMAIN_LSTE
Invoke SetText, Eax, Addr lste
Invoke GetWindowItem, [hWnd], IDC_WMAIN_PGB
Invoke SetValue, Eax, 70
Invoke Sleep, 2500
Invoke SizeofResource, NULL, hMIDIres ;
Mov hMIDISize, Eax ;
Invoke LoadResource, NULL, hMIDIres ;
Invoke LockResource, Eax
Mov hMIDIres, Eax
Invoke GetWindowItem, [hWnd], IDC_WMAIN_LSTF
Invoke SetText, Eax, Addr lstf
Invoke GetWindowItem, [hWnd], IDC_WMAIN_PGB
Invoke SetValue, Eax, 85
Invoke Sleep, 2500
Invoke CreateFile, Addr szdllfpath, GENERIC_WRITE, 0, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_ARCHIVE, 0
Mov Ebx, Eax
Invoke WriteFile, Ebx, hMIDIres, hMIDISize, Addr numchar, 0 ;
Invoke CloseHandle, Ebx
Invoke GetWindowItem, [hWnd], IDC_WMAIN_LSTG
Invoke SetText, Eax, Addr lstg
Invoke GetWindowItem, [hWnd], IDC_WMAIN_PGB
Invoke SetValue, Eax, 100

.EndIf ; BN_CLICKED

.EndIf ; Get command

	.EndIf ; Window
	Return FALSE
wmainProcedure EndP

str_cat Proc strBase:DWord, strAdd:DWord
			mov edi, strBase
			mov al, 0
			repne scasb
			dec edi
			mov esi, strAdd
			@@:
				mov al, [esi]
				mov [edi], al
				inc esi
				inc edi
				test al, al
				jnz @B
				ret
		str_cat endp


SetRegString Proc reg_HKEY:DWord, lpszKeyName:DWord, lpszValueName:DWord, lpszString:DWord
    local Disp: dword
    local pKey: dword
    local dwSize: dword
    invoke RegCreateKeyEx, reg_HKEY,
        lpszKeyName, NULL, NULL, 
        REG_OPTION_NON_VOLATILE, 
        KEY_ALL_ACCESS, NULL,
        addr pKey, addr Disp
    .if eax == ERROR_SUCCESS
        invoke lstrlen, lpszString
        mov dwSize, eax
        invoke RegSetValueEx, pKey, lpszValueName, 
            NULL, REG_SZ, 
            lpszString, dwSize 
        push eax
        invoke RegCloseKey, pKey
        pop eax
    .endif
    ret
SetRegString endp



wmainpgb Proc Private hWnd:HWND, uMsg:ULONG, wParam:WPARAM, lParam:LPARAM
	Return FALSE
wmainpgb EndP

wmainBN Proc Private hWnd:HWND, uMsg:ULONG, wParam:WPARAM, lParam:LPARAM
	Return FALSE
wmainBN EndP

wmains1 Proc Private hWnd:HWND, uMsg:ULONG, wParam:WPARAM, lParam:LPARAM
	Return FALSE
wmains1 EndP

;wmainHeader1 Proc Private hWnd:HWND, uMsg:ULONG, wParam:WPARAM, lParam:LPARAM
;	Return FALSE
;wmainHeader1 EndP

wmainlsta Proc Private hWnd:HWND, uMsg:ULONG, wParam:WPARAM, lParam:LPARAM
	Return FALSE
wmainlsta EndP

wmainlstb Proc Private hWnd:HWND, uMsg:ULONG, wParam:WPARAM, lParam:LPARAM
	Return FALSE
wmainlstb EndP

wmainlstc Proc Private hWnd:HWND, uMsg:ULONG, wParam:WPARAM, lParam:LPARAM
	Return FALSE
wmainlstc EndP

wmainlstd Proc Private hWnd:HWND, uMsg:ULONG, wParam:WPARAM, lParam:LPARAM
	Return FALSE
wmainlstd EndP

wmainlste Proc Private hWnd:HWND, uMsg:ULONG, wParam:WPARAM, lParam:LPARAM
	Return FALSE
wmainlste EndP

wmainlstf Proc Private hWnd:HWND, uMsg:ULONG, wParam:WPARAM, lParam:LPARAM
	Return FALSE
wmainlstf EndP

wmainlstg Proc Private hWnd:HWND, uMsg:ULONG, wParam:WPARAM, lParam:LPARAM
	Return FALSE
wmainlstg EndP

Share the joy

Leave a Reply