Etichetă: asm snippet

Embedded File in Exe Asm

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

Un mic exemplu pentru a extrage o resursa inglobata intr-un exe , exemplul este simbolic nu poate fi compliat caci este o bucata dintr-un cod-sursa al unui executabil , dar poate va desluseste ce functii ati putea folosi pentru a face acest lucru exemplu mai jos :

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

De functile SetValue , Getwindowitem , SetText , si Sleep …