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