2008-11-03 14:17:14 +01:00
|
|
|
|
//CODED by Veliant, Leency. GNU GPL licence.
|
|
|
|
|
|
|
|
|
|
#startaddress 0
|
|
|
|
|
#code32 TRUE
|
|
|
|
|
|
|
|
|
|
char os_name[8] = {'M','E','N','U','E','T','0','1'};
|
|
|
|
|
dword os_version = 0x00000001;
|
|
|
|
|
dword start_addr = #main;
|
|
|
|
|
dword final_addr = #stop+32;
|
|
|
|
|
dword alloc_mem = 0x00100000;
|
|
|
|
|
dword x86esp_reg = 0x00100000; // 0x0007fff0;
|
|
|
|
|
dword I_Param = #param;
|
|
|
|
|
dword I_Icon = 0x0;
|
2008-11-24 01:49:58 +01:00
|
|
|
|
dword skin_width;
|
2008-11-03 14:17:14 +01:00
|
|
|
|
char param[256]="";
|
|
|
|
|
|
|
|
|
|
//Events
|
2008-11-24 01:49:58 +01:00
|
|
|
|
#define evMouse 6
|
2008-11-03 14:17:14 +01:00
|
|
|
|
#define evButton 3
|
|
|
|
|
#define evKey 2
|
|
|
|
|
#define evReDraw 1
|
|
|
|
|
#define evNet 8
|
|
|
|
|
|
|
|
|
|
//Button options
|
|
|
|
|
#define BT_DEL 0x80000000
|
|
|
|
|
#define BT_HIDE 0x40000000
|
|
|
|
|
#define BT_NOFRAME 0x20000000
|
|
|
|
|
|
|
|
|
|
#define OLD -1
|
|
|
|
|
#define true 1
|
|
|
|
|
#define false 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int vert;
|
|
|
|
|
struct mouse{
|
|
|
|
|
dword x,y,lkm,pkm;
|
|
|
|
|
void get();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
void mouse::get()
|
|
|
|
|
{
|
|
|
|
|
EAX = 37;
|
|
|
|
|
EBX = 1;
|
|
|
|
|
$int 0x40
|
|
|
|
|
$mov ebx, eax
|
|
|
|
|
$shr eax, 16
|
|
|
|
|
$and ebx,0x0000FFFF
|
|
|
|
|
x = EAX;
|
|
|
|
|
y = EBX;
|
|
|
|
|
EAX = 37;
|
|
|
|
|
EBX = 2;
|
|
|
|
|
$int 0x40
|
|
|
|
|
$mov ebx, eax
|
|
|
|
|
$and eax, 0x00000001
|
|
|
|
|
$shr ebx, 1
|
|
|
|
|
$and ebx, 0x00000001
|
|
|
|
|
lkm = EAX;
|
|
|
|
|
pkm = EBX;
|
|
|
|
|
EAX = 37; //<2F><><EFBFBD>
|
|
|
|
|
EBX = 7;
|
|
|
|
|
$int 0x40
|
|
|
|
|
$mov ebx, eax
|
|
|
|
|
$shr eax, 16
|
|
|
|
|
$and ebx,0x0000FFFF
|
|
|
|
|
//hor = EAX;
|
|
|
|
|
vert = EBX;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
struct f70{
|
|
|
|
|
dword func;
|
|
|
|
|
dword param1;
|
|
|
|
|
dword param2;
|
|
|
|
|
dword param3;
|
|
|
|
|
dword param4;
|
|
|
|
|
char rezerv;
|
|
|
|
|
dword name;
|
|
|
|
|
};
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
struct BDVK{
|
|
|
|
|
dword attr;
|
|
|
|
|
byte type_name;
|
|
|
|
|
byte rez1, rez2, rez3;
|
|
|
|
|
dword timecreate;
|
|
|
|
|
dword datecreate;
|
|
|
|
|
dword timelastaccess;
|
|
|
|
|
dword datelastaccess;
|
|
|
|
|
dword timelastedit;
|
|
|
|
|
dword datelastedit;
|
|
|
|
|
dword sizelo;
|
|
|
|
|
dword sizehi;
|
|
|
|
|
char name[518];
|
|
|
|
|
};
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
struct proc_info{
|
|
|
|
|
dword use_cpu;
|
|
|
|
|
word pos_in_stack,num_slot,rezerv1;
|
|
|
|
|
char name[11];
|
|
|
|
|
char rezerv2;
|
|
|
|
|
dword adress,use_memory,ID,left,top,width,height;
|
|
|
|
|
word status_slot,rezerv3;
|
|
|
|
|
dword work_left,work_top,work_width,work_height;
|
|
|
|
|
char status_window;
|
|
|
|
|
void getme();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
void proc_info::getme()
|
|
|
|
|
{
|
|
|
|
|
EAX = 9;
|
|
|
|
|
EBX = #use_cpu;
|
|
|
|
|
ECX = -1;
|
|
|
|
|
$int 0x40
|
|
|
|
|
}
|
|
|
|
|
//-------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
inline fastcall dword WaitEvent(){
|
|
|
|
|
EAX = 10; // wait here for event
|
|
|
|
|
$int 0x40
|
|
|
|
|
}
|
|
|
|
|
|
2008-11-24 01:49:58 +01:00
|
|
|
|
/*inline fastcall void SetEventMask(dword EBX){
|
|
|
|
|
$mov eax,40
|
|
|
|
|
//$mov ebx,100111b
|
|
|
|
|
$int 0x40
|
|
|
|
|
}*/
|
2008-11-03 14:17:14 +01:00
|
|
|
|
|
|
|
|
|
inline fastcall word GetKey(){
|
|
|
|
|
EAX = 2; // just read this key from buffer
|
|
|
|
|
$int 0x40
|
|
|
|
|
EAX = EAX >> 8;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
inline fastcall word GetButtonID(){
|
|
|
|
|
EAX = 17; // Get ID
|
|
|
|
|
$int 0x40
|
|
|
|
|
EAX = EAX >> 8;
|
|
|
|
|
}
|
|
|
|
|
|
2008-11-24 01:49:58 +01:00
|
|
|
|
inline fastcall void ExitProcess(){
|
|
|
|
|
EAX = -1; // close this program
|
|
|
|
|
$int 0x40
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*void Pause(dword EBX)
|
|
|
|
|
{ //<2F><>㧠, <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> ᥪ㭤<E1A5AA> EBX = value
|
|
|
|
|
$mov eax, 5
|
|
|
|
|
$int 0x40
|
|
|
|
|
}*/
|
2008-11-03 14:17:14 +01:00
|
|
|
|
|
2008-11-24 01:49:58 +01:00
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
|
void DefineAndDrawWindow(dword x,y,sizeX,sizeY,byte mainAreaType,dword
|
|
|
|
|
mainAreaColor,byte headerType,dword headerColor,EDI)
|
2008-11-03 14:17:14 +01:00
|
|
|
|
{
|
2008-11-24 01:49:58 +01:00
|
|
|
|
EBX = x << 16 + sizeX;
|
|
|
|
|
ECX = y << 16 + sizeY;
|
|
|
|
|
EDX = mainAreaType << 24 | mainAreaColor;
|
|
|
|
|
ESI = headerType << 24 | headerColor;
|
|
|
|
|
$xor eax,eax
|
|
|
|
|
$int 0x40
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
inline fastcall void DrawTitle(dword ECX){
|
2008-11-03 14:17:14 +01:00
|
|
|
|
EAX = 71;
|
|
|
|
|
EBX = 1;
|
|
|
|
|
$int 0x40;
|
|
|
|
|
}
|
|
|
|
|
|
2008-11-24 01:49:58 +01:00
|
|
|
|
|
|
|
|
|
inline fastcall void WindowRedrawStatus(dword EBX){
|
|
|
|
|
EAX = 12; //tell os about windowdraw
|
|
|
|
|
$int 0x40
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
inline fastcall dword GetSkinWidth(){
|
2008-11-03 14:17:14 +01:00
|
|
|
|
EAX = 48;
|
|
|
|
|
EBX = 4;
|
|
|
|
|
$int 0x40
|
|
|
|
|
}
|
|
|
|
|
|
2008-11-24 01:49:58 +01:00
|
|
|
|
inline fastcall dword MoveSize(dword EBX,ECX,EDX,ESI){
|
|
|
|
|
EAX = 67;
|
|
|
|
|
$int 0x40
|
2008-11-03 14:17:14 +01:00
|
|
|
|
}
|
|
|
|
|
|
2008-11-24 01:49:58 +01:00
|
|
|
|
//------------------------------------------------------------------------------
|
2008-11-03 14:17:14 +01:00
|
|
|
|
|
2008-11-24 01:49:58 +01:00
|
|
|
|
inline fastcall dword strlen(dword EDI){
|
2008-11-03 14:17:14 +01:00
|
|
|
|
ECX=EAX=0;
|
|
|
|
|
ECX--;
|
|
|
|
|
$REPNE $SCASB
|
2008-11-24 01:49:58 +01:00
|
|
|
|
EAX-=2+ECX;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inline fastcall copystr(dword ESI,EDI)
|
|
|
|
|
{
|
|
|
|
|
$cld
|
|
|
|
|
l1:
|
|
|
|
|
$lodsb
|
|
|
|
|
$stosb
|
|
|
|
|
$test al,al
|
|
|
|
|
$jnz l1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
char buffer[11]="";
|
|
|
|
|
inline fastcall dword IntToStr(dword ESI)
|
|
|
|
|
{
|
|
|
|
|
$mov edi, #buffer
|
|
|
|
|
$mov ecx, 10
|
|
|
|
|
$test esi, esi
|
|
|
|
|
$jns f1
|
|
|
|
|
$mov al, '-'
|
|
|
|
|
$stosb
|
|
|
|
|
$neg esi
|
|
|
|
|
f1:
|
|
|
|
|
$mov eax, esi
|
|
|
|
|
$push -'0'
|
|
|
|
|
f2:
|
|
|
|
|
$xor edx, edx
|
|
|
|
|
$div ecx
|
|
|
|
|
$push edx
|
|
|
|
|
$test eax, eax
|
|
|
|
|
$jnz f2
|
|
|
|
|
f3:
|
|
|
|
|
$pop eax
|
|
|
|
|
$add al, '0'
|
|
|
|
|
$stosb
|
|
|
|
|
$jnz f3
|
|
|
|
|
$mov eax, #buffer
|
|
|
|
|
$ret
|
2008-11-03 14:17:14 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inline fastcall int strcmp(dword EAX,EBX)
|
|
|
|
|
{
|
2008-11-24 01:49:58 +01:00
|
|
|
|
#speed
|
2008-11-03 14:17:14 +01:00
|
|
|
|
ESI=EAX;
|
|
|
|
|
EBX--;
|
|
|
|
|
TOP:
|
|
|
|
|
EBX++;
|
|
|
|
|
$LODSB
|
|
|
|
|
$CMP AL,0
|
|
|
|
|
$JE HERE
|
|
|
|
|
$CMP DSBYTE[EBX],AL
|
|
|
|
|
$JE TOP
|
|
|
|
|
HERE:
|
|
|
|
|
AL-=DSBYTE[EBX];
|
|
|
|
|
return AL;
|
2008-11-24 01:49:58 +01:00
|
|
|
|
#codesize
|
2008-11-03 14:17:14 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inline fastcall dword ChangeCase(dword EDX)
|
|
|
|
|
{
|
2008-11-24 01:49:58 +01:00
|
|
|
|
#speed
|
2008-11-03 14:17:14 +01:00
|
|
|
|
AL=DSBYTE[EDX];
|
|
|
|
|
IF(AL>='a')&&(AL<='z')DSBYTE[EDX]=AL&0x5f;
|
|
|
|
|
EDX++;
|
|
|
|
|
do{
|
|
|
|
|
AL=DSBYTE[EDX];
|
|
|
|
|
IF(AL>='A')&&(AL<='Z')DSBYTE[EDX]=AL|0x20;
|
|
|
|
|
EDX++;
|
|
|
|
|
}while(AL!=0);
|
2008-11-24 01:49:58 +01:00
|
|
|
|
#codesize
|
2008-11-03 14:17:14 +01:00
|
|
|
|
}
|
|
|
|
|
|
2008-11-24 01:49:58 +01:00
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
|
inline fastcall void PutPixel(dword EBX,ECX,EDX){
|
|
|
|
|
EAX=1;
|
|
|
|
|
ECX+=skin_width;
|
|
|
|
|
$int 0x40
|
2008-11-03 14:17:14 +01:00
|
|
|
|
}
|
|
|
|
|
|
2008-11-24 01:49:58 +01:00
|
|
|
|
void DefineButton(dword x,y,w,h,EDX,ESI){
|
|
|
|
|
EAX = 8;
|
|
|
|
|
EBX = x<<16+w;
|
|
|
|
|
ECX = skin_width+y<<16+h;
|
2008-11-03 14:17:14 +01:00
|
|
|
|
$int 0x40
|
|
|
|
|
}
|
|
|
|
|
|
2008-11-24 01:49:58 +01:00
|
|
|
|
inline fastcall void DeleteButton(dword EDX)
|
2008-11-03 14:17:14 +01:00
|
|
|
|
{
|
|
|
|
|
EAX = 8;
|
2008-11-24 01:49:58 +01:00
|
|
|
|
EDX += BT_DEL;
|
|
|
|
|
$int 0x40;
|
2008-11-03 14:17:14 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void WriteText(dword x,y,byte fontType, dword color, EDX, ESI)
|
|
|
|
|
{
|
|
|
|
|
EAX = 4;
|
|
|
|
|
EBX = x<<16+skin_width+y;
|
|
|
|
|
ECX = fontType<<24+color;
|
|
|
|
|
$int 0x40;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrawBar(dword x,y,w,h,EDX)
|
|
|
|
|
{
|
2008-11-24 01:49:58 +01:00
|
|
|
|
#speed
|
2008-11-03 14:17:14 +01:00
|
|
|
|
EAX = 13;
|
|
|
|
|
EBX = x<<16+w;
|
|
|
|
|
ECX = skin_width+y<<16+h;
|
|
|
|
|
$int 0x40
|
2008-11-24 01:49:58 +01:00
|
|
|
|
#codesize
|
2008-11-03 14:17:14 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrawRegion(dword x,y,width,height,color1)
|
|
|
|
|
{
|
|
|
|
|
DrawBar(x,y,width,1,color1); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> ᢥ<><E1A2A5><EFBFBD>
|
|
|
|
|
DrawBar(x,y+height,width,1,color1); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> ᭨<><E1ADA8>
|
|
|
|
|
DrawBar(x,y,1,height,color1); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <><E1ABA5>
|
|
|
|
|
DrawBar(x+width,y,1,height+1,color1); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><>ࠢ<EFBFBD>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrawFlatButton(dword x,y,width,height,id,color,text)
|
|
|
|
|
{
|
|
|
|
|
DrawRegion(x,y,width,height,0x94AECE);
|
|
|
|
|
DrawBar(x+1,y+1,width-1,1,0xFFFFFF); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
DrawBar(x+1,y+height-1,width-2,1,0xC7C7C7); //<2F><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
|
|
|
|
DrawBar(x+1,y+1,1,height-1,0xFFFFFF); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
DrawBar(x+width-1,y+2,1,height-2,0xC7C7C7); //<2F><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
|
|
|
|
DrawBar(x+2,y+2,width-3,height-3,color); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2008-11-24 01:49:58 +01:00
|
|
|
|
IF (id<>0) DefineButton(x,y,width,height,id+BT_HIDE,0xEFEBEF); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2008-11-03 14:17:14 +01:00
|
|
|
|
WriteText(-strlen(text)*6+width/2+x+1,height/2-3+y,0x80,0,text,0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void PutImage(dword EBX,w,h,x,y)
|
|
|
|
|
{
|
|
|
|
|
EAX = 7;
|
|
|
|
|
ECX = w<<16+h;
|
|
|
|
|
EDX = x<<16+y+skin_width;
|
|
|
|
|
$int 0x40
|
|
|
|
|
}
|
|
|
|
|
|
2008-11-24 01:49:58 +01:00
|
|
|
|
void PutPaletteImage(dword EBX,w,h,x,y, EDI)
|
2008-11-03 14:17:14 +01:00
|
|
|
|
{
|
2008-11-24 01:49:58 +01:00
|
|
|
|
EAX = 65;
|
|
|
|
|
ECX = w<<16+h;
|
|
|
|
|
EDX = x<<16+y+skin_width;
|
|
|
|
|
ESI = 8;
|
|
|
|
|
EBP = 0;
|
2008-11-03 14:17:14 +01:00
|
|
|
|
$int 0x40
|
2008-11-24 01:49:58 +01:00
|
|
|
|
}
|
2008-11-03 14:17:14 +01:00
|
|
|
|
|
2008-11-24 01:49:58 +01:00
|
|
|
|
//------------------------------------------------------------------------------
|
2008-11-03 14:17:14 +01:00
|
|
|
|
|
|
|
|
|
f70 CopyFile_f;
|
|
|
|
|
BDVK CopyFile_atr;
|
|
|
|
|
inline fastcall dword CopyFile(dword EBX,ECX)
|
|
|
|
|
{
|
|
|
|
|
dword s=EBX, d=ECX, cBufer=0;
|
|
|
|
|
CopyFile_f.func = 5;
|
|
|
|
|
CopyFile_f.param1 = 0;
|
|
|
|
|
CopyFile_f.param2 = 0;
|
|
|
|
|
CopyFile_f.param3 = 0;
|
|
|
|
|
CopyFile_f.param4 = #CopyFile_atr;
|
|
|
|
|
CopyFile_f.rezerv = 0;
|
|
|
|
|
CopyFile_f.name = s;
|
|
|
|
|
$mov eax, 70
|
|
|
|
|
$mov ebx, #CopyFile_f
|
|
|
|
|
$int 0x40
|
|
|
|
|
|
2008-11-24 01:49:58 +01:00
|
|
|
|
if (!EAX)
|
2008-11-03 14:17:14 +01:00
|
|
|
|
{
|
|
|
|
|
cBufer = malloc(CopyFile_atr.sizelo);
|
|
|
|
|
CopyFile_f.func = 0;
|
|
|
|
|
CopyFile_f.param1 = 0;
|
|
|
|
|
CopyFile_f.param2 = 0;
|
|
|
|
|
CopyFile_f.param3 = CopyFile_atr.sizelo;
|
|
|
|
|
CopyFile_f.param4 = cBufer;
|
|
|
|
|
CopyFile_f.rezerv = 0;
|
|
|
|
|
CopyFile_f.name = s;
|
|
|
|
|
$mov eax, 70
|
|
|
|
|
$mov ebx, #CopyFile_f
|
|
|
|
|
$int 0x40
|
|
|
|
|
|
2008-11-24 01:49:58 +01:00
|
|
|
|
IF (!EAX)
|
2008-11-03 14:17:14 +01:00
|
|
|
|
{
|
|
|
|
|
CopyFile_f.func = 2;
|
|
|
|
|
CopyFile_f.param1 = 0;
|
|
|
|
|
CopyFile_f.param2 = 0;
|
|
|
|
|
CopyFile_f.param3 = CopyFile_atr.sizelo;
|
|
|
|
|
CopyFile_f.param4 = cBufer;
|
|
|
|
|
CopyFile_f.rezerv = 0;
|
|
|
|
|
CopyFile_f.name = d;
|
|
|
|
|
$mov eax, 70
|
|
|
|
|
$mov ebx, #CopyFile_f
|
|
|
|
|
$int 0x40
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|