2016-01-01 19:51:53 +03:00
|
|
|
//CODED by Veliant, Leency, Nable, Pavelyakov. GNU GPL licence.
|
|
|
|
|
2015-07-22 21:32:54 +03:00
|
|
|
#ifndef INCLUDE_KOLIBRI_H
|
2015-07-20 02:09:56 +03:00
|
|
|
#define INCLUDE_KOLIBRI_H
|
2015-08-04 18:48:36 +03:00
|
|
|
|
|
|
|
#pragma option OST
|
|
|
|
#pragma option ON
|
|
|
|
#pragma option cri-
|
|
|
|
#pragma option -CPA
|
|
|
|
#initallvar 0
|
|
|
|
#jumptomain FALSE
|
2015-07-16 04:44:30 +03:00
|
|
|
|
2012-11-26 19:26:15 +04:00
|
|
|
#startaddress 0
|
2015-08-04 18:48:36 +03:00
|
|
|
|
2012-11-26 19:26:15 +04:00
|
|
|
#code32 TRUE
|
2015-08-04 18:48:36 +03:00
|
|
|
|
2020-05-25 18:20:10 +03:00
|
|
|
#ifndef ENTRY_POINT
|
|
|
|
#define ENTRY_POINT #______INIT______
|
|
|
|
#endif
|
|
|
|
|
2012-11-26 19:26:15 +04:00
|
|
|
char os_name[8] = {'M','E','N','U','E','T','0','1'};
|
|
|
|
dword os_version = 0x00000001;
|
2020-05-25 18:20:10 +03:00
|
|
|
dword start_addr = ENTRY_POINT;
|
2015-08-02 17:40:41 +03:00
|
|
|
dword final_addr = #______STOP______+32;
|
2013-03-11 22:16:24 +04:00
|
|
|
dword alloc_mem = MEMSIZE;
|
|
|
|
dword x86esp_reg = MEMSIZE;
|
2012-11-26 19:26:15 +04:00
|
|
|
dword I_Param = #param;
|
|
|
|
dword I_Path = #program_path;
|
|
|
|
char param[4096];
|
|
|
|
char program_path[4096];
|
|
|
|
|
2016-11-02 15:19:15 +03:00
|
|
|
#define bool int
|
2015-11-05 23:49:42 +03:00
|
|
|
|
2013-03-11 22:16:24 +04:00
|
|
|
#define NULL 0
|
|
|
|
#define OLD -1
|
|
|
|
#define true 1
|
|
|
|
#define false 0
|
|
|
|
|
2016-01-07 16:10:39 +03:00
|
|
|
//Process Events
|
2012-11-26 19:26:15 +04:00
|
|
|
#define evReDraw 1
|
2014-01-27 23:34:00 +04:00
|
|
|
#define evKey 2
|
|
|
|
#define evButton 3
|
2017-09-17 04:32:09 +03:00
|
|
|
#define evExit 4
|
2015-07-16 04:44:30 +03:00
|
|
|
#define evDesktop 5
|
2014-01-27 23:34:00 +04:00
|
|
|
#define evMouse 6
|
2015-07-16 04:44:30 +03:00
|
|
|
#define evIPC 7
|
2014-01-27 23:34:00 +04:00
|
|
|
#define evNetwork 8
|
2015-07-16 04:44:30 +03:00
|
|
|
#define evDebug 9
|
2012-11-26 19:26:15 +04:00
|
|
|
|
2017-09-17 04:32:09 +03:00
|
|
|
//Event mask bits for function 40
|
2017-09-28 12:59:41 +03:00
|
|
|
#define EVM_REDRAW 1b
|
|
|
|
#define EVM_KEY 10b
|
|
|
|
#define EVM_BUTTON 100b
|
|
|
|
#define EVM_EXIT 1000b
|
2019-01-03 20:57:09 +03:00
|
|
|
#define EVM_DESKTOPBG 10000b
|
2017-09-28 12:59:41 +03:00
|
|
|
#define EVM_MOUSE 100000b
|
|
|
|
#define EVM_IPC 1000000b
|
|
|
|
#define EVM_STACK 10000000b
|
|
|
|
#define EVM_DEBUG 100000000b
|
|
|
|
#define EVM_STACK2 1000000000b
|
2017-09-17 04:32:09 +03:00
|
|
|
#define EVM_MOUSE_FILTER 0x80000000
|
|
|
|
#define EVM_CURSOR_FILTER 0x40000000
|
|
|
|
|
2012-11-26 19:26:15 +04:00
|
|
|
//Button options
|
|
|
|
#define BT_DEL 0x80000000
|
|
|
|
#define BT_HIDE 0x40000000
|
|
|
|
#define BT_NOFRAME 0x20000000
|
|
|
|
|
2017-10-06 00:38:09 +03:00
|
|
|
#define CLOSE_BTN 1
|
|
|
|
|
2012-11-26 19:26:15 +04:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
|
2015-08-04 17:36:07 +03:00
|
|
|
#include "../lib/system.h"
|
|
|
|
#include "../lib/mouse.h"
|
2016-02-23 17:41:55 +03:00
|
|
|
#include "../lib/keyboard.h"
|
2015-07-23 14:54:26 +03:00
|
|
|
|
2016-11-23 23:47:33 +03:00
|
|
|
inline fastcall dword calc(EAX) { return EAX; }
|
2016-11-23 13:04:07 +03:00
|
|
|
|
2020-05-11 17:11:23 +03:00
|
|
|
|
2015-08-04 17:36:07 +03:00
|
|
|
:struct raw_image {
|
|
|
|
dword w, h, data;
|
2015-07-16 04:44:30 +03:00
|
|
|
};
|
|
|
|
|
2012-11-26 19:26:15 +04:00
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
inline fastcall dword WaitEvent()
|
|
|
|
{
|
|
|
|
$mov eax,10
|
|
|
|
$int 0x40
|
|
|
|
}
|
|
|
|
|
|
|
|
inline fastcall dword CheckEvent()
|
|
|
|
{
|
|
|
|
$mov eax,11
|
|
|
|
$int 0x40
|
|
|
|
}
|
|
|
|
|
2020-06-25 13:18:33 +03:00
|
|
|
inline dword WaitEventTimeout(dword time)
|
2012-11-26 19:26:15 +04:00
|
|
|
{
|
2018-08-11 23:02:54 +03:00
|
|
|
EAX = 23;
|
2020-06-25 13:18:33 +03:00
|
|
|
EBX = time;
|
2012-11-26 19:26:15 +04:00
|
|
|
$int 0x40
|
|
|
|
}
|
|
|
|
|
2017-09-17 04:32:09 +03:00
|
|
|
inline fastcall dword SetEventMask(EBX)
|
2012-11-26 19:26:15 +04:00
|
|
|
{
|
|
|
|
$mov eax,40
|
|
|
|
$int 0x40
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-07-16 04:44:30 +03:00
|
|
|
inline fastcall pause(EBX)
|
2012-11-26 19:26:15 +04:00
|
|
|
{
|
|
|
|
$mov eax, 5
|
|
|
|
$int 0x40
|
|
|
|
}
|
|
|
|
|
|
|
|
inline fastcall word GetButtonID()
|
|
|
|
{
|
|
|
|
$mov eax,17
|
|
|
|
$int 0x40
|
|
|
|
$shr eax,8
|
|
|
|
}
|
|
|
|
|
|
|
|
inline fastcall dword GetFreeRAM()
|
|
|
|
{
|
|
|
|
$mov eax, 18
|
|
|
|
$mov ebx, 16
|
|
|
|
$int 0x40
|
2018-09-14 12:49:37 +03:00
|
|
|
//return eax = free RAM size in Kb
|
|
|
|
}
|
|
|
|
|
|
|
|
inline fastcall dword GetTotalRAM()
|
|
|
|
{
|
|
|
|
$mov eax, 18
|
|
|
|
$mov ebx, 17
|
|
|
|
$int 0x40
|
|
|
|
//return eax = total RAM size in Kb
|
2012-11-26 19:26:15 +04:00
|
|
|
}
|
|
|
|
|
2018-09-13 23:31:24 +03:00
|
|
|
inline fastcall int GetCpuIdleCount()
|
|
|
|
{
|
|
|
|
EAX = 18;
|
|
|
|
EBX = 4;
|
|
|
|
$int 0x40
|
|
|
|
}
|
|
|
|
|
|
|
|
inline fastcall int GetCpuFrequency()
|
|
|
|
{
|
|
|
|
EAX = 18;
|
|
|
|
EBX = 5;
|
|
|
|
$int 0x40
|
|
|
|
}
|
|
|
|
|
2016-12-08 20:20:55 +03:00
|
|
|
inline fastcall dword LoadDriver(ECX) //ECX - èìÿ äðàéâåðà
|
2012-11-26 19:26:15 +04:00
|
|
|
{
|
|
|
|
$mov eax, 68
|
|
|
|
$mov ebx, 16
|
|
|
|
$int 0x40
|
2016-12-08 20:20:55 +03:00
|
|
|
//return 0 - íåóäà÷à, èíà÷å eax = õýíäë äðàéâåðà
|
2012-11-26 19:26:15 +04:00
|
|
|
}
|
|
|
|
|
2016-12-08 20:20:55 +03:00
|
|
|
inline fastcall dword RuleDriver(ECX) //óêàçàòåëü íà óïðàâëÿþùóþ ñòðóêòóðó
|
2012-11-26 19:26:15 +04:00
|
|
|
{
|
|
|
|
$mov eax, 68
|
|
|
|
$mov ebx, 17
|
|
|
|
$int 0x40
|
2016-12-08 20:20:55 +03:00
|
|
|
//return eax = îïðåäåëÿåòñÿ äðàéâåðîì
|
2012-11-26 19:26:15 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
struct proc_info
|
|
|
|
{
|
|
|
|
#define SelfInfo -1
|
|
|
|
dword use_cpu;
|
2018-05-02 19:32:29 +03:00
|
|
|
word pos_in_stack,slot,rezerv1;
|
2013-10-30 05:12:01 +04:00
|
|
|
unsigned char name[11];
|
2012-11-26 19:26:15 +04:00
|
|
|
char rezerv2;
|
|
|
|
dword adress,use_memory,ID,left,top,width,height;
|
|
|
|
word status_slot,rezerv3;
|
2020-05-30 14:36:52 +03:00
|
|
|
dword cleft,ctop,cwidth,cheight;
|
2012-11-26 19:26:15 +04:00
|
|
|
char status_window;
|
2012-12-15 04:16:06 +04:00
|
|
|
byte reserved[1024-71-8];
|
2012-11-26 19:26:15 +04:00
|
|
|
};
|
|
|
|
|
2018-04-11 20:46:08 +03:00
|
|
|
:void GetProcessInfo(dword _process_struct_pointer, _process_id)
|
2012-11-26 19:26:15 +04:00
|
|
|
{
|
2018-04-11 20:46:08 +03:00
|
|
|
EAX = 9;
|
|
|
|
EBX = _process_struct_pointer;
|
|
|
|
ECX = _process_id;
|
2012-11-26 19:26:15 +04:00
|
|
|
$int 0x40
|
|
|
|
}
|
|
|
|
|
|
|
|
inline fastcall int GetPointOwner( EBX, ECX) //ebx=m.x, ecx=m.y
|
|
|
|
{
|
|
|
|
$mov eax,34
|
|
|
|
$int 0x40
|
|
|
|
}
|
|
|
|
|
|
|
|
inline fastcall int GetProcessSlot( ECX)
|
|
|
|
{
|
|
|
|
EAX = 18;
|
|
|
|
EBX = 21;
|
|
|
|
$int 0x40
|
|
|
|
}
|
|
|
|
|
|
|
|
inline fastcall int GetActiveProcess()
|
|
|
|
{
|
|
|
|
EAX = 18;
|
|
|
|
EBX = 7;
|
|
|
|
$int 0x40
|
|
|
|
}
|
|
|
|
|
2013-10-24 22:26:04 +04:00
|
|
|
:int CheckActiveProcess(int Form_ID)
|
|
|
|
{
|
2013-11-05 03:27:39 +04:00
|
|
|
int id9=GetProcessSlot(Form_ID);
|
|
|
|
if (id9==GetActiveProcess()) return 1;
|
2013-10-24 22:26:04 +04:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-05-02 19:32:29 +03:00
|
|
|
inline fastcall void ActivateWindow( ECX) //ECX - slot
|
2012-12-15 19:56:24 +04:00
|
|
|
{
|
|
|
|
EAX = 18;
|
|
|
|
EBX = 3;
|
|
|
|
$int 0x40
|
|
|
|
}
|
|
|
|
|
2018-04-22 16:33:01 +03:00
|
|
|
:void RefreshWindow(dword ID_REFRESH,ID_ACTIVE)
|
|
|
|
{
|
|
|
|
ActivateWindow(ID_REFRESH);
|
|
|
|
ActivateWindow(ID_ACTIVE);
|
|
|
|
}
|
|
|
|
|
2015-02-18 22:52:40 +03:00
|
|
|
inline fastcall int MinimizeWindow()
|
|
|
|
{
|
|
|
|
EAX = 18;
|
|
|
|
EBX = 10;
|
|
|
|
$int 0x40
|
|
|
|
}
|
|
|
|
|
2015-07-16 04:44:30 +03:00
|
|
|
inline fastcall int CreateThread(ECX,EDX)
|
2012-11-26 19:26:15 +04:00
|
|
|
{
|
|
|
|
$mov eax,51
|
|
|
|
$mov ebx,1
|
|
|
|
$int 0x40
|
|
|
|
}
|
|
|
|
|
|
|
|
inline fastcall void SwitchToAnotherThread()
|
|
|
|
{
|
|
|
|
$mov eax,68
|
|
|
|
$mov ebx,1
|
|
|
|
$int 0x40
|
|
|
|
}
|
|
|
|
|
2013-04-08 17:21:32 +04:00
|
|
|
inline fastcall int SendWindowMessage( ECX, EDX)
|
2013-04-04 21:07:38 +04:00
|
|
|
{
|
|
|
|
$mov eax, 72
|
|
|
|
$mov ebx, 1
|
|
|
|
$int 0x40
|
|
|
|
}
|
|
|
|
|
2012-11-26 19:26:15 +04:00
|
|
|
inline fastcall int KillProcess( ECX)
|
|
|
|
{
|
|
|
|
$mov eax,18;
|
|
|
|
$mov ebx,18;
|
|
|
|
$int 0x40
|
|
|
|
}
|
|
|
|
|
|
|
|
#define TURN_OFF 2
|
|
|
|
#define REBOOT 3
|
|
|
|
#define KERNEL 4
|
|
|
|
inline fastcall int ExitSystem( ECX)
|
|
|
|
{
|
|
|
|
$mov eax, 18
|
|
|
|
$mov ebx, 9
|
|
|
|
$int 0x40
|
|
|
|
}
|
|
|
|
|
|
|
|
inline fastcall ExitProcess()
|
|
|
|
{
|
|
|
|
$mov eax,-1;
|
|
|
|
$int 0x40
|
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
|
2016-12-08 20:20:55 +03:00
|
|
|
//eax = ÿçûê ñèñòåìû (1=eng, 2=fi, 3=ger, 4=rus)
|
2019-03-10 15:09:50 +03:00
|
|
|
///SYSFUNC DOESN'T WORK!!! => https://bit.ly/2XNdiTD
|
2016-11-03 15:41:15 +03:00
|
|
|
#define SYS_LANG_ENG 1
|
|
|
|
#define SYS_LANG_FIN 2
|
|
|
|
#define SYS_LANG_GER 3
|
|
|
|
#define SYS_LANG_RUS 4
|
2012-11-26 19:26:15 +04:00
|
|
|
inline fastcall int GetSystemLanguage()
|
|
|
|
{
|
|
|
|
EAX = 26;
|
|
|
|
EBX = 5;
|
|
|
|
$int 0x40
|
|
|
|
}
|
|
|
|
|
2018-04-17 20:43:32 +03:00
|
|
|
#define BUTTON_STYLE_FLAT 0
|
|
|
|
#define BUTTON_STYLE_GRADIENT 1
|
|
|
|
inline fastcall SetButtonStyle(ECX) //ECX - button style
|
|
|
|
{
|
|
|
|
$mov eax,48
|
|
|
|
$mov ebx,1
|
|
|
|
int 64
|
|
|
|
}
|
|
|
|
|
2012-11-26 19:26:15 +04:00
|
|
|
inline fastcall GetSkinHeight()
|
|
|
|
{
|
|
|
|
$push ebx
|
|
|
|
$mov eax,48
|
|
|
|
$mov ebx,4
|
|
|
|
$int 0x40
|
|
|
|
$pop ebx
|
|
|
|
}
|
|
|
|
|
|
|
|
inline fastcall void SetSystemSkin( ECX)
|
|
|
|
{
|
|
|
|
EAX = 48;
|
|
|
|
EBX = 8;
|
|
|
|
$int 0x40
|
|
|
|
}
|
|
|
|
|
|
|
|
inline fastcall int GetScreenWidth()
|
|
|
|
{
|
|
|
|
$mov eax, 14
|
|
|
|
$int 0x40
|
|
|
|
$shr eax, 16
|
|
|
|
}
|
|
|
|
|
|
|
|
inline fastcall int GetScreenHeight()
|
|
|
|
{
|
|
|
|
$mov eax, 14
|
|
|
|
$int 0x40
|
|
|
|
$and eax,0x0000FFFF
|
|
|
|
}
|
|
|
|
|
2015-02-18 22:52:40 +03:00
|
|
|
inline fastcall int GetClientTop()
|
|
|
|
{
|
|
|
|
$mov eax, 48
|
|
|
|
$mov ebx, 5
|
|
|
|
$int 0x40
|
2016-01-15 02:05:51 +03:00
|
|
|
$mov eax, ebx
|
|
|
|
$shr eax, 16
|
2015-02-18 22:52:40 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
inline fastcall int GetClientHeight()
|
|
|
|
{
|
|
|
|
$mov eax, 48
|
|
|
|
$mov ebx, 5
|
|
|
|
$int 0x40
|
2016-01-15 02:05:51 +03:00
|
|
|
$mov eax, ebx
|
2015-02-18 22:52:40 +03:00
|
|
|
}
|
|
|
|
|
2012-11-26 19:26:15 +04:00
|
|
|
inline fastcall dword LoadLibrary( ECX)
|
|
|
|
{
|
|
|
|
$mov eax, 68
|
|
|
|
$mov ebx, 19
|
|
|
|
$int 0x40
|
|
|
|
}
|
|
|
|
|
|
|
|
inline fastcall int TestBit( EAX, CL)
|
|
|
|
{
|
|
|
|
$shr eax,cl
|
|
|
|
$and eax,1
|
|
|
|
}
|
|
|
|
|
2018-02-21 02:23:57 +03:00
|
|
|
:void SetClientScreenArea(dword _left, _right, _top, _bottom)
|
|
|
|
{
|
|
|
|
EAX = 48;
|
|
|
|
EBX = 6;
|
|
|
|
ECX = _left * 65536 + _right;
|
|
|
|
EDX = _top * 65536 + _bottom;
|
|
|
|
$int 64;
|
|
|
|
}
|
|
|
|
|
2012-11-26 19:26:15 +04:00
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
|
2016-11-23 14:37:13 +03:00
|
|
|
:void DefineAndDrawWindow(dword _x, _y, _w, _h, _window_type, _bgcolor, _title, _flags)
|
2012-11-26 19:26:15 +04:00
|
|
|
{
|
|
|
|
EAX = 12; // function 12:tell os about windowdraw
|
|
|
|
EBX = 1;
|
|
|
|
$int 0x40
|
|
|
|
|
2015-07-16 04:44:30 +03:00
|
|
|
$xor EAX,EAX
|
2016-11-23 14:37:13 +03:00
|
|
|
EBX = _x << 16 + _w;
|
|
|
|
ECX = _y << 16 + _h;
|
|
|
|
EDX = _window_type << 24 | _bgcolor;
|
|
|
|
EDI = _title;
|
|
|
|
ESI = _flags;
|
2012-11-26 19:26:15 +04:00
|
|
|
$int 0x40
|
|
|
|
|
2016-11-23 13:04:07 +03:00
|
|
|
|
2012-11-26 19:26:15 +04:00
|
|
|
EAX = 12; // function 12:tell os about windowdraw
|
|
|
|
EBX = 2;
|
|
|
|
$int 0x40
|
|
|
|
}
|
|
|
|
|
|
|
|
inline fastcall MoveSize( EBX,ECX,EDX,ESI)
|
|
|
|
{
|
|
|
|
$mov eax, 67
|
|
|
|
$int 0x40
|
|
|
|
}
|
|
|
|
|
|
|
|
inline fastcall void DrawTitle( ECX)
|
|
|
|
{
|
|
|
|
EAX = 71;
|
|
|
|
EBX = 1;
|
|
|
|
$int 0x40;
|
|
|
|
}
|
|
|
|
|
2016-12-12 01:58:11 +03:00
|
|
|
// @EDX is a process id, -1 for self
|
2016-12-08 20:20:55 +03:00
|
|
|
// @ESI is a new LayerBehaviour
|
|
|
|
// @RETURN: EAX, 0 is fail, 1 is success
|
2016-12-12 01:58:11 +03:00
|
|
|
#define ZPOS_DESKTOP -2
|
|
|
|
#define ZPOS_ALWAYS_BACK -1
|
|
|
|
#define ZPOS_NORMAL 0
|
|
|
|
#define ZPOS_ALWAYS_TOP 1
|
2016-12-08 20:20:55 +03:00
|
|
|
inline fastcall dword SetWindowLayerBehaviour(EDX, ESI)
|
|
|
|
{
|
|
|
|
EAX = 18;
|
|
|
|
EBX = 25;
|
|
|
|
ECX = 2;
|
|
|
|
$int 64
|
|
|
|
}
|
|
|
|
|
2016-11-21 23:25:00 +03:00
|
|
|
:void WriteTextB(dword x,y,byte fontType, dword color, str_offset)
|
2012-12-15 04:16:06 +04:00
|
|
|
{
|
|
|
|
EAX = 4;
|
|
|
|
EBX = x<<16+y;
|
|
|
|
ECX = fontType<<24+color;
|
2016-11-21 23:25:00 +03:00
|
|
|
EDX = str_offset;
|
2013-03-11 22:16:24 +04:00
|
|
|
ESI = 0;
|
2012-12-15 04:16:06 +04:00
|
|
|
$int 0x40;
|
|
|
|
$add ebx, 1<<16
|
|
|
|
$int 0x40
|
|
|
|
}
|
|
|
|
|
2016-11-21 23:25:00 +03:00
|
|
|
:void WriteText(dword x,y,byte fontType, dword color, str_offset)
|
2012-11-26 19:26:15 +04:00
|
|
|
{
|
|
|
|
EAX = 4;
|
|
|
|
EBX = x<<16+y;
|
|
|
|
ECX = fontType<<24+color;
|
2016-11-21 23:25:00 +03:00
|
|
|
EDX = str_offset;
|
2012-11-26 19:26:15 +04:00
|
|
|
$int 0x40;
|
|
|
|
}
|
|
|
|
|
2016-11-23 13:04:07 +03:00
|
|
|
:dword WriteBufText(dword x,y,byte fontType, dword color, str_offset, buf_offset)
|
2013-04-12 04:15:39 +04:00
|
|
|
{
|
2016-11-23 13:04:07 +03:00
|
|
|
EDI = buf_offset;
|
2018-09-16 12:42:32 +03:00
|
|
|
WriteText(x,y, fontType, color, str_offset);
|
|
|
|
}
|
|
|
|
|
|
|
|
:void WriteTextWithBg(dword x,y,byte fontType, dword color, str_offset, bgcolor)
|
|
|
|
{
|
|
|
|
EDI = bgcolor;
|
|
|
|
WriteText(x,y, fontType, color, str_offset);
|
2013-04-12 04:15:39 +04:00
|
|
|
}
|
|
|
|
|
2016-11-23 13:04:07 +03:00
|
|
|
:void WriteNumber(dword x,y,byte fontType, dword color, count, number_or_offset)
|
2012-11-26 19:26:15 +04:00
|
|
|
{
|
|
|
|
EAX = 47;
|
|
|
|
EBX = count<<16;
|
2016-11-21 23:25:00 +03:00
|
|
|
ECX = number_or_offset;
|
2012-11-26 19:26:15 +04:00
|
|
|
EDX = x<<16+y;
|
|
|
|
ESI = fontType<<24+color;
|
|
|
|
$int 0x40;
|
|
|
|
}
|
|
|
|
|
2016-11-21 23:25:00 +03:00
|
|
|
:void CopyScreen(dword dst_offset, x, y, w, h)
|
2012-11-26 19:26:15 +04:00
|
|
|
{
|
|
|
|
EAX = 36;
|
2016-11-21 23:25:00 +03:00
|
|
|
EBX = dst_offset;
|
2013-03-11 22:16:24 +04:00
|
|
|
ECX = w << 16 + h;
|
2012-11-26 19:26:15 +04:00
|
|
|
EDX = x << 16 + y;
|
|
|
|
$int 0x40;
|
|
|
|
}
|
|
|
|
|
2016-12-08 20:20:55 +03:00
|
|
|
:dword GetPixelColorFromScreen(dword _x, _y)
|
2012-11-26 19:26:15 +04:00
|
|
|
{
|
2016-12-08 20:20:55 +03:00
|
|
|
EAX = 35;
|
|
|
|
EBX = _y * screen.width + _x;
|
|
|
|
$int 64
|
2012-11-26 19:26:15 +04:00
|
|
|
}
|
|
|
|
|
2017-10-12 02:19:28 +03:00
|
|
|
#define DRAW_DESKTOP_BG_TILE 1
|
|
|
|
#define DRAW_DESKTOP_BG_STRETCH 2
|
2018-02-16 18:53:51 +03:00
|
|
|
:void SetBackgroundImage(dword w,h, image, mode)
|
2017-10-12 02:19:28 +03:00
|
|
|
{
|
|
|
|
$mov eax,15 // SF_BACKGROUND_SET 15 - work with desktop background graphics
|
|
|
|
$mov ebx,4 // SSF_MODE_BG 4 - set drawing mode for the background
|
|
|
|
$mov ecx,mode // drawing mode - tile (1), stretch (2)
|
|
|
|
$int 64
|
|
|
|
|
|
|
|
$mov eax,15 // SF_BACKGROUND_SET 15 - work with desktop background graphics
|
|
|
|
$mov ebx,1 // SSF_SIZE_BG=1 - set a size of the background image
|
|
|
|
$mov ecx,w // width
|
|
|
|
$mov edx,h // height
|
|
|
|
$int 64
|
|
|
|
|
|
|
|
$mov eax,15 // SF_BACKGROUND_SET 15 - work with desktop background graphics
|
|
|
|
$mov ebx,5 // SSF_IMAGE_BG=5 - put block of pixels on the background image
|
|
|
|
$mov ecx,image // pointer to the data in the format BBGGRRBBGGRR...
|
|
|
|
$mov edx,0 // offset in data of the background image
|
|
|
|
ESI = 3*w*h; // size of data in bytes = 3 * number of pixels
|
|
|
|
$int 64
|
|
|
|
|
|
|
|
$mov eax,15 // SF_BACKGROUND_SET 15 - work with desktop background graphics
|
|
|
|
$mov ebx,3 // SSF_REDRAW_BG=3 - redraw background
|
|
|
|
$int 64
|
|
|
|
}
|
|
|
|
|
2016-11-21 23:25:00 +03:00
|
|
|
:void _PutImage(dword x,y, w,h, data_offset)
|
2012-11-26 19:26:15 +04:00
|
|
|
{
|
|
|
|
EAX = 7;
|
2016-11-21 23:25:00 +03:00
|
|
|
EBX = data_offset;
|
2012-11-26 19:26:15 +04:00
|
|
|
ECX = w<<16+h;
|
|
|
|
EDX = x<<16+y;
|
|
|
|
$int 0x40
|
|
|
|
}
|
|
|
|
|
2018-02-18 18:32:11 +03:00
|
|
|
:void PutPaletteImage(dword inbuf,w,h,x,y,bits,pal)
|
2012-11-26 19:26:15 +04:00
|
|
|
{
|
2020-04-18 02:52:24 +03:00
|
|
|
if (h<1) || (w<0) return;
|
2012-11-26 19:26:15 +04:00
|
|
|
EAX = 65;
|
2018-02-18 18:32:11 +03:00
|
|
|
EBX = inbuf;
|
2012-11-26 19:26:15 +04:00
|
|
|
ECX = w<<16+h;
|
|
|
|
EDX = x<<16+y;
|
2018-02-18 18:32:11 +03:00
|
|
|
ESI = bits;
|
|
|
|
EDI = pal;
|
2012-11-26 19:26:15 +04:00
|
|
|
EBP = 0;
|
|
|
|
$int 0x40
|
2016-11-23 13:04:07 +03:00
|
|
|
}
|
2012-11-26 19:26:15 +04:00
|
|
|
|
|
|
|
inline fastcall void PutPixel( EBX,ECX,EDX)
|
|
|
|
{
|
|
|
|
EAX=1;
|
|
|
|
$int 0x40
|
|
|
|
}
|
|
|
|
|
2016-11-23 13:04:07 +03:00
|
|
|
:void DrawBar(dword x,y,w,h,color)
|
2012-11-26 19:26:15 +04:00
|
|
|
{
|
2013-02-04 17:15:13 +04:00
|
|
|
if (h<=0) || (h>60000) || (w<=0) || (w>60000) return; //bad boy :)
|
2012-11-26 19:26:15 +04:00
|
|
|
EAX = 13;
|
|
|
|
EBX = x<<16+w;
|
|
|
|
ECX = y<<16+h;
|
2016-11-23 13:04:07 +03:00
|
|
|
EDX = color;
|
2016-01-15 02:05:51 +03:00
|
|
|
$int 0x40
|
2012-11-26 19:26:15 +04:00
|
|
|
}
|
|
|
|
|
2018-03-22 17:36:04 +03:00
|
|
|
:void DefineButton(dword x,y,w,h,id,color)
|
2012-11-26 19:26:15 +04:00
|
|
|
{
|
2012-12-15 04:16:06 +04:00
|
|
|
EAX = 8;
|
2018-03-22 17:36:04 +03:00
|
|
|
EDX = id + BT_DEL;
|
2012-12-15 04:16:06 +04:00
|
|
|
$int 0x40;
|
2018-03-22 17:36:04 +03:00
|
|
|
EDX = id;
|
|
|
|
ESI = color;
|
2012-12-15 04:16:06 +04:00
|
|
|
EBX = x<<16+w;
|
|
|
|
ECX = y<<16+h;
|
|
|
|
$int 0x40
|
|
|
|
}
|
|
|
|
|
2016-11-23 13:04:07 +03:00
|
|
|
:void UnsafeDefineButton(dword x,y,w,h,id,color)
|
2012-12-15 04:16:06 +04:00
|
|
|
{
|
|
|
|
EAX = 8;
|
2012-11-26 19:26:15 +04:00
|
|
|
EBX = x<<16+w;
|
|
|
|
ECX = y<<16+h;
|
2016-11-23 13:04:07 +03:00
|
|
|
EDX = id;
|
|
|
|
ESI = color;
|
2012-11-26 19:26:15 +04:00
|
|
|
$int 0x40
|
|
|
|
}
|
|
|
|
|
2018-02-16 18:53:51 +03:00
|
|
|
:void DefineDragableWindow(dword _x, _y, _w, _h)
|
2016-12-08 20:20:55 +03:00
|
|
|
{
|
|
|
|
DefineAndDrawWindow(_x, _y, _w, _h, 0x41,0x000000,NULL,0b);
|
|
|
|
}
|
|
|
|
|
2018-02-21 02:23:57 +03:00
|
|
|
:void DefineUnDragableWindow(dword _x, _y, _w, _h)
|
|
|
|
{
|
|
|
|
DefineAndDrawWindow(_x, _y, _w, _h, 0x01, 0, 0, 0x01fffFFF);
|
|
|
|
}
|
|
|
|
|
2016-12-08 20:20:55 +03:00
|
|
|
:void EventDragWindow()
|
|
|
|
{
|
2018-10-01 19:41:14 +03:00
|
|
|
proc_info Form1;
|
2016-12-08 20:20:55 +03:00
|
|
|
dword tmp_x,tmp_y;
|
|
|
|
dword z1,z2;
|
|
|
|
tmp_x = mouse.x;
|
|
|
|
tmp_y = mouse.y;
|
|
|
|
do {
|
2018-10-01 19:41:14 +03:00
|
|
|
GetProcessInfo(#Form1, SelfInfo);
|
2016-12-08 20:20:55 +03:00
|
|
|
mouse.get();
|
|
|
|
if (tmp_x!=mouse.x) || (tmp_y!=mouse.y)
|
|
|
|
{
|
2018-10-01 19:41:14 +03:00
|
|
|
z1 = Form1.left + mouse.x - tmp_x;
|
|
|
|
z2 = Form1.top + mouse.y - tmp_y;
|
|
|
|
if(z1<=10) || (z1>20000) z1=0; else if(z1>screen.width-Form1.width-10)z1=screen.width-Form1.width;
|
|
|
|
if(z2<=10) || (z2>20000) z2=0; else if(z2>screen.height-Form1.height-10)z2=screen.height-Form1.height;
|
2016-12-08 20:20:55 +03:00
|
|
|
MoveSize(z1 , z2, OLD, OLD);
|
|
|
|
draw_window();
|
|
|
|
}
|
|
|
|
pause(1);
|
|
|
|
} while (mouse.lkm);
|
|
|
|
}
|
|
|
|
|
|
|
|
:void DefineHiddenButton(dword _x, _y, _w, _h, _id)
|
|
|
|
{
|
|
|
|
DefineButton(_x, _y, _w, _h, _id + BT_HIDE, 0);
|
|
|
|
}
|
|
|
|
|
2012-11-26 19:26:15 +04:00
|
|
|
inline fastcall void DeleteButton( EDX)
|
|
|
|
{
|
|
|
|
EAX = 8;
|
|
|
|
EDX += BT_DEL;
|
2015-07-30 17:54:30 +03:00
|
|
|
$int 0x40
|
2015-03-25 14:46:22 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
inline fastcall dword GetStartTime()
|
|
|
|
{
|
|
|
|
$mov eax,26
|
|
|
|
$mov ebx,9
|
|
|
|
$int 0x40
|
2015-07-12 02:45:19 +03:00
|
|
|
}
|
|
|
|
|
2015-07-23 14:54:26 +03:00
|
|
|
:dword X_EventRedrawWindow,Y_EventRedrawWindow;
|
|
|
|
:void _EventRedrawWindow()
|
|
|
|
{
|
2018-04-19 23:12:07 +03:00
|
|
|
DefineAndDrawWindow(X_EventRedrawWindow,Y_EventRedrawWindow,1,1,0x34,0xFFFFFF,NULL,0);
|
|
|
|
//pause(10);
|
|
|
|
ExitProcess();
|
2015-07-23 14:54:26 +03:00
|
|
|
}
|
2015-08-21 23:20:08 +03:00
|
|
|
:char REDRAW_BUFF_EVENT_[4096];
|
2015-07-23 14:54:26 +03:00
|
|
|
:void EventRedrawWindow(dword x,y)
|
|
|
|
{
|
|
|
|
X_EventRedrawWindow = x;
|
|
|
|
Y_EventRedrawWindow = y;
|
2015-08-21 23:20:08 +03:00
|
|
|
CreateThread(#_EventRedrawWindow,#REDRAW_BUFF_EVENT_+4092);
|
2015-07-23 14:54:26 +03:00
|
|
|
}
|
|
|
|
|
2015-07-20 02:09:56 +03:00
|
|
|
:struct _screen
|
|
|
|
{
|
|
|
|
dword width,height;
|
|
|
|
} screen;
|
|
|
|
|
2016-01-07 18:26:59 +03:00
|
|
|
:byte skin_height;
|
2015-07-20 02:09:56 +03:00
|
|
|
|
2020-04-11 14:00:31 +03:00
|
|
|
dword __generator; // random number generator init
|
2015-07-16 04:44:30 +03:00
|
|
|
|
2015-07-12 02:45:19 +03:00
|
|
|
//The initialization of the initial data before running
|
2020-05-25 18:20:10 +03:00
|
|
|
:void ______INIT______()
|
2015-07-12 02:45:19 +03:00
|
|
|
{
|
2020-05-25 17:20:17 +03:00
|
|
|
skin_height = @GetSkinHeight();
|
|
|
|
screen.width = @GetScreenWidth()+1;
|
|
|
|
screen.height = @GetScreenHeight()+1;
|
|
|
|
__generator = @GetStartTime();
|
2020-04-20 04:06:24 +03:00
|
|
|
mem_init();
|
2015-07-12 02:45:19 +03:00
|
|
|
main();
|
2015-07-22 21:32:54 +03:00
|
|
|
}
|
2015-08-02 17:40:41 +03:00
|
|
|
______STOP______:
|
2016-01-01 19:51:53 +03:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef INCLUDE_MEM_H
|
|
|
|
#include "../lib/mem.h"
|
|
|
|
#endif
|
2016-01-15 02:05:51 +03:00
|
|
|
|
|
|
|
#ifndef INCLUDE_DEBUG_H
|
|
|
|
#include "../lib/debug.h"
|
2020-04-11 14:00:31 +03:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef INCLUDE_IPC_H
|
|
|
|
#include "../lib/ipc.h"
|
2020-06-25 13:18:33 +03:00
|
|
|
#endif
|