Removed old (unmaintained) network programs from SVN.

git-svn-id: svn://kolibrios.org@5052 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
hidnplayr 2014-08-22 13:06:10 +00:00
parent 7dce54fc55
commit d48e37c330
73 changed files with 0 additions and 21513 deletions

View File

@ -1,321 +0,0 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ;
; BROWSER for KolibriOS ;
; ;
; Compile with FASM ;
; ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; It's a work in progress but I (esevece) commit it, because if I don't continue developing it someone can continue.
; Please, keep the code clean
; The header
use32 ; Tell compiler to use 32 bit instructions
org 0x0 ; the base address of code, always 0x0
db 'MENUET01'
dd 0x01
dd START
dd I_END
dd 0x100000
dd 0x7fff0
dd 0, 0
; The code area
;include 'macros.inc'
START: ; start of execution
call draw_window ; draw the window
; After the window is drawn, it's practical to have the main loop.
; Events are distributed from here.
event_wait:
mov eax, 10 ; function 10 : wait until event
int 0x40 ; event type is returned in eax
cmp eax, 1 ; Event redraw request ?
je redraw ; Expl.: there has been activity on screen and
; parts of the applications has to be redrawn.
cmp eax, 2 ; Event key in buffer ?
je key ; Expl.: User has pressed a key while the
; app is at the top of the window stack.
cmp eax, 3 ; Event button in buffer ?
je button ; Expl.: User has pressed one of the
; applications buttons.
jmp event_wait
; The next section reads the event and processes data.
redraw: ; Redraw event handler
call draw_window ; We call the window_draw function and
jmp event_wait ; jump back to event_wait
key: ; Keypress event handler
mov eax, 2 ; The key is returned in ah. The key must be
int 0x40 ; read and cleared from the system queue.
jmp event_wait ; Just read the key, ignore it and jump to event_wait.
button: ; Buttonpress event handler
mov eax,17 ; The button number defined in window_draw
int 0x40 ; is returned to ah.
cmp ah,1 ; button id=1 ?
jne noclose
mov eax,-1 ; Function -1 : close this program
int 0x40
noclose:
cmp ah, 2 ; call fetch_thread
jne no_fetch_thread
call fetch_thread
jmp event_wait ; This is for ignored events, useful at development
no_fetch_thread:
jmp event_wait
; FETCHER
FETCH:
mov ecx, 1000
get_free_port:
inc ecx
mov eax, 53
mov ebx, 9
int 0x40
cmp eax, 0 ; is port used?
jz get_free_port
open_socket:
mov eax, 53
mov ebx, 5
mov edx, 80
mov esi, 0x0417042E ; 46.4.23.4 (kolibrios.org), only for try
mov edi, 1
int 0x40
mov [socket], eax
cmp [socket], -1 ; error?
jne status_socket
ret
status_socket:
mov eax, 53
mov ebx, 6
mov ecx, [socket]
int 0x40
cmp eax, 4 ; connected?
jne status_socket
send_request:
.concat_request:
mov edi, request
mov ebx, 0 ; request_length
mov esi, request_first_line
._first_line:
movsb
inc ebx ; request_length
cmp byte [edi], 0
jne ._first_line
mov esi, request_second_line
._second_line:
movsb
inc ebx ; request_length
cmp byte [edi], 0
jne ._second_line
mov esi, host
._second_line_host:
movsb
inc ebx ; request_length
cmp byte [edi], 0
jne ._second_line_host
mov esi, request_third_line
._third_line:
movsb
inc ebx ; request_length
cmp byte [edi], 0
jne ._third_line
mov [request_length], ebx
.write_to_socket:
mov eax, 53
mov ebx, 7
mov ecx, [socket]
mov edx, [request_length]
mov esi, request
int 0x40
cmp eax, -1 ; error?
je .write_to_socket
.poll_socket:
mov eax, 53
mov ebx, 2
mov ecx, [socket]
int 0x40
cmp eax, 0
jne .read_socket
; only for test purposes
mov eax, 63
mov ebx, 1
mov cl, 's'
int 0x40
.status_socket:
mov eax, 53
mov ebx, 6
mov ecx, [socket]
int 0x40
cmp eax, 4
jne end_of_request
.read_socket:
mov eax, 53
mov ebx, 11
mov ecx, [socket]
mov edx, [buffer]
mov esi, 4096
int 0x40
; only for test purposes
mov eax, 63
mov ebx, 1
mov cl, 'p'
int 0x40
jmp .poll_socket
end_of_request:
.close_socket:
mov eax, 53
mov ebx, 8
mov ecx, [socket]
int 0x40
; only for test purposes
mov eax, 63
mov ebx, 1
mov cl, 'b'
int 0x40
jmp terminate_thread
fetch_thread:
cmp [thread_id], 0
jne terminate_thread
mov eax, 51
mov ebx, 1
mov ecx, FETCH
mov edx, [thread_stack]
int 0x40
jmp event_wait
no_new_thread:
ret
terminate_thread:
mov eax, 18
mov ebx, 18
mov ecx, [thread_id]
int 0x40
cmp eax, 0
jne terminate_thread
mov [thread_id], 0
ret
thread_stack dd 0x80000
thread_id dd 0x0
; *********************************************
; ****** WINDOW DEFINITIONS AND DRAW ********
; *********************************************
;
; The static window parts are drawn in this function. The window canvas can
; be accessed later from any parts of this code (thread) for displaying
; processes or recorded data, for example.
;
; The static parts *must* be placed within the fn 12 , ebx = 1 and ebx = 2.
draw_window:
mov eax, 12 ; function 12: tell os about windowdraw
mov ebx, 1 ; 1, start of draw
int 0x40
mov eax, 0 ; function 0 : define and draw window
mov ebx, 100 * 65536 + 300 ; [x start] *65536 + [x size]
mov ecx, 100 * 65536 + 120 ; [y start] *65536 + [y size]
mov edx, 0x14ffffff ; color of work area RRGGBB
; 0x02000000 = window type 4 (fixed size, skinned window)
mov esi, 0x808899ff ; color of grab bar RRGGBB
; 0x80000000 = color glide
mov edi, title
int 0x40
; Fetch button
mov eax, 8
mov ebx, 25 * 65536 + 128
mov ecx, 88 * 65536 + 20
mov edx, 2
mov esi, 0x6677cc
int 0x40
mov ebx, 25 * 65536 + 35 ; draw info text with function 4
mov ecx, 0x224466
mov edx, text
mov esi, 40
mov eax, 4
.newline: ; text from the DATA AREA
int 0x40
add ebx, 10
add edx, 40
cmp byte[edx], 0
jne .newline
mov eax, 12 ; function 12:tell os about windowdraw
mov ebx, 2 ; 2, end of draw
int 0x40
ret
; *********************************************
; ************* DATA AREA *****************
; *********************************************
;
; Data can be freely mixed with code to any parts of the image.
; Only the header information is required at the beginning of the image.
text db "It look's like you have just compiled "
db "your first program for KolibriOS. "
db " "
db "Congratulations! ", 0
title db "KolibriOS Browser", 0
socket dd 0
socket_status dd 0
server_ip db 046,004,023,004
server_port db 0,0
request_first_line db 'GET / HTTP/1.1',0
request_second_line db 13,10,'Host: ',0
request_third_line db 13,10,'Connection: close',13,10,13,10,0
request db 0
request_length dd 0
host db 'kolibrios.org',0
buffer dd 0
I_END:
; The area after I_END is free for use as the application memory,
; just avoid the stack.
;
; Application memory structure, according to the used header, 1 Mb.
;
; 0x00000 - Start of compiled image
; I_END - End of compiled image
;
; + Free for use in the application
;
; 0x7ff00 - Start of stack area
; 0x7fff0 - End of stack area - defined in the header
;
; + Free for use in the application
;
; 0xFFFFF - End of freely useable memory - defined in the header
;
; All of the the areas can be modified within the application with a
; direct reference.
; For example, mov [0x80000],byte 1 moves a byte above the stack area.

View File

@ -1,6 +0,0 @@
@erase lang.inc
@echo lang fix en >lang.inc
@fasm browser.asm browser
@kpack browser
@erase lang.inc
@pause

View File

@ -1,13 +0,0 @@
#!/bin/bash
# This script does for linux the same as build.bat for DOS,
# it compiles the KoOS kernel, hopefully ;-)
echo "lang fix en"
echo "lang fix en" > lang.inc
fasm -m 16384 browser.asm browser
rm -f lang.inc
exit 0

View File

@ -1,5 +0,0 @@
@erase lang.inc
@echo lang fix en >lang.inc
@fasm chess.asm chess
@erase lang.inc
@pause

View File

@ -1,5 +0,0 @@
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm chess.asm chess
@erase lang.inc
@pause

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

View File

@ -1,5 +0,0 @@
@erase lang.inc
@echo lang fix en >lang.inc
@fasm https.asm https
@erase lang.inc
@pause

View File

@ -1,5 +0,0 @@
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm https.asm https
@erase lang.inc
@pause

File diff suppressed because it is too large Load Diff

View File

@ -1,160 +0,0 @@
; constants
FLAP_HEAD_SIZE = 6
SNAC_HEAD_SIZE = 10
;AUTH_MESSAGE = 0008h
;USER_ADDED_MESS = 000Ch
;AUTH_REQ_MESS = 0006h
;URL_MESS = 0004h
;WEB_MESS = 000dh
;EMAIL_MESS = 000eh
;MASS_MESS_MASK = 8000h
;MRURL_MESS = 8004h
;NORM_MESS = 0001h
;MRNORM_MESS = 8001h
;CONTACT_MESS = 0013h
;MRCONTACT_MESS = 8013h
;
;
;
;CAP_PRECAP = "\x09\x46\x13"
;CAP_PRERTF = "\x97\xb1\x27"
;CAP_POSCAP = "\x4c\x7f\x11\xd1\x82\x22\x44\x45\x53\x54\x00\x00"
;CAP_POSRTF = "\x24\x3c\x43\x34\xad\x22\xd6\xab\xf7\x3f\x14\x92"
;
;Fingerprinting Capabilities
;
;CAP_M2001 = "\x2e\x7a\x64" "\x75" "\xfa\xdf\x4d\xc8\x88\x6f\xea\x35\x95\xfd\xb6\xdf"
;CAP_M2001_2 = "\xa0\xe9\x3f" "\x37" "\x4f\xe9\xd3\x11\xbc\xd2\x00\x04\xac\x96\xdd\x96"
;CAP_M2002 = "\x10\xcf\x40" "\xd1" "\x4f\xe9\xd3\x11\xbc\xd2\x00\x04\xac\x96\xdd\x96"
;CAP_MLITE = "\x56\x3f\xc8" "\x09" "\x0b\x6f\x41\xbd\x9f\x79\x42\x26\x09\xdf\xa2\xf3"
;CAP_SIMICQ = "\x97\xb1\x27" "\x51" "\x24\x3c\x43\x34\xad\x22\xd6\xab\xf7\x3f\x14\x48"
;CAP_MICQ = "mICQ \xa9 R.K. \x00\x00\x00\x00"
;CAP_TRILL_NORM = "\x97\xb1\x27" "\x51" "\x24\x3c\x43\x34\xad\x22\xd6\xab\xf7\x3f\x14\x09"
;CAP_TRILL_CRYPT= "\xf2\xe7\xc7" "\xf4" "\xfe\xad\x4d\xfb\xb2\x35\x36\x79\x8b\xdf\x00\x00"
;CAP_LICQ = "\x09\x49\x13"
;
;DC Packet Types
;
;PEER_INIT = 0ffh
;PEER_INITACK = 01h
;PEER_MSG = 02h
;PEER_INIT2 = 03h
;PEER_FILE_INIT = 00h
;PEER_FILE_INIT_ACK = 01h
;PEER_FILE_START = 02h
;PEER_FILE_START_ACK = 03h
;PEER_FILE_STOP = 04h
;PEER_FILE_SPEED = 05h
;PEER_FILE_DATA = 06h
ICQ_PORT = 5190
;
; FLAP transport
;
FLAP_ID = 02ah
struc FLAP_head
{
.bId db FLAP_ID ;id byte
.bCh db ? ;channel
.wSn dw ? ;seq number
.wDs dw ? ;data size
}
;
; Channels ID
;
NEW_CONNECTION = 01h
SNAC_DATA = 02h
FLAP_ERROR = 03h
CLOSE_CONNECTION = 04h
KEEP_ALIVE = 05h
;
; SNAC
;
struc SNAC_head
{
.wFid dw ?; Family id
.wSid dw ?; subtype id
.wDf dw ?; SNAC flags
.dRi dd ?; SNAC Request id
}
;
;
; Familes/SNACs list
;
GENERIC_SN = 0001h
LOCATION_SN = 0002h
BUDDY_LIST_SN = 0003h
ICBM_SN = 0004h
PRIVACY_SN = 0009h
BUDDY_ICONS_SN = 0010h
SSI_SN = 0013h
AUTH_REG_SN = 0017h
;
; TLV
;
struc TLV_head
{
.wTn dw ?; TLV type number
.wLv dw ?; TLV length value
}
;
; userinfo block
;
struc UI_head
{
.bUinLength db 0 ; UIN/screenname length
.bUin db 11 dup 0 ; string
.wWl dw 0 ; Warning level
.dUserClass dd 0
.dCreateTime dd 0
.dSignonTime dd 0
.wIdleTime dw 0
.dCreationTime dd 0
.dUserStatus dd 0
.dIpAddress dd 0
.dOnlineTime dd 0
}
;
;Roasting array
;
ROASTING_ARRAY db 0F3h, 026h, 081h, 0C4h, 039h, 086h, 0DBh, 092h, 071h, 0A3h, 0B9h, 0E6h, 053h, 07Ah, 095h, 07Ch
;
; Status flags
;
;
STATUS_WEBAWARE = 0x0001 ;Status webaware flag
STATUS_SHOWIP = 0x0002 ;Status show ip flag
STATUS_BIRTHDAY = 0x0008 ;User birthday flag
STATUS_WEBFRONT = 0x0020 ;User active webfront flag
STATUS_DCDISABLED = 0x0100 ;Direct connection not supported
STATUS_DCAUTH = 0x1000 ;Direct connection upon authorization
STATUS_DCCONT = 0x2000 ;DC only with contact users
;
; Status
;
STATUS_ONLINE = 0x0000 ;Status is online
STATUS_AWAY = 0x0001 ;Status is away
STATUS_DND = 0x0002 ;Status is no not disturb (DND)
STATUS_NA = 0x0004 ;Status is not available (N/A)
STATUS_OCCUPIED = 0x0010 ;Status is occupied (BISY)
STATUS_FREE4CHAT = 0x0020 ;Status is free for chat
STATUS_INVISIBLE = 0x0100 ;Status is invisible

View File

@ -1,37 +0,0 @@
v 0.01
Версия тестовая, поэтому много недоработок
и выводятся отладочные сообщения
Поддерживается:
* Серверный КЛ
* передача/прием сообщений plain-text
* Перекодировка CP866<->CP1251
* Прием offline сообщений
* Отправка сообщения пользователю не в контакт-листе
/UIN Сообщение
Недоработки: Много :-)
* Отключено закрытие сокетов - ядро виснет, при
попытке закрыть сокет
* Все сообщения от разных юзеров в одном поле вывода
* Нельзя сменить статус
* Нельзя отключится, опять же из-за закрытия сокетов
* Не поддерживается UTF-8 и RTF сообщения
* Из информации о юзере доступен только ник
* editbox иногда ведет себя странно :-)
* ..........
Выражаю благодарность всем разработчикам OS Kolibri
за прекрасные инструменты и документацию, без которой я бы
ничего не написал :-), а также проекту iserverd.khstu.ru,
сервер и описания протоколов которого я использовал.
если у вас есть какие-нибудь предложения, присылайте на lv4evil@yandex.ru

View File

@ -1,56 +0,0 @@
00 00 08 00 07 36 32 31 38 38 39 37 0A 1E 43 18 .....6218897..C.
^^ byte Version number of SSI protocol (currently 0x00)
^^ ^^ word Number of items in this snac
^^ ^^ word Length of the item name
^^ ^^ ^^ ^^ ^^ ^^ ^^ string Item name string
^^ ^^ word Group ID#
^^ ^^ word Item ID#
00 00 00 0A 01 31 00 06 46 75 6E 42 6F 6F 00 09 .....1..FunBoo..
^^ ^^ word Type of item flag (see list bellow)
^^ ^^ word Length of the additional data
^^ ^^ word TLV.Type (TLV #1)
^^ ^^ word TLV.Length
^^ ^^ ^^ ^^ ^^ ^^ TLV.Value
31 37 36 33 33 33 30 37 38 17 B7 2A 18 00 00 00 176333078..*....
09 01 31 00 05 45 2E 53 2E 56 00 07 36 32 31 38 ..1..E.S.V..6218
38 39 38 23 8C 12 A1 00 00 00 09 01 31 00 05 74 898#........1..t
68 6F 72 64 00 07 46 72 69 65 6E 64 73 7F ED 00 hord..Friends...
00 00 01 00 00 00 0A 43 6F 2D 57 6F 72 6B 65 72 .......Co-Worker
73 55 7F 00 00 00 01 00 00 00 07 36 32 31 38 38 sU.........62188
39 35 23 8C 08 80 00 00 00 0D 01 31 00 09 52 65 95#........1..Re
67 72 65 73 73 6F 72 00 07 36 32 35 31 37 32 33 gressor..6251723
23 8C 05 83 00 00 00 0D 01 31 00 05 47 68 6F 73 #........1..Ghos
74 00 66 00 00 00 07 36 32 31 33 39 34 39 23 8C t.f....6213949#.
26 9A 00 00 00 0D 01 31 00 05 6D 69 63 6B 79 00 &......1..micky.
66 00 00 3B B7 4B 7D
0x0000 Buddy record (name: uin for ICQ and screenname for AIM)
0x0001 Group record
0x0002 Permit record ("Allow" list in AIM, and "Visible" list in ICQ)
0x0003 Deny record ("Block" list in AIM, and "Invisible" list in ICQ)
0x0004 Permit/deny settings or/and bitmask of the AIM classes
0x0005 Presence info (if others can see your idle status, etc)
0x0009 Unknown. ICQ2k shortcut bar items ?
0x000E Ignore list record.
0x000F Last update date (name: "LastUpdateDate").
0x0010 Non-ICQ contact (to send SMS). Name: 1#EXT, 2#EXT, etc
0x0013 Item that contain roster import time (name: "Import time")
0x0014 Own icon (avatar) info. Name is an avatar id number as text
[TLV(0x0131), itype 0x00, size XX] - This stores the name that the contact should show up as in the contact list. It should initially be set to the contact's nick name, and can be changed to anything by the client.

View File

@ -1,5 +0,0 @@
@erase lang.inc
@echo lang fix en >lang.inc
@fasm ki.asm ki
@erase lang.inc
@pause

View File

@ -1,2 +0,0 @@
@fasm ki.asm ki

View File

@ -1,221 +0,0 @@
include "MACROS.INC"
initipc:
mov eax,9
mov ebx,prc
mov ecx,-1
int 0x40
mov ecx,eax
loop1:
push ecx
mov eax,9
mov ebx,prc
int 0x40
cmp word [prc+10],'CM'
jne no_cmd
cmp byte [prc+12],'D'
jne no_cmd
mov ebx,[prc+30]
mov dword [cmdpid],ebx
mov dword [cmdnumb],ecx
no_cmd:
pop ecx
loop loop1
cmp dword [cmdpid],0
jne no_exit
jmp exit
no_exit:
mov eax,60
mov ebx,2
mov ecx,dword [cmdpid]
mov edx,printf
mov esi,4
int 0x40
call initcmd
waitcmdinit:
mov eax,40
mov ebx,01000000b
int 0x40
mov eax,23
mov ebx,100
int 0x40
cmp eax,7
je cmd_ok
jmp exit
cmd_ok:
cmp byte [ipcb+16],'.'
jne exit
mov eax,18
mov ebx,3
mov ecx,dword [cmdnumb]
int 0x40
ret
pause1:
mov eax,5
mov ebx,1
int 0x40
ret
exit:
mov eax,-1
int 0x40
cls:
mov eax,60
mov ebx,2
mov ecx,dword [cmdpid]
mov edx,ipccls
mov esi,4
int 0x40
call pause1
ret
print:
mov ecx,84
loopprt:
mov edi,stripc
add edi,ecx
mov esi,fill_symbol
movsb
loop loopprt
cld
mov ecx,4
mov edi,stripc
mov esi,printf
rep movsb
cld
mov edx,79
sub edx,eax
mov ecx,79
sub ecx,edx
mov edi,stripc+4
mov esi,ebx
rep movsb
mov eax,60
mov ebx,2
mov ecx,dword [cmdpid]
mov edx,stripc
mov esi,84
int 0x40
call pause1
ret
eol:
mov eax,60
mov ebx,2
mov ecx,dword [cmdpid]
mov edx,ipceol
mov esi,4
int 0x40
call pause1
ret
initcmd:
mov eax,60
mov ebx,2
mov ecx,dword [cmdpid]
mov edx,ipckey
mov esi,4
int 0x40
mov eax,60
mov ebx,1
mov ecx,ipcb
mov edx,28
int 0x40
cld
mov ecx,28
mov edi,ipcb
mov esi,ipcc
rep movsb
ret
getkey:
call initcmd
waitagain:
mov eax,40
mov ebx,01000000b
int 0x40
mov eax,10
int 0x40
cmp eax,7
jne waitagain
mov edi,key
mov esi,ipcb+16
movsb
ret
endipc:
mov eax,60
mov ebx,2
mov ecx,dword [cmdpid]
mov edx,ipcend
mov esi,4
int 0x40
jmp exit
cmdpid dd 0
cmdnumb dd 0
printf db '~ppp'
ipceol db '~lll'
ipcend db '~eee'
ipccls db '~ccc'
ipckey db '~kkk'
key db 0
ipcb:
db 0
db 0,0,0
dd 8
times 20 db 0
ipcc:
db 0
db 0,0,0
dd 8
times 20 db 0
stripc: times 84 db 0
fill_symbol db 0
prc: times 52 db 0

View File

@ -1,972 +0,0 @@
;
; ­ à¨á®¢ âì ¯àאַ㣮«ì­¨ª
; x1,y1 ---------|
; | |
; | |
; |-------------x2,y2
;
macro rect x1, y1, x2, y2, color
{
pushad
;mov edx, color
; ------------
;mov eax, 38
mov ebx, x1
shl ebx, 16
add ebx, x2
mov ecx, y1
shl ecx, 16
add ecx, y1
;int 40h
mcall 38, ebx, ecx, color
; ------------
;mov eax, 38
mov ebx, x1
shl ebx, 16
add ebx, x2
mov ecx, y2
shl ecx, 16
add ecx, y2
;int 40h
mcall 38, ebx, ecx, color
; |
; |
; |
;mov eax, 38
mov ebx, x1
shl ebx, 16
add ebx, x1
mov ecx, y1
shl ecx, 16
add ecx, y2
;int 40h
mcall 38, ebx, ecx, color
; |
; |
; |
;mov eax, 38
mov ebx, x2
shl ebx, 16
add ebx, x2
mov ecx, y1
shl ecx, 16
add ecx, y2
;int 40h
mcall 38, ebx, ecx, color
popad
}
;
; ‚뢮¤ ­  íªà ­ ¡ãä¥à  á® áâப ¬¨
;
scbuff db 80*41 dup 0
; 60 - ¤«¨­  áâப¨
; 41 - ª®«¨ç¥á⢮ áâப
;
ind db 0 ; ’¥ªã騩 ¨­¤¥ªá
;
;
x_s dw 15 ; Š®®à¤¨­ âë «¥¢®£® ¢¥àå­¥£® 㣫  FIXIT
y_s dw 38 ;
; ‚ëá®â  áâப¨
SH = 10
xlen dw 80 ; ¤«¨­  áâப¨
;ylen dw 128 ; ª®«¨ç¥á⢮ áâப
ylen dw 40
;<EFBFBD>®á«¥¤­¨¥ 4 ¡ ©â  ¢ áâப¥ ®¡®§­ ç îâ 梥â
printbuff:
pushad
;
; <EFBFBD> à¨á㥬 ¡¥«ë© ¯àאַ㣮«ì­¨ª
;
;mov eax, 13
;mov ebx, 15*65536+480
;mov ecx, 31*65536+418
;mov edx, 0FFFFFFh
;int 40h
mcall 13, (15 * 65536 + 480), (31 * 65536 + 418), 0x00FFFFFF
xor ecx, ecx ; ‘ç¥â稪
;xor eax, eax
xor ebx, ebx
;xor edx, edx
pb_loop:
xor edx, edx
xor eax, eax
mov dl, [ind] ; ˆ­¤¥ªá
mov ax, [ylen]
;mul edx
cmp ecx, eax
ja pr_end
;
;
add edx, ecx ;<EFBFBD>ਡ ¢¨¬ áç¥â稪
xor eax, eax
mov ax, [ylen]
cmp edx, eax ;ˆ­¤¥ªá ¬¥­ìè¥ ª®«¨ç¥á⢠ áâப
jna @f ;<=
sub edx, eax ;…᫨ ¡®«ìè¥, áç¨â ¥¬ á ­ ç « 
dec edx
@@:
;
mov bx, [x_s] ; Š®®à¤¨­ â  X
shl ebx, 16 ;
push ecx
mov eax, SH ; ‚ëç¨á«ï¥¬ ¬¥á⮯®«®¦¥­¨¥ áâப¨
imul eax, ecx ;
;mov ecx, eax
;xor eax, eax
;mov ax , [x_s]
xor ecx, ecx
mov cx, [y_s]
add ecx, eax
add ebx, ecx ; Š®®à¤¨­ â  Y
;
xor eax, eax
mov ax, [xlen] ;¤«¨­  áâப¨
imul edx, eax ;“¬­®¦ ¥¬ áç¥â稪 ­  ¤«¨­ã áâப¨, ¯®«ãç ¥¬ ᬥ饭¨¥ ®â­®á¨â¥«ì­® ­ ç «  ¡ãä¥à 
;mov edx, eax
add edx, scbuff
xor eax, eax
mov ax, [xlen]
sub eax, 4
xor ecx, ecx
mov ecx, dword [edx+eax] ; <EFBFBD>®á«¥¤­¨¥ 4 <EFBFBD> ©â  á 梥⮬
or ecx, 0x80000000 ; ‚뢮¤¨âì ASCIIZ
;mov eax, 4
;mov esi, -1 ; For Menuet
;int 40h
mcall 4, ebx, ecx, edx
pop ecx
inc ecx
jmp pb_loop
pr_end:
popad
ret
;
; Žâ« ¤®ç­ë¥ á®®¡é¥­¨ï
;
macro write_debug str
{
local ..string, ..label, ..end, ..loop, ..fin, ..n_inc
jmp ..label
..string db str, 0
..label:
pushad
xor eax, eax
xor ebx, ebx
xor ecx, ecx
xor edx, edx
mov bl, [ind]
mov ax, [xlen]
imul ebx, eax
add ebx, scbuff
;
; —¥à­ë© 梥⠢뢮¤ 
;
mov edx, ebx
lea edx, [edx+eax]
sub edx, 4 ;4 ¡ ©â  á 梥⮬
mov dword [edx], dword 0
xor edx, edx
..loop:
mov dl, [..string+ecx]
cmp dl, 0
jz ..end
mov [ebx+ecx], dl
inc ecx
jmp ..loop
..end:
mov [ebx+ecx], dl
xor ebx, ebx
mov bl, [ind]
cmp bx, [ylen]
jz ..n_inc
inc bl
jmp ..fin
..n_inc:
xor bl, bl
..fin:
mov [ind], bl
call printbuff
;call draw_window
popad
}
;
; Š­®¯ª 
;
macro draw_button x, y, xlen, ylen, id, str
{
pushad
local ..string, ..label
jmp ..label
..string db str, 0
..label:
mcall 8, (x*65536+xlen), (y*65536+ylen), id, 0x4466aa
mcall 4, ((x+5)*65536+y+ylen/2-3), 0x80FFFFFF, ..string
popad
}
;
; Žâ« ¤®ç­ë© ¢ë¢®¤ ¤ ­­ëå
;
macro data_debug str, rg
{
pushad
local ..string, ..end, ..loop, ..strend, ..fin, ..label, ..n_inc
jmp ..label
..string db str, 20h, 0, 0, 0, 0, 0, 0, 0, 0, 0
..strend:
..label:
;xor eax, eax
;xor ebx, ebx
xor ecx, ecx
xor edx, edx
mov eax, rg
lea ebx, [..strend-9]
call int2str
xor eax, eax
xor ebx, ebx
mov bl, [ind]
mov ax, [xlen]
imul ebx, eax
add ebx, scbuff
;
; —¥à­ë© 梥⠢뢮¤ 
;
mov edx, ebx
lea edx, [edx+eax]
sub edx, 4 ;4 ¡ ©â  á 梥⮬
mov dword [edx], dword 0
xor edx, edx
..loop:
mov dl, [..string+ecx]
cmp dl, 0
jz ..end
mov [ebx+ecx], dl
inc ecx
jmp ..loop
..end:
mov [ebx+ecx], dl
xor ebx, ebx
mov bl, [ind]
cmp bx, [ylen]
jz ..n_inc
inc bl
jmp ..fin
..n_inc:
xor bl, bl
..fin:
mov [ind], bl
call printbuff
;call draw_window
popad
}
; <--EAX
; -->[ebx]
;
int2str:
pushf
;push ebx
push ecx
push edx
push esi
;xor ebx, ebx
xor ecx, ecx
i_loop:
mov edx, eax
push ecx
shl ecx, 2
mov esi, 28
sub esi, ecx
mov ecx, esi
shr edx, cl
pop ecx
and dl, 0fh ;Žâ¤¥«¨âì ¬« ¤è¨¥ 4 ¡¨â 
cmp dl, 0Ah ;<EFBFBD>㪢 
jnc @f
or dl, 0x30
jmp i_n1
@@:
sub dl, 9
or dl, 0x40
i_n1:
mov [ebx+ecx], dl
inc ecx
cmp ecx, 8
jnz i_loop
pop esi
pop edx
pop ecx
;pop ebx
popf
ret
;
; „«ï ¢ë¢®¤  á®®¡é¥­¨©
; [eax] <-- null-terminated string
; ebx <-- color
;
writemsg:
pushad
xor edi, edi
wm_loop:
xor esi, esi ; …᫨ 1 - ¥áâì ¥é¥ á¨¬¢®«ë ¢ áâப¥
lea eax, [eax+edi]
push ebx
push eax
xor eax, eax
xor ebx, ebx
mov bl, [ind]
mov ax, [xlen]
imul ebx, eax
add ebx, scbuff
;
; <EFBFBD> §¡¨¢ ¥¬ áâபã á®®¡é¥­¨ï ­  ­¥áª®«ìª® áâப ¯® xlen-4 (â.ª ¢ ª®­æ¥ ¤¢®©­®¥ á«®¢® - 梥â áâப¨)
;
pop eax
mov edx, eax
call strlen
movzx ecx, [xlen]
cmp eax, ecx
jc @f ;<
movzx edi, [xlen]
lea edi, [edi-4]
mov ecx, eax
inc esi
@@:
mov eax, edx
call strcpy
mov [ebx+ecx], byte 0x00
xor eax, eax
mov ax, [xlen]
sub eax, 4
pop ecx
mov dword [ebx+eax], ecx ; <EFBFBD>®á«¥¤­¨¥ 4 <EFBFBD> ©â  á 梥⮬
xor eax, eax
mov al, [ind]
cmp ax, [ylen]
jz @f
inc al
jmp ..fin
@@:
xor al, al
..fin:
mov [ind], al
mov ebx, ecx ; 梥â
mov eax, edx ; 㪠§ â¥«ì ­  áâபã
cmp esi, 0
jnz wm_loop
call printbuff
popad
ret
;
;
; <--EAX <EFBFBD>¥à¥¢®¤ ¨§ 16 ¢ 10 ä®à¬ã
; -->[ebx] áâப 
; --> eax ¤«¨­ 
int2strd:
pushf
;push ebx
push ecx
push edx
push esi
;push edi
;xor ebx, ebx
xor ecx, ecx
mov esi, 10
id_loop:
xor edx, edx
div esi
and dl, 0fh ;Žâ¤¥«¨âì ¬« ¤è¨¥ 4 ¡¨â 
or dl, 0x30
mov [ebx+ecx], dl
cmp eax, 10
inc ecx
jnc id_loop
and al, 0fh ;Žâ¤¥«¨âì ¬« ¤è¨¥ 4 ¡¨â 
or al, 0x30
mov [ebx+ecx], al
;mov [ebx+ecx+1], byte 0
inc ecx
mov eax, ecx
; ¯¥à¥¢¥à­ãâì ¯®«ã祭­ãî áâபã
;
;xor edx, edx
;mov esi, 2
;div esi
shr eax, 1
xor edx, edx
id_loop2:
cmp eax, 0
jz id_end
mov dl, [ebx+eax-1]
lea esi, [ebx+ecx]
sub esi, eax
mov dh, [esi]
mov [ebx+eax-1], dh
mov [esi], dl
dec eax
jmp id_loop2
id_end:
mov eax, ecx
;pop edi
pop esi
pop edx
pop ecx
;pop ebx
popf
ret
;
;
;
x_bb dw 550 ; Š®®à¤¨­ âë «¥¢®£® ¢¥àå­¥£® 㣫 
y_bb dw 30 ;
;
bb_width dw 100 ; ˜¨à¨­  ª­®¯®ª
bb_height dw 12 ; ¢ëá®â  ª­®¯®ª
;
bb_dist dw 6 ; <EFBFBD> ááâ®ï­¨¥ ¬¥¦¤ã ª­®¯ª ¬¨
; ˆ¤¥­â¨ä¨ª â®àë ª­®¯®ª ­ ç¨­ ï á 100
;
; „«ï Š‹
;
;
buttonbox:
pushad
pushf
xor ecx, ecx
xor eax, eax
xor ebx, ebx
bb_loop:
; <EFBFBD>஢¥à塞 ¯¥à¢ë© ¡ ©â 㨭 , ¥á«¨ 0, ª­®¯ªã à¨á®¢ âì ­¥ ­ ¤®
;mov ebx, NAME_LEN
;imul ebx, ecx
;mov al, [names+ebx]
;cmp al, 0
;jz bb_end
mov ebx, UIN_LEN
imul ebx, ecx
mov al, [uins + ebx]
cmp al, 0
jz bb_end
; à¨á㥬 ª­®¯ªã
; –¢¥â § ¢¨á¨â ®â áâ âãá  UIN
mov ebx, 4
imul ebx, ecx
mov eax, [stats+ebx] ; áâ à襬 á«®¢¥ ¤®¯®«­¨â¥«ì­ë© áâ âãá
cmp ax, -1
jz bb_offline
cmp ax, 1
jz bb_away
cmp ax, 2
jz bb_dnd
cmp ax, 4
jz bb_na
cmp ax, 10h
jz bb_bisy
cmp ax, 20h
jz bb_free4chat
cmp ax, 100h
jz bb_invis
; Online
mov esi, 0x4466AA
jmp bb_dr
bb_offline:
mov esi, 0xBEBEBE
jmp bb_dr
bb_away:
mov esi, 0x14dcc3
jmp bb_dr
bb_dnd:
mov esi, 0x14dcc3
jmp bb_dr
bb_na:
mov esi, 0x14dcc3
jmp bb_dr
bb_bisy:
mov esi, 0x14dcc3
jmp bb_dr
bb_free4chat:
mov esi, 0x2233FF
jmp bb_dr
bb_invis:
mov esi, 0xD0D0D0
bb_dr:
mov bx, [x_bb]
shl ebx, 16
mov bx, [bb_width]
;push ecx
mov edx, ecx
lea edx, [edx+100] ; ID
mov edi, ecx
mov cx, [y_bb]
movzx eax, [bb_height]
add ax, [bb_dist]
imul eax, edi
add ecx, eax
shl ecx, 16
mov cx, [bb_height]
mov eax, 8
int 40h
;
; <EFBFBD> ¤¯¨áì ­  ª­®¯ª¥
;
add ebx, 50000h ; ‘¬¥é¥­¨¥ ®â «¥¢®£® ªà ï
shr ecx, 16
movzx eax, [bb_height]
shr eax, 1 ; /2
sub eax, 3 ; ᬥ饭¨¥ ¢¢¥àå ®â 業âà 
add ecx, eax ; + ¯®«®¢¨­  à §¬¥à  ª­®¯ª¨
mov bx, cx
mov ecx, 0x80FFFFFF ; –¢¥â
mov edx, names
mov esi, NAME_LEN
imul esi, edi
add edx, esi
;mov esi, -1
mov eax, 4
int 40h
mov ecx, edi
inc ecx
cmp ecx, UINS
ja bb_end
jmp bb_loop
bb_end:
popf
popad
ret
;
; Œ áᨢ á UIN
;
UIN_LEN = 11 ; „«¨­ 
UINS = 22 ; Š®«¨ç¥á⢮
;
uins db UIN_LEN*UINS dup 0
;
; ¬ áᨢ á® áâ âãá ¬¨
;
stats dd UINS dup -1
;
; Œ áᨢ á ¨¬¥­ ¬¨
;
NAME_LEN = 30
names db NAME_LEN*UINS dup 0
;
;
U1 db '405577261',0
U2 db '455395049',0
U3 db '488118046',0
;
; ‡ £à㧪  ¬ áᨢ  UIN
;
; FIXME ¡ã¤¥â 㤠«¥­ 
loaduin:
pushad
mov eax, U1
mov ebx, uins
mov ecx, 9
call strcpy
mov ebx, names
call strcpy
mov eax, U2
mov ebx, uins+UIN_LEN
mov ecx, 9
call strcpy
mov ebx, names+NAME_LEN
call strcpy
mov eax, U3
mov ebx, uins+UIN_LEN*2
mov ecx, 9
call strcpy
mov ebx, names+NAME_LEN*2
call strcpy
popad
ret
;
; ”ã­ªæ¨ï ¤«ï § £à㧪¨ Š‹ ­¨ª ¬¨ ¨ áâ âãá ¬¨
; eax <-- <EFBFBD>®¬¥à 㨭  ¯® ¯®à浪㠢 ¬ áᨢ¥ uins, ­ ç¨­ ï á 0
; [ebx] <-- 㪠§ â¥«ì ­  null-terminated áâபã á ­®¢ë¬ ¨¬¥­¥¬
; ecx <-- <EFBFBD>®¢ë© áâ âãá
;
loadbb:
pushad
pushf
;
; <EFBFBD>஢¥à塞 ­®¬¥à
;
cmp eax, UINS
jnc loadbb_end ;>=
;
; “¤ «ï¥¬ ª­®¯ªã
;
push ecx
push ebx
push eax
lea edx, [eax+100]
or edx, 0x80000000
mov eax, 8
int 40h
;
; ‘®å࠭塞 ­®¢ë© áâ âãá ¢ ¬ áᨢ¥ áâ âãᮢ
;
pop eax
mov edx, 4 ; DWORD
imul edx, eax
mov [stats+edx], ecx
;
; ‘®å࠭塞 ­®¢®¥ ¨¬ï
;
mov edi, eax ; edi <-- Uin number
pop eax ; <-- offset of string
mov ebx, eax
call strlen
mov ecx, eax ; Len
mov eax, ebx ;Source
mov edx, NAME_LEN
imul edx, edi
lea ebx, [names+edx] ; Dest
call strcpy
mov [names+edx+ecx], byte 0
xchg edi, eax ; eax - áç¥â¨ª, edi - 㪠§ â¥«ì ­  áâபã
pop ecx
push edi
; à¨á㥬 ª­®¯ªã
; –¢¥â § ¢¨á¨â ®â áâ âãá  UIN
cmp cx, -1
jz l_offline
cmp cx, 1
jz l_away
cmp cx, 2
jz l_dnd
cmp cx, 4
jz l_na
cmp cx, 10h
jz l_bisy
cmp cx, 20h
jz l_free4chat
cmp cx, 100h
jz l_invis
; Online
mov esi, 0x4466AA
jmp l_dr
l_offline:
mov esi, 0xBEBEBE
jmp l_dr
l_away:
mov esi, 0x14dcc3
jmp l_dr
l_dnd:
mov esi, 0x14dcc3
jmp l_dr
l_na:
mov esi, 0x14dcc3
jmp l_dr
l_bisy:
mov esi, 0x14dcc3
jmp l_dr
l_free4chat:
mov esi, 0x2233FF
jmp l_dr
l_invis:
mov esi, 0xD0D0D0
l_dr:
mov bx, [x_bb]
shl ebx, 16
mov bx, [bb_width]
;push ecx
mov edx, eax
lea edx, [edx+100] ; ID
mov edi, eax
mov cx, [y_bb]
movzx eax, [bb_height]
add ax, [bb_dist]
imul eax, edi
add ecx, eax
shl ecx, 16
mov cx, [bb_height]
mov eax, 8
int 40h
;
; <EFBFBD> ¤¯¨áì ­  ª­®¯ª¥
;
add ebx, 50000h ; ‘¬¥é¥­¨¥ ®â «¥¢®£® ªà ï
shr ecx, 16
movzx eax, [bb_height]
shr eax, 1 ; /2
sub eax, 3 ; ᬥ饭¨¥ ¢¢¥àå ®â 業âà 
add ecx, eax ; + ¯®«®¢¨­  à §¬¥à  ª­®¯ª¨
mov bx, cx
mov ecx, 0x80FFFFFF ; –¢¥â
pop edx
mov esi, -1
mov eax, 4
int 40h
loadbb_end:
popf
popad
ret
;
;
; Žâ« ¤®ç­ ï äã­ªæ¨ï - ¢ë¢®¤¨â ®¡« áâì ¯ ¬ïâ¨
; EAX - 㪠§ â¥«ì ­  ®¡« áâì
; EBX - ª®«¨ç¥á⢮ ¡ ©â
;
print_mem:
push eax
push ebx
push ecx
push edx
push esi
xor ecx, ecx
xor esi, esi
pm_loop:
cmp ecx, ebx
jz pm_exit
mov dl, [eax + ecx]
shr dl, 4 ;‘¤¢¨­ãâì ­  4 à §à鸞 ¢¯à ¢®
cmp dl, 0x0A
jnb pm_chars
or dl, 0x30
jmp pm_write
pm_chars:
add dl, 0x37
pm_write:
mov [membuff + esi], dl
inc esi
;
;
mov dl, [eax + ecx]
and dl, 0x0F
cmp dl, 0x0A
jnb pm_chars2
or dl, 0x30
jmp pm_write2
pm_chars2:
add dl, 0x37
pm_write2:
mov [membuff + esi], dl
inc esi
mov [membuff + esi], 0x20
inc esi
cmp esi, MEMBUFF_SIZE - 2
jb pm_nwrite
;
; ¢ë¢¥á⨠¡ãä¥à
mov [membuff + esi], byte 0
push eax
push ebx
mov eax, membuff
xor ebx, ebx
xor esi, esi
call writemsg
pop ebx
pop eax
pm_nwrite:
inc ecx
jmp pm_loop
pm_exit:
mov [membuff + esi], byte 0
mov eax, membuff
xor ebx, ebx
xor esi, esi
call writemsg
pop esi
pop edx
pop ecx
pop ebx
pop eax
ret

View File

@ -1,3 +0,0 @@
MEMBUFF_SIZE = (16 * 3 + 1)
membuff db MEMBUFF_SIZE dup 0

View File

@ -1 +0,0 @@
__CPU_type fix p5

View File

@ -1,597 +0,0 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ;
; DIALOGS1.INC ;
; ;
; COMPILE WITH FASM for MENUET ;
; ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
menus dd 3 ; number of menus
m_x dd 0x5 ; x start
m_y dd 20 ; y start
m_xs dd 290 ; x size
m_ys dd 14 ; y size
g_stack dd 0xf000 ; thread stack - required
menu:; AB C D E F G
db '*D FILE +Save File +Load File +- +Quit '
db '*B EDIT +Copy +Paste '
db '*B HELP +Setup +About.. '
db '@' ; end mark
; A : Data type '*' -> New menu , '+' -> menu selection
; B : Number of selections in menu (A+)
; C : Menu header text
; D-G : Menu selection text
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; DATA BELOW IS FOR DIALOGS1.INC INTERNALS
menu_action dd '----'
window_on db 0
g_n dd -1
g_x dd 0x0
g_t dd 0x0
g_1 dd 0x0
g_l dd 0x0
closet db 0
table: times 1024 db 0
last_mouse dd 0x0
mo_x dd 0x0
mo_y dd 0x0
check_mouse:
pusha
cmp [window_on],1
je no_open
mov eax,37
mov ebx,2
int 0x40
cmp [window_on],0
jne openw2
cmp eax,0
je no_open
openw2:
waitformouse:
mov eax,23
mov ebx,2
int 0x40
cmp eax,0
jne no_open
mov eax,37
mov ebx,2
int 0x40
cmp eax,0
jne waitformouse
mov eax,37
mov ebx,1
int 0x40
mov esi,eax
shr eax,16
xor edx,edx
mov ebx,50
div ebx
mov edx,eax
cmp edx,[g_n]
je no_open
cmp edx,[menus]
jge no_open
mov eax,esi
and eax,0xffff
mov ebx,[m_y]
cmp eax,ebx
jbe no_open
add ebx,[m_ys]
cmp eax,ebx
jge no_open
cmp [window_on],0
je noww
mov [closet],1
mov ecx,100
waitm:
mov eax,5
mov ebx,1
int 0x40
dec ecx
jz no_open
cmp [window_on],0
jne waitm
noww:
mov eax,edx
jmp cll
no_open:
mov [last_mouse],esi
popa
ret
cll:
mov [window_on],2
mov [g_n],eax
mov [g_x],96
mov [g_t],0
mov [g_1],1
mov eax,9
mov ebx,table
mov ecx,-1
int 0x40
mov eax,[table+34]
mov [mo_x],eax
mov eax,[table+38]
mov [mo_y],eax
mov eax,51
mov ebx,1
mov ecx,alert_entry
mov edx,[g_stack]
int 0x40
mov [esp+28],dword 0 ; clear button entry
mov [menu_action],'MD '
check_gr:
popa
ret
draw_menu:
mov eax,9
mov ebx,table
mov ecx,-1
int 0x40
cmp [table+46],dword 30
jb drmr
mov eax,13 ; white background
mov ebx,[m_x]
shl ebx,16
add ebx,[m_xs]
inc ebx
mov ecx,[m_y]
shl ecx,16
add ecx,[m_ys]
mov edx,0xf0f8ff
int 0x40
mov eax,38 ; egde lines
mov ebx,[m_x]
shl ebx,16
add ebx,[m_x]
add ebx,[m_xs]
mov ecx,[m_y]
shl ecx,16
add ecx,[m_y]
mov edx,0x000000
int 0x40
mov eax,38
mov ecx,[m_y]
add ecx,[m_ys]
shl ecx,16
add ecx,[m_y]
add ecx,[m_ys]
int 0x40
mov esi,menu-1
mov edi,[m_x]
mov ebp,1
new_menu:
inc esi
cmp [esi],byte '*'
jne drmnl1
push esi
mov eax,4
mov ebx,edi
shl ebx,16
add ebx,[m_y]
add ebx,0x00050004
mov ecx,0x000000
mov edx,esi
add edx,3
mov esi,12
int 0x40 ; draw text
pop esi
add esi,2
add edi,50
inc ebp
drmnl1:
cmp [esi],byte '@'
jne new_menu
drmr:
ret
alert_box:
; eax : x size - min 200
; ebx : pointer to ASCIIZ - max 128 character text
; ecx : button 1 id ( OK or YES )
; edx : button 2 id or zero ( NO )
cmp [window_on],0
jne alert_box_return
mov [window_on],1
cmp eax,100
jg size_ok
mov eax,100
size_ok:
mov [g_x],eax
mov [g_t],ebx
mov [g_1],ecx
mov ecx,0
new_search:
cmp [ebx],byte 0
je found_len
inc ebx
inc ecx
cmp ecx,128
jbe new_search
found_len:
mov [g_l],ecx
mov eax,51
mov ebx,1
mov ecx,alert_entry
mov edx,[g_stack]
int 0x40
mov [menu_action],'MA '
alert_box_return:
ret
alert_entry:
call alert_draw_window
alert_still:
mov eax,23 ; wait here for event
mov ebx,1
int 0x40
cmp eax,1 ; redraw request ?
je alert_red
cmp eax,2 ; key in buffer ?
je alert_key
cmp eax,3 ; button in buffer ?
je alert_button
cmp [closet],0
jne ccc
mov eax,9
mov ebx,table
mov ecx,-1
int 0x40
cmp ax,[table+4]
je no_close
ccc:
mov [closet],0
mov [g_n],-1
mov [menu_action],'----'
mov [window_on],0
mov eax,-1
int 0x40
no_close:
jmp alert_still
alert_red: ; redraw
call alert_draw_window
jmp alert_still
alert_key: ; key
mov eax,2 ; just read it and ignore
int 0x40
jmp alert_still
alert_button: ; button
mov eax,17 ; get id
int 0x40
shr eax,8
cmp eax,3
jg no_action1
dec eax
shl eax,2
mov eax,dword [eax+rtext]
mov [menu_action],eax
jmp action_done
no_action1:
sub eax,16
add eax,65
shl eax,8
mov ebx,[g_n]
add ebx,65
add eax,ebx
mov [menu_action],eax
action_done:
mov [closet],0
mov [g_n],-1
mov [window_on],0
mov eax,-1 ; close this program
int 0x40
rtext db 'NO YES OK '
jmp alert_still
; *********************************************
; ******* WINDOW DEFINITIONS AND DRAW ********
; *********************************************
alert_draw_window:
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,1 ; 1, start of draw
int 0x40
cmp [window_on],2
jne no_win_type_2
mov edx,menu-1
mov ecx,[g_n]
add ecx,1
find_menu:
inc edx
cmp [edx],byte '*'
je menu_loop
jmp find_menu
menu_loop:
loop find_menu
movzx ebp,byte [edx+1]
sub ebp,64
push edx
; DRAW WINDOW
mov eax,0 ; function 0 : define and draw window
mov ebx,[g_n]
imul ebx,50
add ebx,[mo_x]
add ebx,[m_x]
shl ebx,16
add ebx,[g_x]
mov ecx,[mo_y]
add ecx,[m_y]
add ecx,[m_ys]
shl ecx,16
mov edx,14
imul edx,ebp
add edx,7
add ecx,edx
mov edx,0x00ffffff ; color of work area RRGGBB,8->color gl
mov esi,0x00ffffff ; color of grab bar RRGGBB,8->color gl
mov edi,0x000000cc ; color of frames RRGGBB
int 0x40
pop edx
mov ebx,5*65536+7 ; draw info text with function 4
mov ecx,0x10000000
mov esi,12
mov ebp,16
no_d_found:
inc edx
cmp [edx],byte '*'
je d_drawed
cmp [edx],byte '@'
je d_drawed
cmp [edx],byte '+'
jne no_d_found
inc edx
pusha ; draw button
mov eax,8
mov ecx,ebx
mov ebx,[g_x]
add ebx,0x0000fffe
shl ecx,16
add ecx,0xfffc0000+14
mov edx,0x40000000
add edx,ebp
mov esi,0
int 0x40
popa
mov eax,4 ; draw text
int 0x40
inc ebp
add ebx,14
jmp no_d_found
d_drawed:
no_win_type_2:
cmp [window_on],1
jne no_win_1
mov eax,14 ; to middle of screen
int 0x40
mov ecx,eax
and ecx,0xffff
shr ecx,1
shr eax,1
mov ebx,[g_x]
shr ebx,1
shl ebx,16
sub eax,ebx
mov ebx,eax
mov eax,0 ; function 0 : define and draw window
mov bx,word [g_x]
sub ecx,80
shl ecx,16
mov cx,110 ; [y start] *65536 + [y size]
mov edx,0x02ffffff ; color of work area RRGGBB,8->color gl
mov esi,0x80d05050 ; color of grab bar RRGGBB,8->color gl
mov edi,0x00d05050 ; color of frames RRGGBB
int 0x40
mov eax,4 ; label
mov ebx,8*65536+8
mov ecx,0x10ddeeff
mov edx,alert_labelt1
mov esi,alert_label1len-alert_labelt1
int 0x40
mov eax,4
mov ebx,10*65536+43
mov ecx,0x10000000
mov edx,[g_t]
mov esi,[g_l]
int 0x40
cmp [g_1],1
jne gadgets_no_1
mov eax,8
mov ebx,[g_x]
sub ebx,100
shr ebx,1
shl ebx,16
add ebx,30*65536+40
mov ecx,75*65536+16
mov edx,3
mov esi,0x446688
int 0x40
mov eax,4
mov ebx,[g_x]
sub ebx,100
shr ebx,1
shl ebx,16
add ebx,31*65536+80
mov ecx,0x10ffffff
mov edx,alert_t2
mov esi,alert_t2len-alert_t2
int 0x40
gadgets_no_1:
cmp [g_1],2
jne gadgets_no_2
mov eax,8
mov ebx,[g_x]
sub ebx,100
shr ebx,1
shl ebx,16
add ebx,0*65536+40
mov ecx,75*65536+16
mov edx,1
mov esi,0x446688
int 0x40
mov eax,8
mov ebx,[g_x]
sub ebx,100
shr ebx,1
shl ebx,16
add ebx,57*65536+40
mov ecx,75*65536+16
mov edx,2
mov esi,0x446688
int 0x40
mov eax,4
mov ebx,[g_x]
sub ebx,100
shr ebx,1
shl ebx,16
add ebx,1*65536+80
mov ecx,0x10ffffff
mov edx,alert_t1
mov esi,alert_t1len-alert_t1
int 0x40
gadgets_no_2:
no_win_1:
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,2 ; 2, end of draw
int 0x40
ret
; DATA AREA
alert_t1:
db ' No Yes'
alert_t1len:
alert_t2:
db ' OK'
alert_t2len:
alert_labelt1:
db 'ALERT'
alert_label1len:

View File

@ -1,121 +0,0 @@
;
;
CP866 db '€<>ƒ„…†‡ˆ‰ŠŒ<E280B9>Ž<EFBFBD><C5BD>“”•˜™šœ<E280BA>žŸ ¡¢£¤¥¦§¨©ª«¬­®¯àáâãäåæçèéêëìíîï'
;
; <EFBFBD>¥à¥ª®¤¨à®¢ª  ¨§ cp1251 ¢ cp866
;
; [eax] <-- Null-terminated string
;
win2dos:
pushad
pushf
xor ebx, ebx
xor ecx, ecx
;xor edx, edx
w2d_loop:
mov bl, [eax+ecx]
cmp bl, 0
jz w2d_end
cmp bl, 0A8h ; ð
jz w2d_yo1
cmp bl, 0B8h ; ñ
jz w2d_yo2
cmp bl, 0C0h ; <EFBFBD>ãááª ï ¡ãª¢ 
jnc w2d_rchar
inc ecx
jmp w2d_loop
w2d_yo1:
mov [eax+ecx], byte 0F0h
inc ecx
jmp w2d_loop
w2d_yo2:
mov [eax+ecx], byte 0F1h
inc ecx
jmp w2d_loop
w2d_rchar:
sub bl, 0C0h
mov bl, [CP866+ebx]
mov [eax+ecx], bl
inc ecx
jmp w2d_loop
w2d_end:
popf
popad
ret
CP1251 db 'ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ'
;
; <EFBFBD>¥à¥ª®¤¨à®¢ª  ¨§ CP866 ¢ CP1251
; [eax] <-- Null termainated string
;
dos2win:
pushf
pushad
xor ebx, ebx
xor ecx, ecx
dec ecx
d2w_loop:
inc ecx
mov bl, [eax+ecx]
cmp bl, 0
jz d2w_end
cmp bl, 80h
jnc d2w_rchar
;inc ecx
jmp d2w_loop
d2w_yo1:
mov byte [eax+ecx], 0A8h
;inc ecx
jmp d2w_loop
d2w_yo2:
mov byte [eax+ecx], 0B8h
;inc ecx
jmp d2w_loop
d2w_rchar:
cmp bl, 0B0h
jnc d2w_rchar2
sub bl, 80h
mov bl, [CP1251+ebx]
mov [eax+ecx], bl
jmp d2w_loop
d2w_rchar2:
cmp bl, 0E0h
jc d2w_loop
cmp bl, 0F0h
jz d2w_yo1
cmp bl, 0F1h
jz d2w_yo2
cmp bl, 0F2h
jnc d2w_loop
add bl, 10h
mov [eax+ecx], bl
jmp d2w_loop
d2w_end:
popad
popf
ret

View File

@ -1,275 +0,0 @@
; SEE YOU File FAQ.txt and HISTORY. Good Like!
;;;;;;;;;;;;;;;;;;
include 'editbox.mac' ;¬ ªà®á ª®â®àë© ¤®«¦¥­ ®¡«¥£ç¨âì ¦¨§­ì :) ᯥ樠«ì­® ¤«ï editbox
;;;;;;;;;;;;;;;;;;
macro use_edit_box procinfo,scr_h,scr_w
{
edit_box:
ed_width equ [edi] ;è¨à¨­  ª®¬¯®­¥­â 
ed_left equ [edi+4] ;¯®«®¦¥­¨¥ ¯® ®á¨ å
ed_top equ [edi+8] ;¯®«®¦¥­¨¥ ¯® ®á¨ ã
ed_color equ [edi+12] ;梥â ä®­  ª®¬¯®­¥­â 
shift_color equ [edi+16] ;=0x6a9480
ed_focus_border_color equ [edi+20] ;梥â à ¬ª¨ ª®¬¯®­¥­â 
ed_blur_border_color equ [edi+24] ;梥⠭¥  ªâ¨¢­®£® ª®¬¯®­¥­â 
ed_text_color equ [edi+28] ;梥â ⥪áâ 
ed_max equ [edi+32] ;ª®«-¢® ᨬ¢®«®¢ ª®â®àë¥ ¬®¦­® ¬ ªá¨¬ «ì­® ¢¢¥áâ¨
ed_text equ [edi+36] ;㪠§ â¥«ì ­  ¡ãä¥à
ed_flags equ [edi+40] ;ä« £¨
ed_size equ [edi+42] ;ª®«-¢® ᨬ¢®«®¢
ed_pos equ [edi+46] ;¯®§¨æ¨ï ªãàá®à 
ed_offset equ [edi+50] ;ᬥ饭¨¥
cl_curs_x equ [edi+54] ;¯à¥¤ë¤ã饥 ª®®à¤¨­ â  ªãàá®à  ¯® å
cl_curs_y equ [edi+58] ;¯à¥¤ë¤ã饥 ª®®à¤¨­ â  ªãàá®à  ¯® ã
ed_shift_pos equ [edi+62] ;¯®«®¦¥­¨¥ ªãàá®à 
ed_shift_pos_old equ [edi+66] ;áâ à®¥ ¯®«®¦¥­¨¥ ªãàá®à 
;==========================================================
;=== ¯à®æ¥¤ãà  ¯à®à¨á®¢ª¨ =================================
;==========================================================
.draw:
pusha
;--- à¨á㥬 à ¬ªã ---
call .draw_border ; ”ã­ªæ¨ï áâ ¡¨«ì­ 
.draw_bg_cursor_text:
;--- ¨§¬¥­ï¥¬ ᬥ饭¨¥, ¥á«¨ ­ ¤® ---
call .check_offset ;¢ëç¨á«¥­¨¥ ¯®§¨æ¨¨ ªãàá®à  áâ ¡¨«ì­ 
;--- à¨á㥬 ¢­ãâ७­îî ®¡« áâì ---
call .draw_bg ;­ à¨á®¢ âì ¯àאַ㣮«ì­¨ª à ¡®ç¥© ®¡« áâ¨
;---- à¨á㥬 ¢ë¤¥«¥­¨¥, ¯® shift ¥á«¨ ¥áâì
call .draw_shift
.draw_cursor_text:
;--- à¨á㥬 ªãàá®à ---
;--- ¬®¦¥â ¥£® ­¥ ­ ¤® à¨á®¢ âì ----
test word ed_flags,ed_focus
je @f
call .draw_cursor
@@:
call .draw_text
;;;;;;;;;;;;;;;;;;;;;;;;;;
;Ž¡é¨© ¢ë室 ¨§ editbox ¤«ï ¢á¥å ä㭪権 ¨ ¯®áâ ®¡à ¡®â稪®¢
;;;;;;;;;;;;;;;;;;;;;;;;;;
.editbox_exit:
edit_ex
;==========================================================
;=== ®¡à ¡®âª  ª« ¢¨ âãàë =================================
;==========================================================
.key:
pusha
test word ed_flags,ed_focus ; ¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬
je .editbox_exit
;<EFBFBD>஢¥àª  ­ ¦ â shift ?
call .check_shift
;----------------------------------------------------------
;--- ¯à®¢¥à塞, çâ® ­ ¦ â® --------------------------------
;----------------------------------------------------------
use_key_process backspase,delete,left,right,home,end,insert
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;‡ £«ã誠 ­  ®¡à ¡®âªã ª« ¢¨è ¢¢¥àå ¨ ¢­¨§ â.¥. ¯à¨ ®¡­ à㦥­¨¨ íâ¨å ª®¤®¢ ¯à®¨á室¨â ¢ë室 ¨§ ®¡à ¡®â稪 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
use_key_no_process up,down,esc
;--- ­ ¦ â  ¤àã£ ï ª« ¢¨è  ---
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;<EFBFBD>஢¥àª  ãáâ ­®¢«¥­ «¨ ä« £ ¯à¨ ª®â®à®¬ ­ã¦­® ¢ë¢®¤¨âì ⮫쪮 æ¨äàë ¢ ­ã¦­®¬ ¡®ªá¥ ¥á«¨ â ª®©­¥®¡å®¤¨¬®á⨠­¥â ­ã¦­® § ª®¬¥­â¨à®¢ âì ¬ ªà®á
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
use_key_figures_only
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;¯à®¢¥àª  ­  shift ¡ë« «¨ ­ ¦ â
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
are_key_shift_press
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ¯à®¢¥à塞, ­ å®¤¨âáï «¨ ªãàá®à ¢ ª®­æ¥ + ¤ «ì­¥©è ï ®¡à ¡®âª 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
are_key_cur_end
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Ž¡à ¡®âª  ª« ¢¨è insert,delete.backspase,home,end,left,right
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
use_work_key
;==========================================================
;=== ®¡à ¡®âª  ¬ëè¨ =======================================
;==========================================================
.mouse:
pusha
;debug
;----------------------------------------------------------
;--- ¯®«ãç ¥¬ á®áâ®ï­¨¥ ª­®¯®ª ¬ëè¨ -----------------------
;----------------------------------------------------------
mcall 37,2
;----------------------------------------------------------
;--- ¯à®¢¥à塞 á®áâ®ï­¨¥ ----------------------------------
;----------------------------------------------------------
test eax,1
jnz .mouse_left_button
and word ed_flags,ed_mouse_on_off
xor ebx,ebx
mov dword [mouse_flag],ebx
jmp .editbox_exit
.mouse_left_button:
;----------------------------------------------------------
;--- ¡«®ª¨à®¢ª  ®â 䮪ãá¨à®¢ª¨ ¢ ¤àã£¨å ¡®ªá å ¯à¨ ¯®¯ ¤ ­¨¨ ­  ­¨å ªãàá®à 
;----------------------------------------------------------
mov eax,dword [mouse_flag]
test eax,eax
jz @f
cmp eax,edi
je @f
jmp ._blur
;----------------------------------------------------------
;--- ¯®«ãç ¥¬ ª®®à¤¨­ âë ¬ëè¨ ®â­®á¨â¥«ì­® 0 â.¥ ¢á¥© ®¡« á⨠íªà ­ 
;----------------------------------------------------------
@@: mcall 37,0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;”ã­ªæ¨ï ®¡à ¡®âª¨ ¬ë誨 ¯®«ã祭¨¥ ª®®à¤¨­ â ¨ ¯à®¢¥àª  ¨å + ¢ë¤¥«¥­¨ï
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
use_work_mause scr_h,scr_w
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Ž¡é¨¥ ä㭪樨 ®¡à ¡®âª¨
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
use_general_func
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;”㭪樨 ¤«ï à ¡®âë á key
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
use_key_func
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;”㭪樨 ¤«ï à ¡®âë á mouse
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
use_mouse_func scr_w
}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Bit mask from editbox
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ed_figure_only= 1000000000000000b ;®¤­¨ ᨬ¢®«ë
ed_always_focus= 100000000000000b
ed_focus= 10b ;䮪ãá ¯à¨«®¦¥­¨ï
ed_shift_on= 1000b ;¥á«¨ ­¥ ãáâ ­®¢«¥­ -§­ ç¨â ¢¯¥à¢ë¥ ­ ¦ â shift,¥á«¨ ¡ë« ãáâ ­®¢«¥­, §­ ç¨â ¬ë 㦥 çâ® - â® ¤¥« «¨ 㤥ন¢ ï shift
ed_shift_on_off=1111111111110111b
ed_shift= 100b ;¢ª«îç ¥âáï ¯à¨ ­ ¦ â¨¨ ­  shift â.¥. ¥á«¨ ­ ¦¨¬ î
ed_shift_off= 1111111111111011b
ed_shift_bac= 10000b ;¡¨â ¤«ï ®ç¨á⪨ ¢ë¤¥«¥­®£® shift â.¥. ¯à¨ ãáâ ­®¢ª¥ £®¢®à¨â çâ® ¥áâì ¢ë¤¥«¥­¨¥
ed_shift_bac_cl=1111111111101111b ;®ç¨á⪠ ¯à¨ 㤠«¥­¨¨ ¢ë¤¥«¥­¨ï
ed_shift_cl= 1111111111100011b
ed_shift_mcl= 1111111111111011b
ed_left_fl= 100000b
ed_right_fl= 1111111111011111b
ed_offset_fl= 1000000b
ed_offset_cl= 1111111110111111b
ed_insert= 10000000b
ed_insert_cl= 1111111101111111b
ed_mouse_on = 100000000b
ed_mous_adn_b= 100011000b
ed_mouse_on_off=1111111011111111b
ed_height=14 ; ¢ëá®â 
macro draw_edit_boxes start,_end,use_f9,procinfo
{
if use_f9 eq
else
mcall 9,procinfo,-1
end if
mov edi,start
mov ecx,((_end-start)/ed_struc_size)
@@:
call edit_box.draw
add edi,ed_struc_size
loop @b
}
macro mouse_edit_boxes start,_end
{
mov edi,start
mov ecx,((_end-start)/ed_struc_size)
@@:
call edit_box.mouse
add edi,ed_struc_size
loop @b
}
macro key_edit_boxes start,end
{
mov edi,start
mov ecx,((end-start)/ed_struc_size)
@@:
call edit_box.key
add edi,ed_struc_size
loop @b
}
ed_struc_size=70
struc edit_box width,left,top,color,shift_color,focus_border_color,\
blur_border_color,text_color,max,text,flags,size,pos
{
.width dd width
.left dd left
.top dd top
.color dd color
.shift_color dd shift_color
.focus_border_color dd focus_border_color
.blur_border_color dd blur_border_color
.text_color dd text_color
.max dd max
.text dd text
.flags dw flags+0
.size dd size+0
.pos dd pos+0
.offset dd 0
.cl_curs_x dd 0
.cl_curs_y dd 0
.shift dd 0
.shift_old dd 0
}
macro edit_boxes_set_sys_color start,end,color_table
{
mov edi,start
mov ecx,((end-start)/ed_struc_size)
mov esi,color_table
@@:
mov eax,[esi+36]
mov ebx,[esi+20]
mov ed_focus_border_color,eax
shr bh,1
shr bl,1
shr ah,1
shr al,1
add ah,bh
add al,bl
ror eax,16
ror ebx,16
shr bl,1
shr al,1
add al,bl
ror eax,16
mov ed_blur_border_color,eax
add edi,ed_struc_size
loop @b
}
macro draw_edit_box ed_ptr,use_f9,procinfo
{
if use_f9 eq
else
mcall 9,procinfo,-1
end if
mov edi,ed_ptr
call edit_box.draw
}
macro mouse_edit_box ed_ptr
{
mov edi,ed_ptr
call edit_box.mouse
}
macro key_edit_box ed_ptr
{
mov edi,ed_ptr
call edit_box.key
}
macro default_box ed_ptr
{
pusha
; xor eax,eax
; mov ed_shift_pos,eax
; mov ed_shift_pos_old,eax
and word ed_flags,ed_shift_cl
; mov ed_offset,eax
popa
}

File diff suppressed because it is too large Load Diff

View File

@ -1,64 +0,0 @@
redicq:
db 0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,128,0,0,128,0,0,128,0,0,0,0,0
db 128,0,0,128,0,0,128
db 0,0,0,0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,128,0,0,179,0,0,179,0,0,179,0,0,128,0,0
db 179,0,0,179,0,0,179,0,0,128
db 0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,128,0,0,230,0,0,202,0,0,179,0,0,128,0,0
db 230,0,0,202,0,0,179,0,0,128
db 0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,128,0,0,128,0
db 0,128,0,0,179,0,0,202,0,0,230,0,0,128,0,0
db 230,0,0,202,0,0,179,0,0,128,0,0,128,0,0,128
db 0,0,0
db 0,0,128,0,0,179,0,0,179,0
db 0,179,0,0,128,0,0,230,0,0,230,0,0,128,0,0
db 230,0,0,230,0,0,128,0,0,179,0,0,179,0,0,179
db 0,0,128
db 0,0,128,0,0,179,0,0,202,0
db 0,202,0,0,230,0,0,128,0,0,230,0,0,128,0,0
db 230,0,0,128,0,0,230,0,0,202,0,0,202,0,0,179
db 0,0,128
db 0,0,128,0,0,179,0,0,230,0
db 0,230,0,0,230,0,0,230,0,0,128,0,255,255,0,0
db 128,0,0,230,0,0,230,0,0,230,0,0,230,0,0,179
db 0,0,128
db 0,0,0,0,0,128,0,0,128,0
db 0,128,0,0,128,0,0,128,0,255,255,0,255,255,0,255
db 255,0,0,128,0,0,128,0,0,128,0,0,128,0,0,128
db 0,0,0,0,0,128,0,0,179,0,0,179,0
db 0,179,0,0,179,0,0,179,0,0,128,0,255,255,0,0
db 128,0,0,179,0,0,179,0,0,179,0,0,179,0,0,179
db 0,0,128
db 0,0,128,0,0,202,0,0,202,0
db 0,202,0,0,202,0,0,128,0,0,179,0,0,128,0,0
db 179,0,0,128,0,0,230,0,0,202,0,0,202,0,0,179
db 0,0,128
db 0,0,128,0,0,230,0,0,230,0
db 0,230,0,0,128,0,0,202,0,0,179,0,0,128,0,0
db 230,0,0,179,0,0,128,0,0,230,0,0,230,0,0,179
db 0,0,128
db 0,0,0,0,0,128,0,0,128,0
db 0,128,0,0,230,0,0,202,0,0,179,0,0,128,0,0
db 230,0,0,202,0,0,179,0,0,128,0,0,128,0,0,128
db 0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,128,0,0,230,0,0,202,0,0,179,0,0,128,0,0
db 230,0,0,202,0,0,179,0,0,128
db 0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,128,0,0,230,0,0,230,0,0,179,0,0,128,0,0
db 230,0,0,230,0,0,179,0,0,128
db 0,0,0
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
db 0,0,0,0,128,0,0,128,0,0,128,0,0,0,0,0
db 128,0,0,128,0,0,128,0,0,0,0,0,0,0,0,0
db 0,0,0

File diff suppressed because it is too large Load Diff

View File

@ -1,9 +0,0 @@
#
#
#
UIN="123456789"
PASS="PASS"
#
#
ICQIP="64.12.200.89"
#ICQIP="192.168.0.1"

View File

@ -1 +0,0 @@
lang fix en

View File

@ -1,543 +0,0 @@
@^ fix macro comment {
^@ fix }
; -------------------------
macro library [lname,fname]
{
forward
dd __#lname#_library_table__,__#lname#_library_name__
common
dd 0
forward
align 4
__#lname#_library_name__ db fname,0
}
macro import lname,[name,sname]
{
common
align 4
__#lname#_library_table__:
forward
if used name
name dd __#name#_import_name__
end if
common
dd 0
forward
if used name
align 4
__#name#_import_name__ db sname,0
end if
}
macro export [name,sname]
{
forward
dd __#name#_export_name__,name
common
dd 0
forward
align 4
__#name#_export_name__ db sname,0
}
; -------------------------
macro m2m dest,src {
push src
pop dest
}
macro iglobal {
IGlobals equ IGlobals,
macro __IGlobalBlock { }
macro uglobal {
UGlobals equ UGlobals,
macro __UGlobalBlock { }
endg fix } ; Use endg for ending iglobal and uglobal blocks.
macro IncludeIGlobals{
macro IGlobals dummy,[n] \{ __IGlobalBlock
purge __IGlobalBlock \}
match I, IGlobals \{ I \} }
macro IncludeUGlobals{
macro UGlobals dummy,[n] \{
\common
\local begin, size
begin = $
virtual at $
\forward
__UGlobalBlock
purge __UGlobalBlock
\common
size = $ - begin
end virtual
rb size
\}
match U, UGlobals \{ U \} }
uglobal
endg
iglobal
endg
; new application structure
macro meos_app_start
{
use32
org 0x0
db 'MENUET01'
dd 0x01
dd __start
dd __end
dd __memory
dd __stack
if used __params & ~defined __params
dd __params
else
dd 0x0
end if
dd 0x0
}
MEOS_APP_START fix meos_app_start
macro code
{
__start:
}
CODE fix code
macro data
{
__data:
IncludeIGlobals
}
DATA fix data
macro udata
{
if used __params & ~defined __params
__params:
db 0
__end:
rb 255
else
__end:
end if
__udata:
IncludeUGlobals
}
UDATA fix udata
macro meos_app_end
{
align 32
rb 2048
__stack:
__memory:
}
MEOS_APP_END fix meos_app_end
; macro for defining multiline text data
struc mstr [sstring]
{
forward
local ssize
virtual at 0
db sstring
ssize = $
end virtual
dd ssize
db sstring
common
dd -1
}
; macro for defining multiline text data
struc mls [sstring]
{
forward
local ssize
virtual at 0
db sstring ; mod
ssize = $
end virtual
db ssize
db sstring
common
db -1 ; mod
}
; strings
macro sz name,[data] { ; from MFAR [mike.dld]
common
if used name
name db data
.size = $-name
end if
}
macro lsz name,[lng,data] { ; from MFAR [mike.dld]
common
if used name
label name
forward
if lang eq lng
db data
end if
common
.size = $-name
end if
}
macro szc name,elsz,[data] { ; from MFAR [mike.dld]
common
local s,m
m = 0
if used name
label name
forward
virtual at 0
db data
s = $
end virtual
d#elsz s
if m < s
m = s
end if
db data
common
.size = $-name
.maxl = m
end if
}
macro lszc name,elsz,[lng,data] { ; from MFAR [mike.dld]
common
local s,m,c
m = 0
c = 0
if used name
label name
forward
if lang eq lng
virtual at 0
db data
s = $
end virtual
d#elsz s
if m < s
m = s
end if
db data
c = c+1
end if
common
.size = $-name
.maxl = m
.count = c
end if
}
; easy system call macro
macro mpack dest, hsrc, lsrc
{
if (hsrc eqtype 0) & (lsrc eqtype 0)
mov dest, (hsrc) shl 16 + lsrc
else
if (hsrc eqtype 0) & (~lsrc eqtype 0)
mov dest, (hsrc) shl 16
add dest, lsrc
else
mov dest, hsrc
shl dest, 16
add dest, lsrc
end if
end if
}
macro __mov reg,a,b { ; mike.dld
if (~a eq)&(~b eq)
mpack reg,a,b
else if (~a eq)&(b eq)
mov reg,a
end if
}
include 'config.inc'
;__CPU_type equ p5
SYSENTER_VAR equ 0
macro mcall a,b,c,d,e,f { ; mike.dld, updated by Ghost for Fast System Calls
local ..ret_point
__mov eax,a
__mov ebx,b
__mov ecx,c
__mov edx,d
__mov esi,e
__mov edi,f
if __CPU_type eq p5
int 0x40
else
if __CPU_type eq p6
push ebp
mov ebp, esp
push ..ret_point ; it may be 2 or 5 byte
sysenter
..ret_point:
pop edx
pop ecx
else
if __CPU_type eq k6
push ecx
syscall
pop ecx
else
display 'ERROR : unknown CPU type (set to p5)', 10, 13
__CPU_type equ p5
int 0x40
end if
end if
end if
}
; -------------------------
macro header a,[b] {
common
use32
org 0
db 'MENUET',a
forward
if b eq
dd 0
else
dd b
end if }
macro section name { align 16
label name }
macro func name {
if ~used name
display 'FUNC NOT USED: ',`name,13,10
else
align 4
name:
;diff16 `name,0,name
;pushad
;pushfd
;dps `name
;newline
;mcall 5,1
;popfd
;popad
}
macro endf { end if }
macro diff16 title,l1,l2
{
local s,d
s = l2-l1
display title,': 0x'
repeat 8
d = '0' + s shr ((8-%) shl 2) and $0F
if d > '9'
d = d + 'A'-'9'-1
end if
display d
end repeat
display 13,10
}
macro diff10 title,l1,l2
{
local s,d,z,m
s = l2-l1
z = 0
m = 1000000000
display title,': '
repeat 10
d = '0' + s / m
s = s - (s/m)*m
m = m / 10
if d <> '0'
z = 1
end if
if z <> 0
display d
end if
end repeat
display 13,10
}
; optimize the code for size
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
macro add arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
inc arg1
else
add arg1,arg2
end if
else
add arg1,arg2
end if
}
macro sub arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
dec arg1
else
sub arg1,arg2
end if
else
sub arg1,arg2
end if
}
macro mov arg1,arg2
{
if (arg1 in __regs) & ((arg2 eqtype 0) | (arg2 eqtype '0'))
if (arg2) = 0
xor arg1,arg1
else if (arg2) = 1
xor arg1,arg1
inc arg1
else if (arg2) = -1
or arg1,-1
else if (arg2) > -128 & (arg2) < 128
push arg2
pop arg1
else
mov arg1,arg2
end if
else
mov arg1,arg2
end if
}
macro RGB [a] {
common
match (r=,g=,b),a \{
\dd ((r) shl 16) or ((g) shl 8) or (b)
\}
}
struc POINT _t,_dx,_dy {
.x _t _dx
.y _t _dy
}
; structure definition helper
include 'struct.inc'
struct RECT
left dd ?
top dd ?
right dd ?
bottom dd ?
ends
struct BOX
left dd ?
top dd ?
width dd ?
height dd ?
ends
; structures used in MeOS
struct process_information
cpu_usage dd ? ; +0
window_stack_position dw ? ; +4
window_stack_value dw ? ; +6
dw ? ; +8
process_name rb 12 ; +10
memory_start dd ? ; +22
used_memory dd ? ; +26
PID dd ? ; +30
box BOX ; +34
slot_state dw ? ; +50
dw ? ; +52
client_box BOX ; +54
wnd_state db ? ; +70
rb (1024-71)
ends
struct system_colors
frame dd ?
grab dd ?
grab_button dd ?
grab_button_text dd ?
grab_text dd ?
work dd ?
work_button dd ?
work_button_text dd ?
work_text dd ?
work_graph dd ?
ends
struct FILEDATE
Second db ?
Minute db ?
Hour db ?
db ?
Day db ?
Month db ?
Year dw ?
ends
struct FILEINFO
Attributes dd ?
IsUnicode db ?
db 3 dup(?)
DateCreate FILEDATE
DateAccess FILEDATE
DateModify FILEDATE
Size dq ?
ends
; constants
; events
EV_IDLE = 0
EV_TIMER = 0
EV_REDRAW = 1
EV_KEY = 2
EV_BUTTON = 3
EV_EXIT = 4
EV_BACKGROUND = 5
EV_MOUSE = 6
EV_IPC = 7
EV_STACK = 8
; event mask bits for function 40
EVM_REDRAW = 1b
EVM_KEY = 10b
EVM_BUTTON = 100b
EVM_EXIT = 1000b
EVM_BACKGROUND = 10000b
EVM_MOUSE = 100000b
EVM_IPC = 1000000b
EVM_STACK = 10000000b

View File

@ -1,696 +0,0 @@
;
; ‘âàãªâãà  ¤«ï ä㭪樨 70
;
struc sinfo
{
.subfnc_name dd 0
.pos_in_file dd 0
.reserved dd 0
.bytes_to_read dd 0
.pbuffer dd 0
.null db 0
.pname dd 0
}
;
; â ¡«¨æë §­ ç¥­¨©
;
; +----+-------------+-----------------+
; | in | Variable | Variable |
; | de | name | string |
; | x | | |
; | | | |
; +----+-------------+-----------------+
; | | | |
; | | | |
; | 1 | UIN | 'XXXXX..XX',0 |
; | | | |
; +----+-------------+-----------------+
; | | |
;
; § £à㧪  int ¯®ª  ­¥ ॠ«¨§®¢ ­ 
;
; +----+-------------+-----------------+
; | in | Variable | Variable |
; | de | name | int |
; | x | | |
; | | | |
; +----+-------------+-----------------+
; | | | |
; | | | |
; | 1 | BUFFSIZE | XXXXXXXX |
; | | | |
; +----+-------------+-----------------+
; | | |
;
;
TABLE_SIZE equ 16
VNAME_LEN equ 8
VAR_LEN equ 16
;
; Ž¯¨á ­¨¥ â ¡«¨æë §­ ç¥­¨©
virtual at 0
vartable:
.uin db VAR_LEN dup ?
.pass db VAR_LEN dup ?
.icqip db VAR_LEN dup ?
end virtual
;
; Š®¤ë ®è¨¡®ª ä ©«®¢®© á¨á⥬ë
;
FIO_SUCCESS equ 0
FIO_UNSUPPORTED equ 2
FIO_UNKNOWNFS equ 3
FIO_FILENOTFOUND equ 5
FIO_EOF equ 6
FIO_BADPOINTER equ 7
FIO_DISKFULL equ 8
FIO_FATDAMAGED equ 9
FIO_DENIED equ 10
FIO_ERRORDEVICE equ 11
IOBUFF_SIZE equ 128
;
; ¬ ªà®á ¤«ï ¯®¨áª  í«¥¬¥­â  ¢ áâப¥
; ¢®§¢à é ¥â ¢ eax ­®¬¥à í«¥¬¥­â  ¨«¨ -1 ¥á«¨ ­¥ ­ ©¤¥­
macro findchar string, len, char
{
local ..fc_endstr, ..fc_end
push ebx
push ecx
push edi
mov edi, string
mov ecx, len
mov ebx, ecx
cld
mov al, char
repne scasb
jcxz ..fc_endstr
sub ebx, ecx ; <EFBFBD>®¬¥à =
mov eax, ebx
jmp ..fc_end
..fc_endstr:
mov eax, -1
..fc_end:
pop edi
pop ecx
pop ebx
}
;
; Œ ªà®á ¤«ï ¯®¨áª  í«¥¬¥­â  áâப¨, ®â«¨ç î饣®áï ®â
; § ¤ ­­®£®
macro findother string, len, char
{
local ..fc_endstr, ..fc_end
push ebx
push ecx
push edi
mov edi, string
mov ecx, len
mov ebx, ecx
cld
mov al, char
repe scasb ; …᫨ ᨬ¢®« ­¥ char - ¢ë室¨¬
jcxz ..fc_endstr ; áâப  ¨§ char
sub ebx, ecx ; ¢ ebx - ­®¬¥à í«¥¬¥­â  ®â«¨ç­®£® ®â char
mov eax, ebx
jmp ..fc_end
..fc_endstr:
mov eax, -1
..fc_end:
pop edi
pop ecx
pop ebx
}
;
; Œ ªà®á ¤«ï ª®¯¨à®¢ ­¨ï áâப
;
macro mstrcpy from, to, leng
{
push ecx
push esi
push edi
mov ecx, leng
mov esi, from
mov edi, to
cld
rep movsb
pop edi
pop esi
pop ecx
}
;
; ˆ­¨æ¨ «¨§¨àã¥â â ¡«¨æë
;
; inittables:
;
;
; mstrcpy name1, nvtable, VNAME_LEN
; mstrcpy name2, (nvtable + NAME_LEN), VNAME_LEN
; mstrcpy name3, (nvtable + NAME_LEN * 2), VNAME_LEN
;
;
;
; ret
;
; § ¯®«­ï¥â â ¡«¨æë §­ ç¥­¨ï¬¨
; IN eax - ASCIIZ ¨¬ï ä ©« 
; OUT eax - १ã«ìâ â ç⥭¨ï
; ¥á«¨ १ã«ìâ â -1, ä®à¬ â ä ©«  ­¥¯à ¢¨«ì­ë©
;
parseconf:
push edi
push esi
;push eax
push ebx
push ecx
push edx
mov [strnum], dword 0
;
; <EFBFBD>à®ç¨â âì ¯®áâà®ç­® ª®­ä¨£
; ¥á«¨ áâப  ­ ç¨­ ¥âáï á ;, # - ª®¬¬¥­â à¨©
; ”®à¬ â UIN="1234567890"
; PASS="******" ¨ â.¤.
;
; ‘¡à®á ᬥ饭¨ï
mov [shift], dword 0
mov esi, eax
pc_still:
mov edx, esi
mov ecx, IOBUFF_SIZE
mov ebx, iobuff
call getstr
inc [strnum]
push eax
;
;<EFBFBD>஢¥àª  ¯®«ã祭­®© áâப¨
;
movzx eax, byte [iobuff]
test eax, eax
jz pc_next
cmp al, '#'
jz pc_next
cmp al, ';'
jz pc_next
;
; <EFBFBD> ©â¨ ¨¬ï ¯¥à¥¬¥­­®©
;
findother iobuff, ebx, ' '
cmp eax, -1
jz pc_next
mov [stnpos], eax ;­ ç «® ¨¬¥­¨
;
; ­ ©â¨ =
;
mov ecx, ebx ; ˆáª âì ®â ­ ©¤¥­­®£® ᨬ¢®« 
sub ecx, eax ;
mov edi, iobuff
add edi, eax
findchar edi, ecx, '='
cmp eax, -1
jz pc_badformat
mov edi, [stnpos]
add eax, edi ; ¢ eax - ᬥ饭¨¥ ®â ­ ç «  áâப¨
mov [eqpos], eax
mov ecx, ebx
sub ecx, eax
;
; ¯à®¢¥à¨âì "
;
mov dl, [iobuff + eax]
cmp dl, '"'
jnz pc_badformat
;
; ­ ©â¨ § ªà뢠îéãî "
;
mov edi, iobuff
add edi, eax
inc edi
findchar edi, ecx, '"'
cmp eax, -1
jz pc_badformat
inc eax
mov edx, [eqpos]
add eax, edx
mov [edvpos], eax
;
; “áâ ­®¢¨âì §­ ç¥­¨¥
;
; „®¡ ¢¨âì § ¢¥àè î騥 0
mov eax, [stnpos]
dec eax
mov ebx, [eqpos]
mov ecx, ebx
dec ecx ; ª®«¨ç¥á⢮ ᨬ¢®«®¢ ¤® =
inc ebx ; <EFBFBD>யãáâ¨âì "
mov [iobuff + ecx], byte 0
mov edx, [edvpos]
dec edx
mov [iobuff + edx], byte 0
lea eax, [iobuff + eax]
lea ebx, [iobuff + ebx]
call setavar
jmp pc_next
pc_badformat:
pop eax
mov ebx, [strnum]
jmp pc_err
pc_next:
pop eax
cmp eax, FIO_EOF
jz pc_eof
cmp eax, FIO_SUCCESS
jnz pc_err
jmp pc_still
pc_eof:
pc_err:
pop edx
pop ecx
pop ebx
;pop eax
pop esi
pop edi
ret
; <EFBFBD>®¨áª ¢ â ¡«¨æ¥ ¯¥à¥¬¥­­®© ¨ ãáâ ­®¢ª  ¥ñ §­ ç¥­¨ï
; IN eax - ­ §¢ ­¨¥ ¯¥à¥¬¥­­®© 㪠§ â¥«ì ­  ASCIIZ
; IN ebx - §­ ç¥­¨¥ ¯¥à¥¬¥­­®© 㪠§ â¥«ì ­  ASCIIZ
; OUT eax -१ã«ìâ â 0 = OK, -1 = ­¥â ¢ â ¡«¨æ¥ ¯¥à¥¬¥­­ëå
; OUT § ¯®«­ï¥â £«®¡ «ì­ãî â ¡«¨æã
setavar:
;push ebx
push ecx
push edx
push esi
push edi
push ebx
;
; Ž¯à¥¤¥«¨âì ¤«¨­ã áâப¨ - ­ §¢ ­¨¥ ¯¥à¥¬¥­­®©
;
mov edi, eax
push eax
mov ecx, VNAME_LEN
xor eax, eax ;ˆé¥¬ \0
cld
repne scasb
mov eax, VNAME_LEN
sub eax, ecx ; ecx - ®áâ â®ª ¤® ¬ ªá¨¬ «ì­®£® à §¬¥à  áâப¨
mov ebx, eax
pop eax
;
; ˆáª âì ¢ â ¡«¨æ¥ ¯®¤å®¤ï饥 ¨¬ï
;
xor edx, edx ;index
sv_next:
mov ecx, ebx
push eax
mov esi, eax
mov edi, nvtable
mov eax, edx
imul eax, VNAME_LEN ;offset
add edi, eax
pop eax
cld
repe cmpsb
jz sv_match
sv_inc:
inc edx
cmp edx, TABLE_SIZE
jae sv_fail
jmp sv_next
sv_match:
cmp ebx, VNAME_LEN ; ebx - ¤«¨­  ¨á室­®© áâà®çª¨
jz sv_match2
push eax
mov edi, nvtable
mov eax, edx
imul eax, VNAME_LEN ;offset
add edi, eax
pop eax
cmp [edi + ebx], byte 0 ; …᫨ ¨¬ï ¢ â ¡«¨æ¥ ª®à®ç¥ ¬ ªá¨¬ «ì­®£®,
jnz sv_inc ; § ª ­ç¨¢ ¥âáï 0
sv_match2:
pop edi ;
push edi
;
; Ž¯à¥¤¥«ïâì ¤«¨­ã áâப¨ - ¯¥à¥¬¥­­ ï
;
xor eax, eax
mov ecx, VAR_LEN
cld
repne scasb
mov eax, VAR_LEN
sub eax, ecx
mov ecx, eax
mov ebx, eax
;
; Š®¯¨à®¢ âì ¯¥à¥¬¥­­ãî ¢ â ¡«¨æã
;
pop esi
push esi
mov eax, VAR_LEN
imul eax, edx
mov edi, vtable
add edi, eax
cld
rep movsb
;
; …᫨ áâப  ª®à®ç¥ ¯®«ï ¢ â ¡«¨æ¥, § ¯¨á âì ¢ ª®­¥æ 0
;
cmp ebx, VAR_LEN
jz sv_end
mov [edi + ebx], byte 0
sv_end:
xor eax, eax
jmp sv_fin
sv_fail:
mov eax, -1
sv_fin:
pop ebx
pop edi
pop esi
pop edx
pop ecx
;pop ebx
ret
;
; —⥭¨¥ ASCIIZ áâப¨ ¨§ ä ©« 
; IN ebx - 㪠§ â¥«ì ­  ¡ãä¥à
; ecx - à §¬¥à ¡ãä¥à 
; edx - 㪠§ â¥«ì ­  áâப㠨¬ï ä ©« 
; OUT ebx - ¤«¨­  áâப¨
; eax - १ã«ìâ â ç⥭¨ï
getstr:
;push eax
;push ebx
push ecx
push edx
push esi
;xor edx, edx
xor esi, esi
gs_read:
;
; ‡ ¯®«­ï¥¬ áâàãªâãàã
;
mov [finfo.subfnc_name], 0
mov eax, [shift]
mov [finfo.pos_in_file], eax
mov [finfo.bytes_to_read], ecx
mov [finfo.pbuffer], ebx
mov [finfo.pname], edx
push ebx
;
; —¨â¥¬
;
;mov eax, 70
;mov ebx, finfo
;int 40h
mcall 70, finfo
mov ecx, ebx ; ebx ª®«¨ç¥á⢮ ¯à®ç⥭­ëå ¡ ©â
pop ebx
;
; <EFBFBD>஢¥à¨âì १ã«ìâ â ç⥭¨ï - ¥á«¨ ­¥ EOF ¨ 0,
; ¢ë室¨¬
cmp eax, FIO_EOF
jz gs_loop
cmp eax, 0
jz gs_loop
jmp gs_ok
;
; Ž¡à ¡®âª  ¯®«ã祭­®£® ¡«®ª 
;
gs_loop:
mov dl, [ebx + esi]
cmp dl, 0Ah ;cr
jz gs_cr
inc esi
cmp esi, ecx
jnb gs_err
jmp gs_loop
gs_err:
;
; ¡ãä¥à¥ ­¥â ᨬ¢®«  ¯¥à¥­®á  áâப¨, â.¥. áâப  ᫨誮¬ ¤«¨­­ ï
; Žâ¡à á뢠¥¬ ¢á¥ ¤® ¡«¨¦ ©è¥£® ᨬ¢®«  ¯¥à¥­®á  áâப¨
; ¥á«¨ ª®­¥æ ä ©«  - ¢ë室¨¬
cmp eax, FIO_EOF
jz gs_endf
add [shift], ecx
jmp gs_read
gs_endf:
xor ebx, ebx
jmp gs_ok
gs_cr:
;
; ‘¡à®á¨âì १ã«ìâ â ç⥭¨ï
;
xor eax, eax
mov dl, [ebx + esi - 1]
cmp dl, 0Dh ;le
jz gs_le
mov [ebx + esi], byte 0
mov ebx, esi
inc esi
add [shift], esi
jmp gs_ok
gs_le:
mov [ebx + esi - 1], byte 0
mov [ebx + esi], byte 0
lea ebx, [esi - 1]
inc esi
add [shift], esi
gs_ok:
pop esi
pop edx
pop ecx
;pop ebx
;pop eax
ret
;
; ”ã­ªæ¨ï ¤«ï ¢ë¢®¤  § £à㦥­­®© ¨­äë
;
showcfg:
push eax
push ebx
push ecx
push edx
push edi
xor edx, edx ; áç¥â稪
sc_loop:
cmp edx, TABLE_SIZE
jnb sc_end
;
; ‘ª®¯¨à®¢ âì ¢ ¡ãä¥à ¨¬ï ¨ §­ ç¥­¨¥ ¯¥à¥¬¥­­®©
;
mov eax, VNAME_LEN
imul eax, edx
lea eax, [nvtable + eax]
mov cl, [eax]
cmp cl, byte 0
jz sc_next
push eax
call strlen
mov ecx, eax
pop eax
mov ebx, cfgbuff
call strcpy
mov [cfgbuff + ecx], ':'
lea ebx, [cfgbuff + ecx + 1]
mov eax, VAR_LEN
imul eax, edx
lea eax, [vtable + eax]
push eax
call strlen
mov ecx, eax
pop eax
call strcpy
mov [ebx + ecx], byte 0
mov eax, cfgbuff
xor ebx, ebx
call writemsg
sc_next:
inc edx
jmp sc_loop
sc_end:
pop edi
pop edx
pop ecx
pop ebx
pop eax
ret

View File

@ -1,100 +0,0 @@
;
; „ ­­ë¥ ¤«ï parser.inc
;
;
;
; ¨¬ï ä ©« , ª®â®àë© ­ã¦­® ¯ àá¨âì
;
fname db '/sys/ki.cfg',0
;
; â ¡«¨æë §­ ç¥­¨©
;
; +----+-------------+-----------------+
; | in | Variable | Variable |
; | de | name | string |
; | x | | |
; | | | |
; +----+-------------+-----------------+
; | | | |
; | | | |
; | 1 | UIN | 'XXXXX..XX' |
; | | | |
; +----+-------------+-----------------+
; | | |
;
; § £à㧪  int ¯®ª  ­¥ ॠ«¨§®¢ ­ 
;
; +----+-------------+-----------------+
; | in | Variable | Variable |
; | de | name | int |
; | x | | |
; | | | |
; +----+-------------+-----------------+
; | | | |
; | | | |
; | 1 | BUFFSIZE | XXXXXXXX |
; | | | |
; +----+-------------+-----------------+
; | | |
;
;
;nvtable db (TABLE_SIZE * NAME_LEN) dup 0
vtable db (TABLE_SIZE * VAR_LEN) dup 0
finfo sinfo
;
; ‡ ¯®«­¨âì â ¡«¨æã ¨¬¥­ ¯¥à¥¬¥­­ëå
;
nvtable db 'UIN',(VNAME_LEN - 3) dup 0
db 'PASS',(VNAME_LEN - 4) dup 0
db 'ICQIP',(VNAME_LEN - 5) dup 0
db ((TABLE_SIZE - 3) * VNAME_LEN) dup 0
;
; ¤«ï ¨­¨æ¨ «¨§ æ¨¨ â ¡«¨æ
;
;
;
;name1 db 'UIN',(VNAME_LEN - 3) dup 0
;name2 db 'PASS',(VNAME_LEN - 4) dup 0
;name3 db 'ICQIP',(VNAME_LEN - 5) dup 0
;
; <EFBFBD>ãä¥à ¤«ï ¢¢®¤ /¢ë¢®¤ 
;
iobuff db IOBUFF_SIZE dup 0
;
; ‘¬¥é¥­¨¥ ¢ ä ©«¥
;
shift dd 0
;
; <EFBFBD>¥à¥¬¥­­ë¥ ¤«ï åà ­¥­¨ï ­®¬¥à®¢
; ᨬ¢®«®¢ ­ ç «  ¨¬¥­¨ ¯¥à¥¬¥­­®©
; ª®­æ , à ¢­®, ª®­æ  §­ ç¥­¨ï
stnpos dd 0
ednpos dd 0
eqpos dd 0
edvpos dd 0
;
;<EFBFBD>®¬¥à áâப¨ ¤«ï ®¯à¥¤¥«¥­¨ï ®è¨¡®ç­ëå
;
strnum dd 0
;
; <EFBFBD>ãä¥à ¤«ï ¢ë¢®¤  § £à㦥­­®£® ª®­ä¨£ 
;
cfgbuff db (VAR_LEN + VNAME_LEN + 8) dup 0
cfgbuff.len = $ - cfgbuff

View File

@ -1,270 +0,0 @@
; Macroinstructions for defining and calling procedures
macro stdcall proc,[arg] ; directly call STDCALL procedure
{ common
if ~ arg eq
reverse
pushd arg
common
end if
call proc }
macro invoke proc,[arg] ; indirectly call STDCALL procedure
{ common
if ~ arg eq
reverse
pushd arg
common
end if
call [proc] }
macro ccall proc,[arg] ; directly call CDECL procedure
{ common
size@ccall = 0
if ~ arg eq
reverse
pushd arg
size@ccall = size@ccall+4
common
end if
call proc
if size@ccall
add esp,size@ccall
end if }
macro cinvoke proc,[arg] ; indirectly call CDECL procedure
{ common
size@ccall = 0
if ~ arg eq
reverse
pushd arg
size@ccall = size@ccall+4
common
end if
call [proc]
if size@ccall
add esp,size@ccall
end if }
macro proc [args] ; define procedure
{ common
match name params, args>
\{ define@proc name,<params \} }
prologue@proc equ prologuedef
macro prologuedef procname,flag,parmbytes,localbytes,reglist
{ if parmbytes | localbytes
push ebp
mov ebp,esp
if localbytes
sub esp,localbytes
end if
end if
irps reg, reglist \{ push reg \} }
epilogue@proc equ epiloguedef
macro epiloguedef procname,flag,parmbytes,localbytes,reglist
{ irps reg, reglist \{ reverse pop reg \}
if parmbytes | localbytes
leave
end if
if flag and 10000b
retn
else
retn parmbytes
end if }
macro define@proc name,statement
{ local params,flag,regs,parmbytes,localbytes,current
if used name
name:
match =stdcall args, statement \{ params equ args
flag = 11b \}
match =stdcall, statement \{ params equ
flag = 11b \}
match =c args, statement \{ params equ args
flag = 10001b \}
match =c, statement \{ params equ
flag = 10001b \}
match =params, params \{ params equ statement
flag = 0 \}
virtual at ebp+8
match =uses reglist=,args, params \{ regs equ reglist
params equ args \}
match =regs =uses reglist, regs params \{ regs equ reglist
params equ \}
match =regs, regs \{ regs equ \}
match =,args, params \{ defargs@proc args \}
match =args@proc args, args@proc params \{ defargs@proc args \}
parmbytes = $ - (ebp+8)
end virtual
name # % = parmbytes/4
all@vars equ
current = 0
match prologue:reglist, prologue@proc:<regs> \{ prologue name,flag,parmbytes,localbytes,reglist \}
macro locals
\{ virtual at ebp-localbytes+current
macro label def \\{ match . type,def> \\\{ deflocal@proc .,label,<type \\\} \\}
struc db [val] \\{ \common deflocal@proc .,db,val \\}
struc du [val] \\{ \common deflocal@proc .,du,val \\}
struc dw [val] \\{ \common deflocal@proc .,dw,val \\}
struc dp [val] \\{ \common deflocal@proc .,dp,val \\}
struc dd [val] \\{ \common deflocal@proc .,dd,val \\}
struc dt [val] \\{ \common deflocal@proc .,dt,val \\}
struc dq [val] \\{ \common deflocal@proc .,dq,val \\}
struc rb cnt \\{ deflocal@proc .,rb cnt, \\}
struc rw cnt \\{ deflocal@proc .,rw cnt, \\}
struc rp cnt \\{ deflocal@proc .,rp cnt, \\}
struc rd cnt \\{ deflocal@proc .,rd cnt, \\}
struc rt cnt \\{ deflocal@proc .,rt cnt, \\}
struc rq cnt \\{ deflocal@proc .,rq cnt, \\} \}
macro endl
\{ purge label
restruc db,du,dw,dp,dd,dt,dq
restruc rb,rw,rp,rd,rt,rq
current = $-(ebp-localbytes)
end virtual \}
macro ret operand
\{ match any, operand \\{ retn operand \\}
match , operand \\{ match epilogue:reglist, epilogue@proc:<regs>
\\\{ epilogue name,flag,parmbytes,localbytes,reglist \\\} \\} \}
macro finish@proc \{ localbytes = (((current-1) shr 2)+1) shl 2
end if \} }
macro defargs@proc [arg]
{ common
if ~ arg eq
forward
local ..arg,current@arg
match argname:type, arg
\{ current@arg equ argname
label ..arg type
argname equ ..arg
if dqword eq type
dd ?,?,?,?
else if tbyte eq type
dd ?,?,?
else if qword eq type | pword eq type
dd ?,?
else
dd ?
end if \}
match =current@arg,current@arg
\{ current@arg equ arg
arg equ ..arg
..arg dd ? \}
common
args@proc equ current@arg
forward
restore current@arg
common
end if }
macro deflocal@proc name,def,[val]
{ common
match vars, all@vars \{ all@vars equ all@vars, \}
all@vars equ all@vars name
forward
local ..var,..tmp
match =label,def \{ ..tmp equ \}
match tmp,..tmp \{ ..var def val \}
match ,..tmp \{ label ..var val \}
match =?, val \{ ..tmp equ \}
match any =dup (=?), val \{ ..tmp equ \}
match tmp : value, ..tmp : val
\{ tmp: end virtual
initlocal@proc ..var,def value
virtual at tmp\}
common
match first rest, ..var, \{ name equ first \} }
macro initlocal@proc name,def
{ virtual at name
def
size@initlocal = $ - name
end virtual
position@initlocal = 0
while size@initlocal > position@initlocal
virtual at name
def
if size@initlocal - position@initlocal < 2
current@initlocal = 1
load byte@initlocal byte from name+position@initlocal
else if size@initlocal - position@initlocal < 4
current@initlocal = 2
load word@initlocal word from name+position@initlocal
else
current@initlocal = 4
load dword@initlocal dword from name+position@initlocal
end if
end virtual
if current@initlocal = 1
mov byte [name+position@initlocal],byte@initlocal
else if current@initlocal = 2
mov word [name+position@initlocal],word@initlocal
else
mov dword [name+position@initlocal],dword@initlocal
end if
position@initlocal = position@initlocal + current@initlocal
end while }
macro endp
{ purge ret,locals,endl
finish@proc
purge finish@proc
restore regs@proc
match all,args@proc \{ restore all \}
restore args@proc
match all,all@vars \{ restore all \} }
macro local [var]
{ common
locals
forward done@local equ
match varname[count]:vartype, var
\{ match =BYTE, vartype \\{ varname rb count
restore done@local \\}
match =WORD, vartype \\{ varname rw count
restore done@local \\}
match =DWORD, vartype \\{ varname rd count
restore done@local \\}
match =PWORD, vartype \\{ varname rp count
restore done@local \\}
match =QWORD, vartype \\{ varname rq count
restore done@local \\}
match =TBYTE, vartype \\{ varname rt count
restore done@local \\}
match =DQWORD, vartype \\{ label varname dqword
rq count+count
restore done@local \\}
match , done@local \\{ virtual
varname vartype
end virtual
rb count*sizeof.\#vartype
restore done@local \\} \}
match :varname:vartype, done@local:var
\{ match =BYTE, vartype \\{ varname db ?
restore done@local \\}
match =WORD, vartype \\{ varname dw ?
restore done@local \\}
match =DWORD, vartype \\{ varname dd ?
restore done@local \\}
match =PWORD, vartype \\{ varname dp ?
restore done@local \\}
match =QWORD, vartype \\{ varname dq ?
restore done@local \\}
match =TBYTE, vartype \\{ varname dt ?
restore done@local \\}
match =DQWORD, vartype \\{ label varname dqword
dq ?,?
restore done@local \\}
match , done@local \\{ varname vartype
restore done@local \\} \}
match ,done@local
\{ var
restore done@local \}
common
endl }

View File

@ -1,413 +0,0 @@
;
;
; Поддержка контакт листа на сервере
;
;
;
; Заполняет таблицу с UIN
; и опционально таблицы с именем и доп. инфой
;
; Из comp.inc для отладки
;
;
; Массив с UIN
;
;UIN_LEN = 11 ; Длина
;UINS = 15 ; Количество
;
;uins db UIN_LEN*UINS dup 0
;
; массив со статусами
;
;stats dd UINS dup -1
;
; Массив с именами
;
;NAME_LEN = 30
;names db NAME_LEN*UINS dup 0
;
; Достает из item UIN
; eax <- указатель на item
; Пропускает группы
;
ssi_get_uin:
push eax
push ebx
push ecx
push edx
;
; Проверяем ItemID
;
xor ebx, ebx
mov bl, [eax + 1] ; Length of the item name
mov bh, [eax] ;
;push ebx
;mov ebx, 128
;call print_mem
;pop ebx
;; FIXIT Разумнее проверять флаги
;; Если длина строки = 0
;; пропускаем item
;cmp ebx, 0
;jz ssi_get_end
;;
;;data_debug 'Item name len', ebx
;;+смещение до ItemID
;;xor ecx, ecx
;;mov ch, [eax + ebx + 4]
;;mov cl, [eax + ebx + 5] ; Item ID#
;;cmp ecx, 0
;;jz ssi_get_end
;
; Проверяем флаги, обрабатываем только записи UIN
;
xor ecx, ecx
mov ch, [eax + ebx + 6]
mov cl, [eax + ebx + 7]
cmp ecx, 0 ; 0x0000 Buddy record (name: uin for ICQ and screenname for AIM)
jz ssi_uin
; debug
;
lea eax, [eax + ebx + 6]
mov ebx, 2
call print_mem
jmp ssi_get_end
ssi_uin:
;
; Копируем UIN в таблицу
;
mov ecx, ebx ; Длина строки
lea eax, [eax + 2]
mov edx, [uin_ind]
cmp edx, UINS
jnb ssi_get_end ;Нет свободного места в таблице UIN
imul edx, UIN_LEN
mov ebx, uins
lea ebx, [ebx + edx]
call strcpy
inc [uin_ind]
;debug
;mov eax, ebx
;xor ebx, ebx
;call writemsg
;
ssi_get_end:
pop edx
pop ecx
pop ebx
pop eax
ret
;
; eax <- указатель на item
; возвращает в eax указатель на следующий item
;
;
ssi_next_item:
push ebx
push ecx
xor ebx, ebx
mov bl, [eax + 1] ; длина UIN
mov bh, [eax] ;
xor ecx, ecx
mov cl, [eax + ebx + 9] ; Длина дополнительных данных
mov ch, [eax + ebx + 8] ;
add ebx, ecx
add ebx, 10 ;+Длина заголовка
lea eax, [eax + ebx]
pop ecx
pop ebx
ret
;
; eax <- указатель на tlv
; возвращает в eax указатель на след tlv
;
macro get_next_tlv {
push ebx
xor ebx, ebx
mov bl, [eax + 3]
mov bh, [eax + 2]
; + размер заголовка
lea ebx, [ebx + 4]
lea eax, [eax + ebx]
pop ebx
}
;
; Ищет в additional имя и др. сведения
; eax <- указатель на item
;
ssi_get_add:
push eax
push ebx
push ecx
push edx
push esi
;mov ebx, 128
;call print_mem
xor ebx, ebx
mov bl, [eax + 1] ; Length of the item name
mov bh, [eax] ;
;;cmp ebx, 0 ; Если длина имени = 0
;;jz ssi_all_tlv ; Нет смысла обрабатывать
;;+смещение до ItemID
;;xor ecx, ecx
;;mov ch, [eax + ebx + 4]
;;mov cl, [eax + ebx + 5] ; Item ID#
;
;;cmp ecx, 0 ; Группы пока не обрабатываются
;;jz ssi_all_tlv ;
;
; Проверяем флаги, обрабатываем только записи UIN
;
xor ecx, ecx
mov ch, [eax + ebx + 6]
mov cl, [eax + ebx + 7]
cmp ecx, 0 ; 0x0000 Buddy record (name: uin for ICQ and screenname for AIM)
jnz ssi_all_tlv
xor edx, edx
mov dl, [eax + ebx + 9] ;
mov dh, [eax + ebx + 8] ; Length of the additional data
lea eax, [eax + ebx + 10] ; eax указатель на первый tlv
;FIXME : Iservd не присылает additional - пока не могу отладить
;debug
;push ebx
;mov ebx, edx
;data_debug 'length additional data', ebx
;call print_mem
;pop ebx
;
xor esi, esi
ssi_tlv_process:
cmp esi, edx ;
jnb ssi_all_tlv ; additional закончилось
xor ecx, ecx
mov cl, [eax + 3] ;
mov ch, [eax + 2] ; TLV.Length
xor ebx, ebx
mov bl, [eax + 1] ; TLV.Type
mov bh, [eax] ;
cmp bx, 0x0131 ;Имя пользователя
jz ssi_name
cmp bx, 0x0066 ;Ожидаем авторизации
jz ssi_auth_wait
jmp ssi_next_tlv
ssi_auth_wait:
;
;
;
jmp ssi_next_tlv
ssi_name:
;
; Скопировать имя в массив
;
push eax
push ecx
mov ebx, [name_ind]
cmp ebx, UINS
jnb ssi_name_end ;Нет места в таблице
lea eax, [eax + 4] ;Указатель на строку (Прибавляем размер заголовка TLV)
imul ebx, NAME_LEN
lea ebx, [names + ebx]
cmp ecx, NAME_LEN - 1 ; Если имя длиннее поля в таблице
jna @f
mov ecx, NAME_LEN - 1
@@:
call strcpy
;; FIXIT
;; Перекодировка имени
;;
;;mov eax, ebx
;;call win2dos
;
;debug
;push eax
;push ebx
;mov eax, ebx
;xor ebx, ebx
;call writemsg
;pop ebx
;pop eax
;
;
inc [name_ind]
pop ecx
pop eax
ssi_next_tlv:
lea ecx, [ecx + 4] ; Длина данных tlv + длина заголовка
add esi, ecx
get_next_tlv
jmp ssi_tlv_process
ssi_name_end:
pop ecx
pop eax
ssi_all_tlv:
pop esi
pop edx
pop ecx
pop ebx
pop eax
ret
;
;
; Обработка контакт листа, пришедшего от сервера
;
; в eax <- указатель на данные в пакете SNAC(13,06)
ssi_process_data:
push eax
push ebx
push ecx
push edx
;
; Проверить версию протокола
;
xor ebx, ebx
mov bl, [eax]
cmp bl, 0
jnz ssi_bad_prot
;
;в ebx - количество items
mov bl, [eax + 2]
mov bh, [eax + 1]
;
data_debug 'SSI items:', ebx
lea eax, [eax + 3] ; Установить eax на список items
xor ecx, ecx ; Счетчик items
ssi_next_uin:
cmp ecx, ebx
jnb ssi_all_items
call ssi_get_uin
call ssi_get_add
call ssi_next_item
inc ecx
jmp ssi_next_uin
ssi_bad_prot:
write_debug "ERR: SSI protocol version mismatch"
ssi_all_items:
pop edx
pop ecx
pop ebx
pop eax
ret

View File

@ -1,5 +0,0 @@
;
; Èíäåêñ â ìàññèâå UINS
;
uin_ind dd 0
name_ind dd 0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 774 B

View File

@ -1,180 +0,0 @@
; Macroinstructions for defining data structures
macro struct name
{ fields@struct equ name
match child parent, name \{ fields@struct equ child,fields@\#parent \}
sub@struct equ
struc db [val] \{ \common fields@struct equ fields@struct,.,db,<val> \}
struc dw [val] \{ \common fields@struct equ fields@struct,.,dw,<val> \}
struc du [val] \{ \common fields@struct equ fields@struct,.,du,<val> \}
struc dd [val] \{ \common fields@struct equ fields@struct,.,dd,<val> \}
struc dp [val] \{ \common fields@struct equ fields@struct,.,dp,<val> \}
struc dq [val] \{ \common fields@struct equ fields@struct,.,dq,<val> \}
struc dt [val] \{ \common fields@struct equ fields@struct,.,dt,<val> \}
struc rb count \{ fields@struct equ fields@struct,.,db,count dup (?) \}
struc rw count \{ fields@struct equ fields@struct,.,dw,count dup (?) \}
struc rd count \{ fields@struct equ fields@struct,.,dd,count dup (?) \}
struc rp count \{ fields@struct equ fields@struct,.,dp,count dup (?) \}
struc rq count \{ fields@struct equ fields@struct,.,dq,count dup (?) \}
struc rt count \{ fields@struct equ fields@struct,.,dt,count dup (?) \}
macro db [val] \{ \common \local anonymous
fields@struct equ fields@struct,anonymous,db,<val> \}
macro dw [val] \{ \common \local anonymous
fields@struct equ fields@struct,anonymous,dw,<val> \}
macro du [val] \{ \common \local anonymous
fields@struct equ fields@struct,anonymous,du,<val> \}
macro dd [val] \{ \common \local anonymous
fields@struct equ fields@struct,anonymous,dd,<val> \}
macro dp [val] \{ \common \local anonymous
fields@struct equ fields@struct,anonymous,dp,<val> \}
macro dq [val] \{ \common \local anonymous
fields@struct equ fields@struct,anonymous,dq,<val> \}
macro dt [val] \{ \common \local anonymous
fields@struct equ fields@struct,anonymous,dt,<val> \}
macro rb count \{ \local anonymous
fields@struct equ fields@struct,anonymous,db,count dup (?) \}
macro rw count \{ \local anonymous
fields@struct equ fields@struct,anonymous,dw,count dup (?) \}
macro rd count \{ \local anonymous
fields@struct equ fields@struct,anonymous,dd,count dup (?) \}
macro rp count \{ \local anonymous
fields@struct equ fields@struct,anonymous,dp,count dup (?) \}
macro rq count \{ \local anonymous
fields@struct equ fields@struct,anonymous,dq,count dup (?) \}
macro rt count \{ \local anonymous
fields@struct equ fields@struct,anonymous,dt,count dup (?) \}
macro union \{ fields@struct equ fields@struct,,union,<
sub@struct equ union \}
macro struct \{ fields@struct equ fields@struct,,substruct,<
sub@struct equ substruct \}
virtual at 0 }
macro ends
{ match , sub@struct \{ restruc db,dw,du,dd,dp,dq,dt
restruc rb,rw,rd,rp,rq,rt
purge db,dw,du,dd,dp,dq,dt
purge rb,rw,rd,rp,rq,rt
purge union,struct
match name=,fields,fields@struct \\{ fields@struct equ
make@struct name,fields
fields@\\#name equ fields \\}
end virtual \}
match any, sub@struct \{ fields@struct equ fields@struct> \}
restore sub@struct }
macro make@struct name,[field,type,def]
{ common
if $
display 'Error: definition of ',`name,' contains illegal instructions.',0Dh,0Ah
err
end if
local define
define equ name
forward
local sub
match , field \{ make@substruct type,name,sub def
define equ define,.,sub, \}
match any, field \{ define equ define,.#field,type,<def> \}
common
match fields, define \{ define@struct fields \} }
macro define@struct name,[field,type,def]
{ common
local list
list equ
forward
if ~ field eq .
name#field type def
sizeof.#name#field = $ - name#field
else
rb sizeof.#type
end if
local value
match any, list \{ list equ list, \}
list equ list <value>
common
sizeof.#name = $
restruc name
match values, list \{
struc name value \\{
match any, fields@struct \\\{ fields@struct equ fields@struct,.,name,<values> \\\}
match , fields@struct \\\{ label .
forward
match , value \\\\{ field type def \\\\}
match any, value \\\\{ field type value
if ~ field eq .
rb sizeof.#name#field - ($-field)
end if \\\\}
common \\\} \\} \} }
macro enable@substruct
{ macro make@substruct substruct,parent,name,[field,type,def]
\{ \common
\local define
define equ parent,name
\forward
\local sub
match , field \\{ match any, type \\\{ enable@substruct
make@substruct type,name,sub def
purge make@substruct
define equ define,.,sub, \\\} \\}
match any, field \\{ define equ define,.\#field,type,<def> \\}
\common
match fields, define \\{ define@\#substruct fields \\} \} }
enable@substruct
macro define@union parent,name,[field,type,def]
{ common
virtual at 0
forward
if ~ field eq .
virtual at 0
parent#field type def
sizeof.#parent#field = $ - parent#field
end virtual
if sizeof.#parent#field > $
rb sizeof.#parent#field - $
end if
else if sizeof.#type > $
rb sizeof.#type - $
end if
common
sizeof.#name = $
end virtual
struc name [value] \{ \common
label .\#name
last@union equ
forward
match any, last@union \\{ virtual at .\#name
field type def
end virtual \\}
match , last@union \\{ match , value \\\{ field type def \\\}
match any, value \\\{ field type value \\\} \\}
last@union equ field
common rb sizeof.#name - ($ - .\#name) \} }
macro define@substruct parent,name,[field,type,def]
{ common
virtual at 0
forward
if ~ field eq .
parent#field type def
sizeof.#parent#field = $ - parent#field
else
rb sizeof.#type
end if
local value
common
sizeof.#name = $
end virtual
struc name value \{
label .\#name
forward
match , value \\{ field type def \\}
match any, value \\{ field type value
if ~ field eq .
rb sizeof.#parent#field - ($-field)
end if \\}
common \} }

View File

@ -1,5 +0,0 @@
@erase lang.inc
@echo lang fix en >lang.inc
@fasm local.asm local
@erase lang.inc
@pause

View File

@ -1,5 +0,0 @@
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm local.asm local
@erase lang.inc
@pause

View File

@ -1,507 +0,0 @@
;
; Remote processing example (local node)
;
; Compile with FASM for Menuet
;
use32
org 0x0
db 'MENUET01' ; header
dd 0x01 ; header version
dd START ; entry point
dd I_END ; image size
dd I_END+0x10000 ; required memory
dd I_END+0x10000 ; esp
dd 0x0 , 0x0 ; I_Param , I_Path
include 'lang.inc'
include '..\..\..\macros.inc'
START: ; start of execution
mov eax,53 ; open socket
mov ebx,0
mov ecx,0x2000 ; local port
mov edx,0x3000 ; remote port
mov esi,dword [host_ip] ; node IP
mcall
mov [socketNum], eax
red:
call draw_window ; at first, draw the window
still:
mov eax,23 ; wait here for event
mov ebx,1
mcall
cmp eax,1 ; redraw request ?
jz red
cmp eax,2 ; key in buffer ?
jz key
cmp eax,3 ; button in buffer ?
jz button
mov eax, 53 ; get data
mov ebx, 2
mov ecx, [socketNum]
mcall
cmp eax, 0
jne read
jmp still
key:
mov eax,2
mcall
jmp still
button:
mov eax,17
mcall
cmp ah,1 ; button id=1 ?
jnz noclose
mov eax, 53
mov ebx, 1
mov ecx, [socketNum]
mcall
mov eax,-1
mcall
noclose:
cmp ah,2 ; SEND CODE ?
je send_xcode
cmp ah,3 ; LEFT COORDINATES ?
jne no_left
mov [picture_position],0
mov dword [send_data+15],dword STARTX
mov dword [send_data+19],dword 4
mov esi,send_data
mov edi,I_END
mov ecx,23
cld
rep movsb
mov [I_END+23],dword -20
mov eax,53
mov ebx,4
mov ecx,[socketNum]
mov edx,23 + 4
mov esi,I_END
mcall
jmp still
no_left:
cmp ah,4 ; RIGHT COORDINATES ?
jne no_right
mov [picture_position],128
mov dword [send_data+15],dword STARTX
mov dword [send_data+19],dword 4
mov esi,send_data
mov edi,I_END
mov ecx,23
cld
rep movsb
mov [I_END+23],dword -20 + 128
mov eax,53
mov ebx,4
mov ecx,[socketNum]
mov edx,23 + 4
mov esi,I_END
mcall
jmp still
no_right:
cmp ah,5 ; SEND EXECUTE ?
je send_execute
jmp still
xx dd 0
yy dd 0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; SEND CODE TO REMOTE ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
send_xcode:
mov dword [send_data+15],dword 0x80000
mov dword [send_data+19],dword remote_code_end - remote_code_start
mov esi,send_data ; header
mov edi,I_END
mov ecx,23
cld
rep movsb
mov esi,remote_code ; remote_code_start ; data
mov edi,I_END+23
mov ecx,remote_code_end - remote_code_start
cld
rep movsb
mov eax,53 ; SEND CODE TO REMOTE
mov ebx,4
mov ecx,[socketNum]
mov edx,23 + remote_code_end - remote_code_start
mov esi,I_END
mcall
jmp still
send_execute:
mov dword [execute+15],dword draw_fractal
mov eax,53 ; START EXECUTE AT REMOTE
mov ebx,4
mov ecx,[socketNum]
mov edx,19
mov esi,execute
mcall
mov edi,3
jmp still
;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; READ ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;
read:
cfr007:
mov eax, 53
mov ebx, 3
mov ecx, [socketNum]
mcall ; read byte
shl edx,8
mov dl,bl
dec edi
jnz cok
mov edi,3
and edx,0xffffff
mov eax,1
mov ebx,[xx]
mov ecx,[yy]
add ebx,15
add ecx,35
add ebx,[picture_position]
mcall
inc [xx]
cmp [xx],dword 128
jb cok
mov [xx],0
inc [yy]
cmp [yy],dword 128
jb cok
mov [yy],0
cok:
mov eax, 53
mov ebx, 2
mov ecx, [socketNum]
mcall ; any more data?
cmp eax, 0
jne cfr007 ; yes, so get it
jmp still
; *********************************************
; ******* WINDOW DEFINITIONS AND DRAW ********
; *********************************************
draw_window:
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,1 ; 1, start of draw
mcall
; DRAW WINDOW
mov eax,0 ; function 0 : define and draw window
mov ebx,100*65536+286 ; [x start] *65536 + [x size]
mov ecx,60*65536+330 ; [y start] *65536 + [y size]
mov edx,0x04ffffff ; color of work area RRGGBB
mov edi,title ; WINDOW LABEL
mcall
mov eax,8 ; SEND CODE
mov ebx,60*65536+160
mov ecx,181*65536+13
mov edx,2
mov esi,0x667788
mcall
;mov eax,8 ; LEFT
mov ebx,60*65536+75
mov ecx,197*65536+13
mov edx,3
mcall
;mov eax,8 ; RIGHT
mov ebx,148*65536+72
mov ecx,197*65536+13
mov edx,4
mcall
;mov eax,8 ; SEND EXECUTE
mov ebx,60*65536+160
mov ecx,213*65536+13
mov edx,5
mcall
cld
mov eax,4
mov ebx,25*65536+185 ; draw info text with function 4
mov ecx,0x000000
mov edx,text
mov esi,40
newline:
mcall
add ebx,16
add edx,40
cmp [edx],byte 'x'
jnz newline
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,2 ; 2, end of draw
mcall
ret
; DATA AREA
text:
db ' 1) SEND CODE '
db ' 2) LEFT RIGHT '
db " 3) SEND 'EXECUTE' "
db ' '
db ' LOCAL : 192.168.1.26 '
db ' REMOTE : 192.168.1.22 '
db ' REMOTE CODE AT THE END OF THIS FILE '
db 'x' ;<- END MARKER, DONT DELETE
title db 'CLUSTER LOCAL',0
socketNum dd 0x0
host_ip db 192,168,1,22
picture_position dd 0x0
send_data db 'MenuetRemote00' ; 00 header ; -> remote port 0x3000
db 1 ; 14 send
dd 0x0 ; 15 position
dd 0x0 ; 19 size
; 23
execute db 'MenuetRemote00' ; 00 header ; -> remote port 0x3000
db 2 ; 14 execute
dd 0x0 ; 15 position
; 19
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; REMOTE CODE ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
remote_code:
org 0x80000
remote_code_start:
PIXWIDTH equ 129
PIXHEIGHT equ 129
ZOOMLIMIT equ 13
DELTA equ 200
THRESHOLD equ 7
STARTSCALE equ 6
CHAR_COLOR equ 0fh
STARTX dd -20
STARTY dd 10
scaleaddy dd 60
scaleaddx dd 100
draw_fractal:
pusha
movzx ebp,word [STARTX]
movzx edi,word [STARTY]
mov cx, PIXHEIGHT ; height of screen in pixels
sub di,cx ; adjust our Y offset
@@CalcRow:
push cx
mov cx, PIXWIDTH -1 ; width of screen in pixels
sub bp,cx ;
@@CalcPixel:
push cx ; save the column counter on stack
xor cx, cx ; clear out color loop counter
xor bx, bx ; zero i coefficient
xor dx, dx ; zero j coefficient
@@CycleColors:
push dx ; save j value for later
mov ax, bx ; ax = i
sub ax, dx ; ax = i - j
add dx, bx ; dx = i + j
stc ; one additional shift, please
call Shifty ; ax = ((i+j)*(i-j)) shifted right
pop dx ; retrieve our saved value for j
add ax,bp ; account for base offset...
cmp ah,THRESHOLD ; Q: is i &gt; THRESHOLD * 256?
xchg bx,ax ; now swap new i with old i
jg @@draw ; Y: draw this pixel
clc ; no additional shifts here, please
call Shifty ; now dx:ax = old i * j
xchg dx,ax ;
add dx,di ; account for base offset...
inc cl ; increment color
jnz @@CycleColors ; keep going until we're done
@@draw:
xchg ax, cx ; mov color into al
pop cx ; retrieve our column counter
pop dx ; fetch row (column already in cx)
push dx ; must leave a copy on the stack
xor bx,bx ; write to video page zero
call store_pixel
inc bp
loop @@CalcPixel
inc di
pop cx
loop @@CalcRow
call return_data
popa
ret
Shifty:
push cx
db 0b1h
scale db STARTSCALE
adc cl,0
imul dx
xchg ax,dx
shl eax,16
xchg ax,dx
shr eax,cl
pop cx
ret
pixel_pos: dd data_area
store_pixel:
pusha
mov ebx,[pixel_pos]
shl eax,3
and eax,0xff
mov [ebx],eax
add dword [pixel_pos],dword 3
popa
ret
return_data:
mov ecx,128 * 128/16
mov esi,data_area
sd:
pusha
mov eax,53 ; use the socket provided by host
mov ebx,4
mov ecx,[0]
mov edx,3*16
mcall
mov eax,5
mov ebx,1
mcall
popa
add esi,3*16
loop sd
ret
data_area:
remote_code_end:
I_END:

View File

@ -1,5 +0,0 @@
@erase lang.inc
@echo lang fix en >lang.inc
@fasm mp3s.asm mp3s
@erase lang.inc
@pause

View File

@ -1,5 +0,0 @@
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm mp3s.asm mp3s
@erase lang.inc
@pause

View File

@ -1,782 +0,0 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ;
; Tiny MP3 Shoutcast Server v0.1 (vt) ;
; ;
; Compile with FASM for Menuet ;
; ;
; Listening to port 8008 ;
; Connect with eg: 192.168.1.22:8008 ;
; ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
version equ '0.3'
use32
org 0x0
db 'MENUET01' ; 8 byte id
dd 0x01 ; header version
dd START ; program start
dd I_END ; program image size
dd 0x80000 ; memory usage
dd 0x20000 ; stack
dd 0,0
include 'lang.inc'
include '..\..\..\macros.inc'
; 0x0+ program image
; 0x1ffff stack
; 0x20000 work area for file read
; 0x40000+ file send buffer ( 100 kb )
START: ; start of execution
mov [status],0
call clear_input
call draw_window ; at first, draw the window
still:
mov eax,23 ; wait here for event
mov ebx,2
mcall
call check_events
call check_connection_status
cmp [status],4
je start_transmission
jmp still
check_events:
cmp eax,1 ; redraw request ?
jz red
cmp eax,2 ; key in buffer ?
jz key
cmp eax,3 ; button in buffer ?
jz button
ret
red: ; redraw
call draw_window
ret
key:
mov eax,2 ; Just read it and ignore
mcall
ret
button: ; button
mov eax,17 ; get id
mcall
cmp ah,1 ; close
jne no_close
mov eax,-1
mcall
no_close:
cmp ah,2 ; button id=2 ?
jnz tst3
; open socket
mov eax,53
mov ebx,5
mov ecx,8008 ; local port # - http
mov edx,0 ; no remote port specified
mov esi,0 ; no remote ip specified
mov edi,0 ; PASSIVE open
mcall
mov [socket], eax
mov [posy],1
mov [posx],0
mov [read_on],1
call check_for_incoming_data
call draw_window
ret
tst3:
cmp ah,4
je close_socket
cmp ah,6
je close_socket
jmp no_socket_close
close_socket:
mov edx,eax
; Close socket
mov eax, 53
mov ebx, 8
mov ecx, [socket]
mcall
mov esp,0x1fff0
cmp dh,6
je read_string
jmp still
no_socket_close:
cmp ah,9
jne no_bps_add
add [bps],8*1000
call draw_window
ret
no_bps_add:
cmp ah,8
jne no_bps_sub
sub [bps],8*1000
call draw_window
ret
no_bps_sub:
ret
clear_input:
mov edi,input_text
mov eax,0
mov ecx,60*40
cld
rep stosb
ret
read_string:
mov [addr],dword filename
mov [ya],dword 95
mov edi,[addr]
mov eax,32
mov ecx,30
cld
rep stosb
call print_text
mov edi,[addr]
f11:
mov eax,10
mcall
cmp eax,2
jne read_done
mov eax,2
mcall
shr eax,8
cmp eax,13
je read_done
cmp eax,8
jnz nobsl
cmp edi,[addr]
jz f11
sub edi,1
mov [edi],byte 32
call print_text
jmp f11
nobsl:
cmp eax,dword 31
jbe f11
cmp eax,dword 95
jb keyok
sub eax,32
keyok:
mov [edi],al
call print_text
add edi,1
mov esi,[addr]
add esi,30
cmp esi,edi
jnz f11
read_done:
mov ecx,40
mov eax,0
cld
rep movsb
call print_text
jmp still
print_text:
pusha
mov eax,13
mov ebx,56*65536+30*6
mov ecx,[ya]
shl ecx,16
mov cx,8
mov edx,0xffffff
mcall
mov eax,4
mov edx,[addr]
mov ebx,56*65536
add ebx,[ya]
mov ecx,0x000000
mov esi,30
mcall
popa
ret
wait_for dd 0x0
transmission_start dd 0x0
sentbytes dd 0x0
start_transmission:
call clear_input
mov eax,5
mov ebx,50
mcall
call check_for_incoming_data
call draw_window
call send_header
mov [fileinfo+4],dword 0 ; start from beginning
mov [read_to],0x40000
mov [playpos],0x40000
mov ecx,1024 / 512
new_buffer:
mov eax,[read_to]
mov ebx,1
call read_file
loop new_buffer
newpart:
call check_connection_status
call draw_window
mov eax,26
mov ebx,9
mcall
mov [transmission_start],eax
mov [sentbytes],0
newblock:
mov eax,[read_to]
mov ebx,2
call read_file
wait_more:
mov eax,26
mov ebx,9
mcall
cmp eax,[wait_for]
jge nomw
mov eax,5
mov ebx,1
mcall
jmp wait_more
nomw:
add eax,2
mov [wait_for],eax
mov eax,11
mcall
call check_events
mov eax,53
mov ebx,255
mov ecx,103
mcall
cmp eax,0
jne wait_more
; write to socket
mov eax,53
mov ebx,7
mov ecx,[socket]
mov edx,[playadd]
mov esi,[playpos]
mcall
add [sentbytes],edx
mov esi,[playpos]
add esi,[playadd]
mov edi,0x40000
mov ecx,110000 / 4
cld
rep movsd
mov eax,[playadd]
sub [read_to],eax
call check_for_incoming_data
call show_progress
call check_rate
mov eax, 53
mov ebx, 6
mov ecx, [socket]
mcall
cmp eax,4
jne end_stream
cmp [read_to],0x40000
jge newblock
end_stream:
; Close socket
mov eax, 53
mov ebx, 8
mov ecx, [socket]
mcall
mov eax,5
mov ebx,5
mcall
; Open socket
mov eax,53
mov ebx,5
mov ecx,8008 ; local port # - http
mov edx,0 ; no remote port specified
mov esi,0 ; no remote ip specified
mov edi,0 ; PASSIVE open
mcall
mov [socket], eax
mov [posy],1
mov [posx],0
mov [read_on],0
call draw_window
jmp still
check_rate:
pusha
mov eax,[bps]
xor edx,edx
mov ebx,8*100
div ebx
shl eax,1
mov [playadd],eax
mov eax,26
mov ebx,9
mcall
sub eax,[transmission_start]
shr eax,1
imul eax,[playadd]
mov edx,0x00dd00
cmp [sentbytes],eax
jge sendok
sub eax,20000
cmp [sentbytes],eax ; a long buffer underrun correction
jge no_buffer_overrun ; actually leads to overrun
mov [sentbytes],eax
no_buffer_overrun:
add [playadd],150
mov edx,0xdd0000
sendok:
mov eax,13
mov ebx,320*65536+10
mov ecx,105*65536+10
mcall
mov eax,47
mov ebx,4*65536
mov ecx,[playadd]
mov edx,322*65536+106
mov esi,0x000000
; mcall
popa
ret
show_progress:
pusha
mov eax,13
mov ebx,236*65536+10*6
mov ecx,107*65536+8
mov edx,0xffffff
mcall
mov ecx,[fileinfo+4]
imul ecx,512
mov eax,47 ; file read
mov ebx,9*65536
mov edx,236*65536+107
mov esi,0x000000
mcall
popa
ret
playpos dd 0x100000
playadd dd 256000 / 8 / 100
send_header:
pusha
mov [playpos],0x40000
mov esi,fileinfo+5*4
mov edi,transname
mov ecx,30
cld
rep movsb
mov eax, 53
mov ebx, 7
mov ecx, [socket]
mov edx, headere-headers
mov esi, headers
mcall
popa
ret
read_file:
cmp [read_to],0x40000+2000
jg cache_ok
mov [read_on],1
cache_ok:
cmp [read_to],0x40000+95500
jg no_read_1
mov [fileinfo+12],eax
mov [fileinfo+8],ebx
mov eax,58
mov ebx,fileinfo
mcall
cmp eax,0
jne no_read_1
mov eax,[fileinfo+8]
add [fileinfo+4],eax
add [read_to],512*2
ret
no_read_1:
mov [read_on],0
ret
check_for_incoming_data:
pusha
mov eax, 53
mov ebx, 2
mov ecx, [socket]
mcall
cmp eax,0
je _ret_now
new_data:
mov eax, 53
mov ebx, 2
mov ecx, [socket]
mcall
cmp eax,0
je _ret
mov eax,53
mov ebx,3
mov ecx,[socket]
mcall
cmp bl,10
jne no_lf
inc [posy]
mov [posx],0
jmp new_data
no_lf:
cmp bl,20
jb new_data
inc [posx]
cmp [posx],60
jbe xok
inc [posy]
mov [posx],0
xok:
cmp [posy],12
jbe yok
mov [posy],1
yok:
mov eax,[posy]
imul eax,60
add eax,[posx]
mov [input_text+eax],bl
jmp new_data
_ret:
; call draw_window
_ret_now:
popa
ret
check_connection_status:
pusha
mov eax, 53
mov ebx, 6
mov ecx, [socket]
mcall
cmp eax,[status]
je .ccs_ret
mov [status],eax
add eax,48
mov [text+20],al
call draw_window
.ccs_ret:
popa
ret
; *********************************************
; ******* WINDOW DEFINITIONS AND DRAW ********
; *********************************************
draw_window:
pusha
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,1 ; 1, start of draw
mcall
mov eax,0 ; Draw Window
mov ebx,50*65536+410
mov ecx,100*65536+141
mov edx,0x14ffffff
mov edi,title
mcall
mov eax,8 ; Start server
mov ebx,(25)*65536+21
mov ecx,57*65536+10
mov edx,2
mov esi,0x409040
mcall ; Stop server
; mov eax,8
mov ebx,(25)*65536+21
mov ecx,69*65536+10
mov edx,4
mov esi,0x904040
mcall
mov esi,0x3366d0
; mov eax,8 ; Enter filename
mov ebx,(25)*65536+21
mov ecx,93*65536+10
mov edx,6
mcall
; mov eax,8 ; Decrease transfer rate
mov ebx,(25)*65536+10
mov ecx,105*65536+10
; mov edx,8
mcall
; mov eax,8 ; Increase transfer rate
mov ebx,(36)*65536+10
mov ecx,105*65536+10
mov edx,9
mcall
mov ebx,10*65536+35 ; draw info text
mov ecx,0x00000000
mov edx,text
mov esi,40
newline:
mov eax,4
mcall
add ebx,12
add edx,40
cmp [edx],byte 'x'
jnz newline
mov eax,4 ; Filename
mov ebx,56*65536+95
mov ecx,0x000000
mov edx,filename
mov esi,30
mcall
mov eax,[bps]
xor edx,edx
mov ebx,1000
div ebx
mov ecx,eax
mov eax,47
mov ebx,3*65536
mov edx,58*65536+107
mov esi,0x00000000
mcall
mov [input_text+0],dword 'RECE'
mov [input_text+4],dword 'IVED'
mov [input_text+8],dword ': '
mov ebx,230*65536+35 ; draw info text
mov ecx,0x00000000
mov edx,input_text
mov esi,28
mov edi,7
newline2:
mov eax,4
mcall
add ebx,10
add edx,60
dec edi
jnz newline2
mov eax,38
mov ebx,210*65536+210
mov ecx,22*65536+136
mov edx,0x6699cc ; 002288
mcall
mov eax,38
mov ebx,211*65536+211
mov ecx,22*65536+136
mov edx,0x336699 ; 002288
mcall
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,2 ; 2, end of draw
mcall
popa
ret
; DATA AREA
text:
db ' TCB status: 0 '
db ' '
db ' Activate - port 8008 '
db ' Stop server '
db ' '
db ' > '
db ' < > Kbps '
db 'x'; <- END MARKER, DONT DELETE
headers:
db 'ICY 200 OK',13,10
db 'icy-notice1:This stream requires Winamp or xmms',13,10
db 'icy-url:http://www.menuetos.org',13,10
db 'icy-pub: 1',13,10
db 'icy-name: Menuet Mp3 Shoutcast Radio ',version,' - '
transname:
db ' ',13,10,13,10
headere:
title db 'MP3 shoutcast server ',version,0
socket dd 0
status dd 0
posy dd 1
posx dd 0
read_on db 1
read_to dd 0
addr dd 0
ya dd 0
bps dd 128*1000
fileinfo: dd 0,0,0,0,0x20000
filename: db '/sys/MENUET.MP3',0
times 50 db 0
input_text:
I_END:

View File

@ -1,5 +0,0 @@
@erase lang.inc
@echo lang fix en >lang.inc
@fasm netsendc.asm netsendc
@erase lang.inc
@pause

View File

@ -1,5 +0,0 @@
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm netsendc.asm netsendc
@erase lang.inc
@pause

View File

@ -1,173 +0,0 @@
;
; NetSend(Client)
;
; €¢â®à: Hex
; ‘ ©â: www.mestack.narod.ru
;
; Ž¯¨á ­¨¥:
; <20>ணࠬ¬  ¤«ï ®¡¬¥­  á®®¡é¥­¨ï¬¨ ¢ á¥â¨.Š«¨¥­â᪠ï ç áâì.
;
; Compile with FASM for Menuet
; Š®¬¯¨«¨àã¥âáï FASM'®¬ ¤«ï Œ¥­ãíâ Ž‘
;
use32
org 0x0
db 'MENUET01' ; 8 byte id
dd 1 ; header version
dd START ; program start
dd I_END ; program image size
dd mem ; required amount of memory
dd mem ; stack pointer
dd 0, 0 ; param, icon
include 'lang.inc'
include 'macros.inc'
START: ; start of execution
mov eax,53 ; open socket
mov ebx,0
mov ecx,0x4000 ; local port
mov edx,0x5000 ; remote port
mov esi,dword [remote_ip] ; node IP
mcall
mov [socketNum], eax
red:
call draw_window ; at first, draw the window
still:
mov eax,10 ; wait here for event
mcall
dec eax
jz red
dec eax
jnz button
key:
mov al,2
mcall
jmp still
button:
mov al,17
mcall
dec ah ; button id=1 ?
jnz noclose
mov eax, 53
mov ebx, 1
mov ecx, [socketNum]
mcall
or eax,-1
mcall
noclose:
; it was not close button, so it must be send code button
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; SEND CODE TO REMOTE ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
send_xcode:
mov eax,53 ; SEND CODE TO REMOTE
mov ebx,4
mov ecx,[socketNum]
mov edx,end_message-send_data
mov esi,send_data
mcall
jmp still
; *********************************************
; ******* WINDOW DEFINITIONS AND DRAW ********
; *********************************************
draw_window:
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,1 ; 1, start of draw
mcall
; DRAW WINDOW
mov eax,0 ; function 0 : define and draw window
mov ebx,100*65536+250 ; [x start] *65536 + [x size]
mov ecx,60*65536+150 ; [y start] *65536 + [y size]
mov edx,0x14ffffff ; color of work area RRGGBB
mov edi,title ; WINDOW LABEL
mcall
mov eax,8 ; SEND MESSAGE
mov ebx,50*65536+145
mov ecx,47*65536+13
mov edx,2
mov esi,0x667788
mcall
mov eax,4
mov ebx,25*65536+50 ; draw info text with function 4
mov ecx,0x000000
mov edx,text
mov esi,40
newline:
mcall
add ebx,16
add edx,esi
cmp [edx],byte 'x'
jnz newline
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,2 ; 2, end of draw
mcall
ret
; DATA AREA
if lang eq ru
text:
db ' <20>®á« âì á®®¡é¥­¨¥ '
db ' '
db ' ‹®ª «ì­ë©  ¤à¥á : 192.168.0.1 '
db ' “¤ «ñ­­ë©  ¤à¥á : 192.168.0.2 '
db '’¥ªáâ ¨  ¤à¥á ¢ ª®­æ¥ ¨á室­¨ª  '
db 'x' ; <- END MARKER, DONT DELETE
else
text:
db ' Send message '
db ' '
db ' Local address : 192.168.0.1 '
db ' Remote address : 192.168.0.2 '
db 'Text and address in end of source '
db 'x' ; <- END MARKER, DONT DELETE
end if
title db 'NetSend(Client)',0
remote_ip db 192,168,1,2
send_data db '<27>ਢ¥â,íâ® â¥áâ!Hello,this is a test!'
end_message:
I_END:
align 4
socketNum dd ?
rb 32 ; this is for stack
mem:

View File

@ -1,5 +0,0 @@
@erase lang.inc
@echo lang fix en >lang.inc
@fasm netsends.asm netsends
@erase lang.inc
@pause

View File

@ -1,5 +0,0 @@
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm netsends.asm netsends
@erase lang.inc
@pause

View File

@ -1,186 +0,0 @@
;
; NetSend(Server)
;
; €¢â®à: Hex
; ‘ ©â: www.mestack.narod.ru
;
; Ž¯¨á ­¨¥:
; <20>ணࠬ¬  ¤«ï ®¡¬¥­  á®®¡é¥­¨ï¬¨ ¢ á¥â¨.‘¥à¢¥à­ ï ç áâì.
;
; Compile with FASM for Menuet
; Š®¬¯¨«¨àã¥âáï FASM'®¬ ¤«ï Œ¥­ãíâ Ž‘
;
use32
org 0x0
db 'MENUET01' ; header
dd 0x01 ; header version
dd START ; entry point
dd I_END ; image size
dd I_END+0x10000 ; required memory
dd I_END+0x10000 ; esp
dd 0x0 , 0x0 ; I_Param , I_Path
include 'lang.inc'
include 'macros.inc'
remote_ip db 192,168,0,1
START: ; start of execution
mov eax, 53 ; open receiver socket
mov ebx, 0
mov ecx, 0x5000 ; local port
mov edx, 0xffff ; remote port
mov esi, dword [remote_ip] ; remote IP
mcall
mov [socketNum],eax
mov [0],eax ; save for remote code
red:
call draw_window ; at first, draw the window
still:
mov eax,23 ; wait here for event
mov ebx,1
mcall
cmp eax,1 ; redraw request ?
jz red
cmp eax,2 ; key in buffer ?
jz key
cmp eax,3 ; button in buffer ?
jz button
mov eax,53 ; data from cluster terminal ?
mov ebx,2
mov ecx,[socketNum]
mcall
cmp eax,0
jne data_arrived
jmp still
key:
mov eax,2
mcall
jmp still
button:
mov eax,53
mov ebx,1
mov ecx,[socketNum]
mcall
or eax,-1
mcall
data_arrived:
mov eax,5 ; wait a second for everything to arrive
mov ebx,10
mcall
mov edi,I_END
get_data:
mov eax,53
mov ebx,3
mov ecx,[socketNum]
mcall
mov [edi],bl
inc edi
mov eax,53
mov ebx,2
mov ecx,[socketNum]
mcall
cmp eax,0
jne get_data
mov eax,4
mov ebx,10*65536+60
add ebx,[y]
mov ecx,0x000000
mov edx,I_END
mov esi,100
mcall
add [y],10
jmp still
y dd 0x10
; *********************************************
; ******* WINDOW DEFINITIONS AND DRAW ********
; *********************************************
draw_window:
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,1 ; 1, start of draw
mcall
; DRAW WINDOW
mov eax,0 ; function 0 : define and draw window
mov ebx,100*65536+300 ; [x start] *65536 + [x size]
mov ecx,100*65536+330 ; [y start] *65536 + [y size]
mov edx,0x14ffffff ; color of work area RRGGBB
mov edi,title ; WINDOW LABEL
mcall
; Re-draw the screen text
cld
mov eax,4
mov ebx,10*65536+30 ; draw info text with function 4
mov ecx,0x000000
mov edx,text
mov esi,40
newline:
mcall
add ebx,16
add edx,40
cmp [edx],byte 'x'
jnz newline
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,2 ; 2, end of draw
mcall
ret
; DATA AREA
if lang eq ru
text:
db '„ ­­ë©  ¤à¥á : 192.168.0.2 '
db '<27>à®á«ã訢 ¥¬ë© ¯®àâ : 0x5000 '
db '<27>à¨á« ­­ë¥ á®®¡é¥­¨ï: '
db 'x' ; <- END MARKER, DONT DELETE
else
text:
db 'This address : 192.168.0.2 '
db 'Used port : 0x5000 '
db 'Received messages: '
db 'x' ; <- END MARKER, DONT DELETE
end if
title db 'NetSend(Server)',0
socketNum dd 0x0
I_END:

View File

@ -1,5 +0,0 @@
@erase lang.inc
@echo lang fix en >lang.inc
@fasm nntpc.asm nntpc
@erase lang.inc
@pause

View File

@ -1,5 +0,0 @@
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm nntpc.asm nntpc
@erase lang.inc
@pause

View File

@ -1,911 +0,0 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; NNTP CLIENT v 0.1
;;
;; (C) Ville Turjanmaa
;;
version equ '0.1'
include "lang.inc"
include "..\..\..\macros.inc"
use32
org 0x0
db 'MENUET01' ; 8 byte id
dd 0x01 ; header version
dd START ; start of code
dd I_END ; size of image
dd 0x80000 ; memory for app
dd 0x80000 ; esp
dd 0x0 , 0x0 ; I_Param , I_Icon
connect_state db 0,0,'Disconnected'
db 1,3,'Trying.. '
db 4,4,'Connected '
db 5,9,'Closing.. '
prev_state dd -1
space dd 0x0
text_start dd 0x0
text_current dd 0x0
status dd 0x0
server_ip db 192,168,0,96
socket dd 0x0
xpos dd 0x0
ypos dd 0x0
;;
group db 'GROUP alt.test',13,10
db ' '
grouplen dd 16
stat db 'STAT '
statlen dd 0x0
article db 'ARTICLE',13,10
articlelen:
;;
quit db 'QUIT',13,10
quitlen:
xwait dd 0x0
ywait dd 0x0
article_n dd 0x0
article_l dd 0x0
article_start dd 0x0
article_last dd 0x0
article_all dd 0x0
article_fetch dd 0x0
xpost dd 0x0
edisave dd 0x0
connection_status:
pusha
mov eax,53
mov ebx,6
mov ecx,[socket]
mcall
cmp eax,[prev_state]
je no_cos
mov [prev_state],eax
mov eax,13
mov ebx,435*65536+12*6
mov ecx,42*65536+10
mov edx,0xffffff
mcall
mov ecx,-14
mov eax,[prev_state]
next_test:
add ecx,14
cmp ecx,14*4
je no_cos
cmp al,[connect_state+ecx+0]
jb next_test
cmp al,[connect_state+ecx+1]
jg next_test
mov edx,ecx
add edx,2
add edx,connect_state
mov eax,4
mov ebx,435*65536+42
mov ecx,0x000000
mov esi,12
mcall
no_cos:
popa
ret
text_input:
pusha
mov ecx,25
mov eax,32
cld
rep stosb
popa
mov [edisave],edi
ti0:
mov [edi],byte ' '
call draw_entries
mov eax,10
mcall
cmp eax,2
jne no_more_text
mov eax,2
mcall
cmp ah,8
jne no_bg
cmp edi,[edisave]
je ti0
dec edi
jmp ti0
no_bg:
cmp ah,13
je no_more_text
mov [edi],ah
inc edi
call draw_entries
jmp ti0
no_more_text:
mov [xpost],edi
ret
convert_text_to_ip:
pusha
mov edi,server_ip
mov esi,text+10
mov eax,0
mov edx,[xpost]
newsip:
cmp [esi],byte '.'
je sipn
cmp esi,edx
jge sipn
movzx ebx,byte [esi]
inc esi
imul eax,10
sub ebx,48
add eax,ebx
jmp newsip
sipn:
mov [edi],al
xor eax,eax
inc esi
cmp esi,text+50
jg sipnn
inc edi
cmp edi,server_ip+3
jbe newsip
sipnn:
popa
ret
send_group:
mov eax,53
mov ebx,7
mov ecx,[socket]
mov edx,[grouplen]
mov esi,group
mcall
mov [status],3
call clear_text
call save_coordinates
ret
convert_number_to_text:
pusha
mov eax,[esi]
mov ecx,0
newch:
inc ecx
xor edx,edx
mov ebx,10
div ebx
cmp eax,0
jne newch
add edi,ecx
dec edi
mov [article_l],ecx
mov eax,[esi]
newdiv:
xor edx,edx
mov ebx,10
div ebx
add edx,48
mov [edi],dl
dec edi
loop newdiv
popa
ret
convert_text_to_number:
pusha
mov edx,0
newdigit:
movzx eax,byte [esi]
cmp eax,'0'
jb cend
cmp eax,'9'
jg cend
imul edx,10
add edx,eax
sub edx,48
inc esi
jmp newdigit
cend:
mov [edi],edx
popa
ret
clear_text:
mov [text_start],0
mov [xpos],0
mov [ypos],0
mov [xwait],0
mov [ywait],0
mov edi,nntp_text
mov ecx,0x50000
mov eax,32
cld
rep stosb
ret
state_machine_write:
cmp [status],2
jne no_22
call send_group
ret
no_22:
cmp [status],4
jne no_4
mov eax,53
mov ebx,7
mov ecx,[socket]
mov edx,[statlen] ; -stat
mov esi,stat
mcall
mov [status],5
call save_coordinates
ret
no_4:
cmp [status],6
jne no_6
mov eax,53
mov ebx,7
mov ecx,[socket]
mov edx,articlelen-article
mov esi,article
mcall
mov [status],7
call save_coordinates
ret
no_6:
ret
save_coordinates:
mov eax,[xpos]
mov ebx,[ypos]
mov [xwait],eax
mov [ywait],ebx
ret
state_machine_read:
cmp [status],1
jne no_1
mov eax,'200 '
call wait_for_string
ret
no_1:
cmp [status],3 ;; responce to group
jne no_3
mov eax,'211 '
call wait_for_string
ret
no_3:
cmp [status],5 ;; responce to stat
jne no_5
mov eax,'223 '
call wait_for_string
ret
no_5:
;; after 'article' request - no wait
cmp [status],9
jne no_9
mov eax,'222 '
call wait_for_string
ret
no_9:
ret
wait_for_string:
mov ecx,[ywait]
imul ecx,80
add ecx,[xwait]
mov ecx,[nntp_text+ecx]
cmp eax,ecx
jne no_match
cmp [status],3
jne no_stat_ret
mov esi,[ywait]
imul esi,80
add esi,[xwait]
new32s:
inc esi
movzx eax,byte [esi+nntp_text]
cmp eax,47
jge new32s
new32s2:
inc esi
movzx eax,byte [esi+nntp_text]
cmp eax,47
jge new32s2
inc esi
add esi,nntp_text
; mov [esi-1],byte '.'
mov edi,article_n
call convert_text_to_number
mov eax,[article_n]
mov [article_start],eax
new32s3:
inc esi
movzx eax,byte [esi]
cmp eax,47
jge new32s3
inc esi
mov edi,article_last
call convert_text_to_number
mov eax,[text_current]
add [article_n],eax
mov esi,article_n
mov edi,nntp_text+71
call convert_number_to_text
mov esi,article_n
mov edi,stat+5
call convert_number_to_text
mov eax,[article_l]
mov [stat+5+eax],byte 13
mov [stat+6+eax],byte 10
add eax,5+2
mov [statlen],eax
pusha
mov edi,text+10+66*2
mov ecx,25
mov eax,32
cld
rep stosb
mov esi,text_current
mov edi,text+10+66*2
call convert_number_to_text
mov eax,32
mov ecx,20
mov edi,text+10+66*3
cld
rep stosb
mov eax,[article_last]
sub eax,[article_start]
mov [article_all],eax
mov esi,article_all
mov edi,text+10+66*3
call convert_number_to_text
call draw_entries
popa
call draw_text
no_stat_ret:
inc [status]
mov eax,5
mov ebx,10
mcall
call check_for_incoming_data
no_match:
ret
START: ; start of execution
mov eax,40
mov ebx,10000111b
mcall
call clear_text
call draw_window
still:
call state_machine_write
call state_machine_read
mov eax,23 ; wait here for event
mov ebx,5
mcall
cmp eax,1 ; redraw request ?
je red
cmp eax,2 ; key in buffer ?
je key
cmp eax,3 ; button in buffer ?
je button
call check_for_incoming_data
call connection_status
jmp still
red: ; redraw
call draw_window
jmp still
key: ; key
mov eax,2 ; just read it and ignore
mcall
cmp ah,' '
jne no_space
mov eax,[space]
dec eax
add [text_start],eax
call draw_text
jmp still
no_space:
cmp ah,177
jne no_plus
inc [text_start]
call draw_text
jmp still
no_plus:
cmp ah,178
jne no_minus
cmp [text_start],0
je no_minus
dec [text_start]
call draw_text
jmp still
no_minus:
cmp ah,179
jne no_next
inc [text_current]
call send_group
jmp still
no_next:
cmp ah,176
jne no_prev
cmp [text_current],0
je still
dec [text_current]
call send_group
jmp still
no_prev:
jmp still
button: ; button
mov eax,17 ; get id
mcall
shr eax,8
cmp eax,11
jne no_11
mov edi,text+10
call text_input
call convert_text_to_ip
jmp still
no_11:
cmp eax,12
jne no_12
mov edi,text+66+10
call text_input
mov esi,text+66+10
mov edi,group+6
mov ecx,[xpost]
sub ecx,text+66+10
mov eax,ecx
cld
rep movsb
mov [group+6+eax],byte 13
mov [group+7+eax],byte 10
add eax,6+2
mov [grouplen],eax
mov [text_current],0
jmp still
no_12:
cmp eax,13
jne no_13
mov edi,text+10+66*2
call text_input
mov esi,text+10+66*2
mov edi,text_current
call convert_text_to_number
call send_group
jmp still
no_13:
cmp eax,14
jne no_start
call clear_text
mov eax,3
mcall
mov ecx,eax
mov eax,53
mov ebx,5
mov edx,119
mov esi,dword [server_ip]
mov edi,1
mcall
mov [socket],eax
mov [status],1
jmp still
no_start:
cmp eax,15
jne no_end
mov eax,53
mov ebx,7
mov ecx,[socket]
mov edx,quitlen-quit
mov esi,quit
mcall
mov eax,5
mov ebx,10
mcall
call check_for_incoming_data
mov eax,53
mov ebx,8
mov ecx,[socket]
mcall
mov eax,5
mov ebx,5
mcall
mov eax,53
mov ebx,8
mov ecx,[socket]
mcall
mov [status],0
jmp still
no_end:
cmp eax,1 ; button id=1 ?
jne noclose
mov eax,-1 ; close this program
mcall
noclose:
jmp still
check_for_incoming_data:
cmp [status],0
jne go_on
ret
go_on:
mov eax,53
mov ebx,2
mov ecx,[socket]
mcall
cmp eax,0
je ch_ret
mov eax,53
mov ebx,3
mov ecx,[socket]
mcall
and ebx,0xff
cmp ebx,13
jb no_print
cmp bl,13
jne char
mov [xpos],0
inc [ypos]
jmp no_print
char:
cmp ebx,128
jbe char_ok
mov ebx,'?'
char_ok:
mov ecx,[ypos]
imul ecx,80
add ecx,[xpos]
mov [nntp_text+ecx],bl
cmp [xpos],78
jg noxinc
inc [xpos]
noxinc:
no_print:
mov eax,53
mov ebx,2
mov ecx,[socket]
mcall
cmp eax,0
jne check_for_incoming_data
call draw_text
ch_ret:
ret
; *********************************************
; ******* WINDOW DEFINITIONS AND DRAW ********
; *********************************************
draw_window:
pusha
mov [prev_state],-1
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,1 ; 1, start of draw
mcall
; DRAW WINDOW
mov eax,0 ; function 0 : define and draw window
mov ebx,100*65536+520 ; [x start] *65536 + [x size]
mov ecx,5*65536+470 ; [y start] *65536 + [y size]
mov edx,0x13ffffff ; color of work area RRGGBB,8->color gl
mov edi,title ; WINDOW LABEL
mcall
mov eax,38
mov ebx,5*65536+515
mov ecx,101*65536+101
mov edx,0x99bbff
mcall
mov ecx,102*65536+102
mov edx,0x3366aa
mcall
mov eax,8
mov ebx,238*65536+8
mov ecx,30*65536+8
mov edx,11
mov esi,0x88aadd
mcall
mov ecx,41*65536+8
mov edx,12
mcall
mov ecx,52*65536+8
mov edx,13
mcall
mov ebx,265*65536+75
mov ecx,39*65536+13
mov edx,14
mcall
mov ebx,351*65536+75
mov edx,15
mcall
call draw_entries
call draw_text
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,2 ; 2, end of draw
mcall
popa
ret
draw_entries:
pusha
mov eax,13
mov ebx,30*65536+200
mov ecx,30*65536+44
mov edx,0xffffff
mcall
mov eax,4
mov ebx,30*65536+31 ; draw info text with function 4
mov ecx,0x000000
mov edx,text
mov esi,66
mov edi,6
newline2:
mcall
add ebx,11
add edx,66
dec edi
jnz newline2
popa
ret
draw_text:
pusha
mov eax,9
mov ebx,0x70000
mov ecx,-1
mcall
mov eax,[0x70000+46]
cmp eax,150
jbe dtret
sub eax,111
mov ebx,10
xor edx,edx
div ebx
mov edi,eax
dec edi
mov [space],edi
mov eax,4
mov ebx,20*65536+111 ; draw info text with function 4
mov ecx,0x000000
mov edx,[text_start]
imul edx,80
add edx,nntp_text
mov esi,80
newline:
pusha
mov ecx,ebx
shl ecx,16
mov eax,13
mov ebx,20*65536+80*6
mov cx,10
mov edx,0xffffff
mcall
popa
mcall
add ebx,10
add edx,80
dec edi
jnz newline
dtret:
popa
ret
; DATA AREA
text:
db 'NNTP IP : 192.168.0.96 < '
db 'Group : alt.test < Connect Disconnect '
db 'Article : 0 < '
db 'Art.max : ? '
db ' '
db 'Arrow left/rigth: fetch prev/next - Arrow up/down & space: scroll '
textl:
title db 'NNTP client v',version,0
nntp_text:
db 'a'
I_END: ;;;

View File

@ -1,5 +0,0 @@
@erase lang.inc
@echo lang fix en >lang.inc
@fasm ppp.asm ppp
@erase lang.inc
@pause

View File

@ -1,5 +0,0 @@
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm ppp.asm ppp
@erase lang.inc
@pause

View File

@ -1,188 +0,0 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; CHAT.INC ;;
;; ;;
;; Modem Chat Initiator for PPP Dialer ;;
;; ;;
;; Version 3 2nd May 2003 ;;
;; ;;
;; Copyright 2002 Shrirang Bhagwat, b_shrirang@hotmail.com ;;
;; ;;
;; See file COPYING for details ;;
;; ;;
;; 2/5/03 - Shrirang - Added Abort Strings For sendwait ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Request And Response Chat Strings
; Following Data Structure is used for Request Response Chatting
; with the modem, for each request there is an expected response
; chatreq <-> chatres, 0 (NULL) is delimeter for 1 string
; '`' is delimiter for the section, modify according to your
; modem dialing scheme; in future MenuetOS might provide a graphical
; client to generate this kind of data structure and the PAP packet
; for username and password!
; Aborts strings are used to get outta sendwait early...
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; REQUESTS
chatreq db 'ATH',13,0 ; 0 (NULL) is required by sendwait
db 'ATZ',13,0
db 'ATM1',13,0
db 'ATX1',13,0 ; My Modem doesn't connect without this
; db 'ATDT;',13,0
db 'ATDT phonenumber',13,0
db '`' ; <- End Marker
; RESPONSES
chatres db 'OK',0
db 'OK',0
db 'OK',0
db 'OK',0
; db 'OK',0
db 'CONNECT',0
db '`' ; <- End Marker
; ABORTS
aborts db 'ERROR',0
db 'NO CARRIER',0
db 'NO DIALTONE',0
db 'BUSY',0
db 'LINE IN USE',0
db 'NO ANSWER',0
db '`' ; <- End Marker
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; modem_chat - chats with the modem to initiate a connection
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
modem_chat:
push edi
push esi
push edx
mov edi, chatreq ; init everytime, safe, stateless
mov esi, chatres
chat_now:
cmp byte [esi], '`' ; are we done?
je chatover
mov edx, 6000 ; strings like "atdt;" take long on my modem
call sendwait
and eax, eax
jz timeoutoccured
updatereq:
inc edi
cmp byte [edi], '`'
je updateres
cmp byte [edi], 0
jne updatereq
inc edi
updateres:
inc esi
cmp byte [esi], '`'
je chatover
cmp byte [esi], 0
jne updateres
inc esi
jmp chat_now
chatover:
xor eax, eax ; SUCCESS!
inc eax
pop edx
pop esi
pop edi
ret
timeoutoccured:
xor eax, eax ; FAIL!
pop edx
pop esi
pop edi
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; scanaborts - scans the response from modem for abort srings
; ESI - Response from modem
; EDI - Pointer to Abort Table
; ECX - Response Length
; Returns 1 if abort detected, 0 otherwise
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
scanaborts:
push esi
push edi
push ecx
checkit:
push esi
repe cmpsb ; any abort matches?
je abortdetected
pop esi
updatetbl:
inc edi
cmp byte [edi], '`'
je noabortfound
cmp byte [edi], 0
jne updatetbl
inc edi
jmp checkit
abortdetected:
pop esi
pop ecx
pop edi
pop esi
xor eax, eax ; SUCCESS!
inc eax
ret
noabortfound :
pop ecx
pop edi
pop esi
xor eax, eax ; FAILED!
ret

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +0,0 @@
@erase lang.inc
@echo lang fix en >lang.inc
@fasm rccc.asm rccc
@erase lang.inc
@pause

View File

@ -1,5 +0,0 @@
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm rccc.asm rccc
@erase lang.inc
@pause

View File

@ -1,308 +0,0 @@
;
; Remote Control Center(Client)
;
; €¢â®à: Hex
; ‘ ©â: www.mestack.narod.ru
;
; Ž¯¨á ­¨¥:
; <20>ணࠬ¬ , ¯à¥¤­ §­ ç¥­­ ï ¤«ï ã¯à ¢«¥­¨ï 㤠«ñ­­ë¬ ª®¬¯ìîâ¥à®¬.Š«¨¥­â᪠ï
; ç áâì.
;
; Compile with FASM for Menuet
; Š®¬¯¨«¨àã¥âáï FASM'®¬ ¤«ï Œ¥­ãíâ Ž‘
;
use32
org 0x0
db 'MENUET01' ; 8 byte id
dd 0x01 ; header version
dd START ; start of code
dd I_END ; size of image
dd 0x5000 ; memory for app
dd 0x5000 ; esp
dd 0x0 , 0x0 ; I_Param , I_Icon
include 'lang.inc'
include '..\..\..\macros.inc'
START: ; start of execution
mov eax,53 ; open socket
mov ebx,0
mov ecx,0x6000 ; local port
mov edx,0x6100 ; remote port
mov esi,dword [remote_ip] ; remote IP
mcall
mov [socket], eax
mov eax,53 ; send connect code
mov ebx,4
mov ecx,[socket]
mov edx,1
mov esi,connect
mcall
red:
call draw_window ; at first, draw the window
still:
mov eax,23 ; wait here for event
mov ebx,1
mcall
cmp eax,1 ; redraw request ?
jz red
cmp eax,2 ; key in buffer ?
jz key
cmp eax,3 ; button in buffer ?
jz button
jmp still
key:
mov eax,2
mcall
jmp still
button:
mov eax,17
mcall
cmp ah,1 ; button id=1 ?
jnz noclose
mov eax, 53
mov ebx, 1
mov ecx, [socket]
mcall
or eax,-1
mcall
noclose:
cmp ah,2 ; SEND SHUTDOWN COMMAND?
je send_shutdown
cmp ah,3 ; SEND REBOOT COMMAND?
je send_reboot
cmp ah,4 ; SEND SAVEFI COMMAND?
je send_savefi
cmp ah,5 ; SEND SAVEHI COMMAND?
je send_savehi
cmp ah,6 ; SEND HOTREBOOT COMMAND?
je send_hotreboot
cmp ah,7 ; SEND EXIT COMMAND?
je send_exit
jmp still
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; SEND COMMANDS TO SERVER ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
send_shutdown:
mov eax,53 ; SEND CODE TO REMOTE
mov ebx,4
mov ecx,[socket]
mov edx,1
mov esi,sen_shutdown
mcall
jmp still
send_reboot:
mov eax,53 ; SEND CODE TO REMOTE
mov ebx,4
mov ecx,[socket]
mov edx,1
mov esi,sen_reboot
mcall
jmp still
send_savefi:
mov eax,53 ; SEND CODE TO REMOTE
mov ebx,4
mov ecx,[socket]
mov edx,1
mov esi,sen_savefi
mcall
jmp still
send_savehi:
mov eax,53 ; SEND CODE TO REMOTE
mov ebx,4
mov ecx,[socket]
mov edx,1
mov esi,sen_savehi
mcall
jmp still
send_hotreboot:
mov eax,53 ; SEND CODE TO REMOTE
mov ebx,4
mov ecx,[socket]
mov edx,1
mov esi,sen_hotreboot
mcall
jmp still
send_exit:
mov eax,53 ; SEND CODE TO REMOTE
mov ebx,4
mov ecx,[socket]
mov edx,1
mov esi,sen_exit
mcall
jmp still
get_data:
mov eax,53
mov ebx,3
mov ecx,[socket]
mcall
mov [edi],bl
inc edi
mov eax,53
mov ebx,2
mov ecx,[socket]
mcall
cmp eax,0
jne get_data
mov eax,4
mov ebx,30*65536+30
mov ecx,0x000000
mov edx,I_END
mov esi,15
mcall
jmp still
; *********************************************
; ******* WINDOW DEFINITIONS AND DRAW ********
; *********************************************
draw_window:
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,1 ; 1, start of draw
mcall
; DRAW WINDOW
mov eax,0 ; function 0 : define and draw window
mov ebx,100*65536+250 ; [x start] *65536 + [x size]
mov ecx,60*65536+280 ; [y start] *65536 + [y size]
mov edx,0x14ffffff ; color of work area RRGGBB
mov edi,title ; WINDOW LABEL
mcall
mov eax,8 ; CONTROL BUTTONS
mov ebx,25*65536+9
mov ecx,113*65536+9
mov edx,2
mov esi,0x667788
newbut:
mcall
add ecx,16*65536
inc edx
cmp edx,8
jb newbut
cld
mov eax,4
mov ebx,25*65536+50 ; draw info text with function 4
mov ecx,0x000000
mov edx,text
mov esi,40
newline:
mcall
add ebx,16
add edx,40
cmp [edx],byte 'x'
jnz newline
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,2 ; 2, end of draw
mcall
ret
; DATA AREA
text:
if lang eq ru
db ' ‚६ï á¥à¢¥à : '
db ' '
db ' Œ¥­î ã¯à ¢«¥­¨ï á¥à¢¥à®¬: '
db ' '
db ' - ‚몫îç¨âì '
db ' - <20>¥à¥§ £à㧨âì '
db ' - ‘®åà ­¨âì ä«®¯¯¨-¨¬¥¤¦ '
db ' - ‘®åà ­¨âì ¨¬¥¤¦ †. ¤¨áª  '
db ' - ƒ®àï稩 à¥áâ àâ ï¤à  '
db ' - ‡ ªàë⨥ á¥à¢¥à­®© ç á⨠'
db ' '
db ' ‹®ª «ì­ë©  ¤à¥á : 192.168.0.1 '
db ' “¤ «ñ­­ë©  ¤à¥á : 192.168.0.2 '
db '€¤à¥á á¥à¢¥à  - ¢ ª®­æ¥ ¨á室­¨ª  '
db 'x' ; <- END MARKER, DONT DELETE
else
db ' On server: '
db ' '
db ' Server control menu: '
db ' '
db ' - Shutdown '
db ' - Reboot '
db ' - Save ramdisk image to floppy '
db ' - Save ramdisk image to hard disk '
db ' - Kernel restart '
db ' - Close server part '
db ' '
db ' Local address : 192.168.0.1 '
db ' Remote address : 192.168.0.2 '
db 'Address of server is in end of source '
db 'x' ; <- END MARKER, DONT DELETE
end if
title db 'Remote Control Center(Client)',0
socket dd 0x0
remote_ip db 192,168,0,2
sen_shutdown db 'S'
sen_reboot db 'R'
sen_savefi db 'F'
sen_savehi db 'H'
sen_hotreboot db 'O'
sen_exit db 'E'
connect db 'C'
I_END:

View File

@ -1,5 +0,0 @@
@erase lang.inc
@echo lang fix en >lang.inc
@fasm rccs.asm rccs
@erase lang.inc
@pause

View File

@ -1,5 +0,0 @@
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm rccs.asm rccs
@erase lang.inc
@pause

View File

@ -1,341 +0,0 @@
;
; Remote Control Center(Server)
;
; €¢â®à: Hex
; ‘ ©â: www.mestack.narod.ru
;
; Ž¯¨á ­¨¥:
; <20>ணࠬ¬ , ¯à¥¤­ §­ ç¥­­ ï ¤«ï ã¯à ¢«¥­¨ï 㤠«ñ­­ë¬ ª®¬¯ìîâ¥à®¬.‘¥à¢¥à­ ï
; ç áâì.
;
; Compile with FASM for Menuet
; Š®¬¯¨«¨àã¥âáï FASM'®¬ ¤«ï Œ¥­ãíâ Ž‘
;
use32
org 0x0
db 'MENUET01' ; 8 byte id
dd 0x01 ; header version
dd START ; start of code
dd I_END ; size of image
dd 0x5000 ; memory for app
dd 0x5000 ; esp
dd 0x0 , 0x0 ; I_Param , I_Icon
include 'lang.inc'
include '..\..\..\macros.inc'
remote_ip db 192,168,0,1
START: ; start of execution
mov eax, 53 ; open receiver socket
mov ebx, 0
mov ecx, 0x6100 ; local port
mov edx, 0x6000 ; remote port
mov esi, dword [remote_ip] ; remote IP
mcall
mov [socket],eax
mov [0],eax ; save for remote code
red:
call draw_window ; at first, draw the window
still:
mov eax,23 ; wait here for event
mov ebx,1
mcall
cmp eax,1 ; redraw request ?
jz red
cmp eax,2 ; key in buffer ?
jz key
cmp eax,3 ; button in buffer ?
jz button
mov eax,53 ; data from cluster terminal ?
mov ebx,2
mov ecx,[socket]
mcall
cmp eax,0
jne data_arrived
jmp still
key:
mov eax,2
mcall
jmp still
button:
mov eax,53
mov ebx,1
mov ecx,[socket]
mcall
or eax,-1
mcall
data_arrived:
mov eax,5 ; wait a second for everything to arrive
mov ebx,10
mcall
mov edi,I_END
get_data:
mov eax,53
mov ebx,3
mov ecx,[socket]
mcall
mov [edi],bl
inc edi
mov eax,53
mov ebx,2
mov ecx,[socket]
mcall
cmp eax,0
jne get_data
cmp byte [I_END],'C' ;Connect ?
jne no_con
mov eax,4
mov ebx,10*65536+60
add ebx,[y]
mov ecx,0x000000
mov edx,inp_con
mov esi,inp_con.len
mcall
add [y],10
jmp still
no_con:
cmp byte [I_END],'S' ; Shutdown ?
jne no_shut
mov eax,4
mov ebx,10*65536+60
add ebx,[y]
mov ecx,0x000000
mov edx,inp_shut
mov esi,inp_shut.len
mcall
add [y],10
mov eax,18
mov ebx,9
mov ecx,2
mcall
jmp still
no_shut:
cmp byte [I_END],'R' ; Reboot ?
jne no_reb
mov eax,4
mov ebx,10*65536+60
add ebx,[y]
mov ecx,0x000000
mov edx,inp_reb
mov esi,inp_reb.len
mcall
add [y],10
mov eax,18
mov ebx,9
mov ecx,3
mcall
jmp still
no_reb:
cmp byte [I_END],'F' ; Save image on floppi ?
jne no_savefi
mov eax,4
mov ebx,10*65536+60
add ebx,[y]
mov ecx,0x000000
mov edx,inp_savefi
mov esi,inp_savefi.len
mcall
add [y],10
mov eax,18
mov ebx,9
mov ecx,1
mcall
jmp still
no_savefi:
cmp byte [I_END],'H' ; Save image on hard disk ?
jne no_savehi
mov eax,4
mov ebx,10*65536+60
add ebx,[y]
mov ecx,0x000000
mov edx,inp_savehi
mov esi,inp_savehi.len
mcall
add [y],10
mov eax,18
mov ebx,6
mov ecx,2
mcall
jmp still
no_savehi:
cmp byte [I_END],'O' ; Hot reboot ?
jne no_hotreb
mov eax,4
mov ebx,10*65536+60
add ebx,[y]
mov ecx,0x000000
mov edx,inp_hotreb
mov esi,inp_hotreb.len
mcall
add [y],10
mov eax,18
mov ebx,9
mov ecx,4
mcall
jmp still
no_hotreb:
cmp byte [I_END],'E' ; Unload server ?
jne no_com
mov eax,4
mov ebx,10*65536+60
add ebx,[y]
mov ecx,0x000000
mov edx,inp_exit
mov esi,inp_exit.len
mcall
add [y],10
call button
jmp still
no_com:
mov eax,4
mov ebx,10*65536+60
add ebx,[y]
mov ecx,0x000000
mov edx,inp_com
mov esi,inp_com.len
mcall
add [y],10
jmp still
; *********************************************
; ******* WINDOW DEFINITIONS AND DRAW ********
; *********************************************
draw_window:
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,1 ; 1, start of draw
mcall
; DRAW WINDOW
mov eax,0 ; function 0 : define and draw window
mov ebx,100*65536+300 ; [x start] *65536 + [x size]
mov ecx,100*65536+330 ; [y start] *65536 + [y size]
mov edx,0x14ffffff ; color of work area RRGGBB
mov edi,title ; WINDOW LABEL
mcall
; Re-draw the screen text
cld
mov eax,4
mov ebx,10*65536+30 ; draw info text with function 4
mov ecx,0x000000
mov edx,text
mov esi,40
newline:
mcall
add ebx,16
add edx,40
cmp [edx],byte 'x'
jnz newline
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,2 ; 2, end of draw
mcall
ret
; DATA AREA
text:
if lang eq ru
db '„ ­­ë©  ¤à¥á : 192.168.0.2 '
db '<27>à®á«ã訢 ¥¬ë© ¯®àâ : 0x6100 '
db '‘®áâ®ï­¨¥: '
db 'x' ; <- END MARKER, DONT DELETE
else
db 'This address : 192.168.0.2 '
db 'Used port : 0x6100 '
db 'Status: '
db 'x' ; <- END MARKER, DONT DELETE
end if
title db 'Remote Control Center(Server)',0
socket dd 0x0
y dd 0x10
sysclock dd 0x0
if lang eq ru
inp_con db '‚­¨¬ ­¨¥, ¯®¤ª«î稫áï ª«¨¥­â!'
.len = $-inp_con
inp_shut db 'ˆ¤ñ⠮⪫î祭¨¥ á¨á⥬ë...'
.len = $-inp_shut
inp_reb db 'ˆ¤ñâ ¯¥à¥§ £à㧪 ...'
.len = $-inp_reb
inp_savefi db '‘®å࠭塞 ¨¬¥¤¦ ­  ¤¨áª¥âã...'
.len = $-inp_savefi
inp_savehi db '‘®å࠭塞 ¨¬¥¤¦ ­  †. ¤¨áª...'
.len = $-inp_savehi
inp_hotreb db 'ˆ¤ñâ £®àï稩 à¥áâ àâ ï¤à ...'
.len = $-inp_hotreb
inp_exit db '‚ë室 ¨§ ¯à®£à ¬¬ë...'
.len = $-inp_exit
inp_com db '<27>¥®¯®§­ ­­ ï ª®¬¬ ­¤ !'
.len = $-inp_com
else
inp_con db 'Note, client has been connected!'
.len = $-inp_con
inp_shut db 'Turn off in progress...'
.len = $-inp_shut
inp_reb db 'Reboot in progress...'
.len = $-inp_reb
inp_savefi db 'Saving image to floppy...'
.len = $-inp_savefi
inp_savehi db 'Saving image to hard disk...'
.len = $-inp_savehi
inp_hotreb db 'Kernel restart in progress...'
.len = $-inp_hotreb
inp_exit db 'Exiting from program...'
.len = $-inp_exit
inp_com db 'Unknown command!'
.len = $-inp_com
end if
I_END:

View File

@ -1,5 +0,0 @@
@erase lang.inc
@echo lang fix en >lang.inc
@fasm remote.asm remote
@erase lang.inc
@pause

View File

@ -1,5 +0,0 @@
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm remote.asm remote
@erase lang.inc
@pause

View File

@ -1,208 +0,0 @@
;
; Remote processing example (remote node) - vt
;
; Compile with FASM for Menuet
;
use32
org 0x0
db 'MENUET01' ; header
dd 0x01 ; header version
dd START ; entry point
dd I_END ; image size
dd I_END+0x10000 ; required memory
dd I_END+0x10000 ; esp
dd 0x0 , 0x0 ; I_Param , I_Path
include 'lang.inc'
include '..\..\..\macros.inc'
remote_ip db 192,168,1,26
START: ; start of execution
mov eax, 53 ; open receiver socket
mov ebx, 0
mov ecx, 0x3000 ; local port
mov edx, 0xffff ; remote port
mov esi, dword [remote_ip] ; remote IP
mcall
mov [socketNum],eax
mov [0],eax ; save for remote code
red:
call draw_window ; at first, draw the window
still:
mov eax,23 ; wait here for event
mov ebx,1
mcall
cmp eax,1 ; redraw request ?
jz red
cmp eax,2 ; key in buffer ?
jz key
cmp eax,3 ; button in buffer ?
jz button
mov eax,53 ; data from cluster terminal ?
mov ebx,2
mov ecx,[socketNum]
mcall
cmp eax,0
jne data_arrived
jmp still
key:
mov eax,2
mcall
jmp still
button:
mov eax,53
mov ebx,1
mov ecx,[socketNum]
mcall
or eax,-1
mcall
data_arrived:
mov eax,5 ; wait a second for everything to arrive
mov ebx,10
mcall
mov edi,I_END
get_data:
mov eax,53
mov ebx,3
mov ecx,[socketNum]
mcall
mov [edi],bl
inc edi
mov eax,53
mov ebx,2
mov ecx,[socketNum]
mcall
cmp eax,0
jne get_data
add byte [I_END+14],48
mov eax,4
mov ebx,10*65536+50
add ebx,[y]
mov ecx,0x000000
mov edx,I_END
mov esi,23
mcall
add [y],10
cmp byte [I_END+14],'1' ; DATA PACKET ?
jne no_packet
mov esi,I_END+23
mov edi,[I_END+15]
mov ecx,[I_END+19]
cld
rep movsb
jmp still
no_packet:
cmp byte [I_END+14],'2' ; EXECUTE ?
jne no_execute
mov eax,[I_END+15]
call eax
jmp still
no_execute:
jmp still
y dd 0x10
; *********************************************
; ******* WINDOW DEFINITIONS AND DRAW ********
; *********************************************
draw_window:
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,1 ; 1, start of draw
mcall
; DRAW WINDOW
mov eax,0 ; function 0 : define and draw window
mov ebx,100*65536+286 ; [x start] *65536 + [x size]
mov ecx,100*65536+330 ; [y start] *65536 + [y size]
mov edx,0x14ffffff ; color of work area RRGGBB
mov edi,title ; WINDOW LABEL
mcall
; Re-draw the screen text
cld
mov eax,4
mov ebx,10*65536+30 ; draw info text with function 4
mov ecx,0x000000
mov edx,text
mov esi,40
newline:
mcall
add ebx,16
add edx,40
cmp [edx],byte 'x'
jnz newline
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,2 ; 2, end of draw
mcall
ret
; DATA AREA
text:
db 'THIS NODE : 192.168.1.22 '
db 'LISTENING TO PORT : 0x3000 '
db 'x' ;<- END MARKER, DONT DELETE
title db 'CLUSTER REMOTE',0
socketNum dd 0x0
send_data db 'MenuetRemote00' ; 00 header ; -> remote port 0x3000
db 1 ; 14 send
dd 0x0 ; 15 position
dd 0x0 ; 19 size
; 23
execute db 'MenuetRemote00' ; 00 header ; -> remote port 0x3000
db 2 ; 14 execute
dd 0x0 ; 15 position
; 19
I_END:

View File

@ -1,5 +0,0 @@
@erase lang.inc
@echo lang fix en >lang.inc
@fasm smtps.asm smtps
@erase lang.inc
@pause

View File

@ -1,5 +0,0 @@
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm smtps.asm smtps
@erase lang.inc
@pause

View File

@ -1,828 +0,0 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; SMTP server for MenuetOS ;;
;; ;;
;; License: GPL / See file COPYING for details ;;
;; Copyright 2002 (c) Ville Turjanmaa ;;
;; ;;
;; Compile with FASM for Menuet ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
version equ '0.1'
use32
org 0x0
db 'MENUET01' ; 8 byte id
dd 0x01 ; required os
dd START ; program start
dd I_END ; program image size
dd 0x200000 ; required amount of memory
dd 0xffff0
dd 0,0
include '..\..\..\macros.inc'
save_file:
; cmp [file_start],0x100000+10
; jbe nosub
; sub [file_start],8
; nosub:
mov eax,[file_start]
sub eax,0x100000
mov ebx,files
mov [ebx+12],eax
mov eax,70
mcall
ret
START: ; start of execution
mov [file_start],0x100000
mov eax,70
mov ebx,filel
mcall
test eax,eax
jz @f
cmp eax,6
jnz notfound
@@:
add [file_start],ebx
notfound:
mov edi,I_END
mov ecx,60*120
mov al,32
cld
rep stosb
mov eax,[rxs]
imul eax,11
mov [pos],eax
mov ebp,0
mov edx,I_END
redraw:
call draw_window ; at first, draw the window
still:
inc [cursor_on_off]
mov eax,5
mov ebx,1
mcall
mov eax,11 ; wait here for event
mcall
cmp eax,1 ; redraw
je redraw
cmp eax,2 ; key
je key
cmp eax,3 ; button
je button
cmp [I_END+120*60],byte 1
jne no_main_update
mov [I_END+120*60],byte 0
mov edx,I_END
call draw_channel_text
no_main_update:
cmp [server_active],0
je noread
cmp [status],4
jne noread
call read_incoming_data
inc [close_connection]
cmp [close_connection],15*100
jbe noread
call yq
noread:
call print_status
cmp [status],4
je check_header
jmp still
check_header:
cmp [header_sent],1
je still
mov eax,53
mov ebx,7
mov ecx,[socket]
mov edx,6
mov esi,r220
mcall
mov [header_sent],1
jmp still
button: ; button
mov eax,17 ; get id
mcall
cmp ah,1 ; close program
jne noclose
or eax,-1
mcall
noclose:
call socket_commands
jmp still
old_status dd 0x0
print_status:
pusha
mov eax,53
mov ebx,6
mov ecx,[socket]
mcall
mov [status],eax
cmp eax,[old_status]
je no_print
mov [old_status],eax
push eax
mov eax,13
mov ebx,360*65536+30
mov ecx,151*65536+10
mov edx,0xffffff
mcall
pop ecx
mov eax,47
mov ebx,3*65536
mov edx,360*65536+151
mov esi,0x000000
cmp [server_active],0
je no_print
mcall
no_print:
popa
ret
socket_commands:
cmp ah,22 ; open socket
jnz tst3
mov eax,3
mcall
mov [server_active],1
mov eax,53
mov ebx,5
mov ecx,25 ; local port # - http
mov edx,0 ; no remote port specified
mov esi,0 ; no remote ip specified
mov edi,0 ; PASSIVE open
mcall
mov [socket], eax
ret
tst3:
cmp ah,24 ; close socket
jnz no_24
mov eax,53
mov ebx,8
mov ecx,[socket]
mcall
mov [header_sent],0
mov [mail_rp],0
mov [server_active],0
ret
no_24:
ret
key:
mov eax,2
mcall
jmp still
read_incoming_data:
pusha
read_new_byte:
call read_incoming_byte
cmp ecx,-1
je no_data_in_buffer
mov eax,[file_start]
mov [eax],bl
inc [file_start]
cmp bl,10
jne no_start_command
mov [cmd],1
no_start_command:
cmp bl,13
jne no_end_command
mov eax,[cmd]
mov [eax+command-2],byte 0
call analyze_command
mov edi,command
mov ecx,250
mov eax,0
cld
rep stosb
mov [cmd],0
no_end_command:
mov eax,[cmd]
cmp eax,250
jge still
mov [eax+command-2],bl
inc [cmd]
jmp read_new_byte
no_data_in_buffer:
popa
ret
analyze_command:
pusha
mov [text_start],I_END
mov ecx,[rxs]
imul ecx,11
mov [pos],ecx
mov bl,13
call print_character
mov bl,10
call print_character
cmp [cmd],2
jbe nott
mov ecx,[cmd]
sub ecx,2
mov esi,command+0
newcmdc:
mov bl,[esi]
call print_character
inc esi
loop newcmdc
nott:
mov edx,I_END
call draw_channel_text
cmd_len_ok:
cmp [command],dword 'data'
je datacom
cmp [command],dword 'DATA'
je datacom
cmp [command],dword 'Data'
je datacom
jmp nodatacom
datacom:
inc [mail_rp]
mov eax,53
mov ebx,7
mov ecx,[socket]
mov edx,6
mov esi,r354
mcall
mov [cmd],0
popa
ret
nodatacom:
cmp [mail_rp],0
jne nomrp0
mov eax,53
mov ebx,7
mov ecx,[socket]
mov edx,6
mov esi,r250
mcall
mov [cmd],0
popa
ret
nomrp0:
cmp [command],dword 'QUIT'
je yesquit
cmp [command],dword 'Quit'
je yesquit
cmp [command],dword 'quit'
je yesquit
jmp noquit
yq:
pusha
yesquit:
mov [close_connection],0
mov eax,53
mov ebx,7
mov ecx,[socket]
mov edx,6
mov esi,r221
mcall
mov [cmd],0
mov eax,5
mov ebx,5
mcall
mov eax,53
mov ebx,8
mov ecx,[socket]
mcall
mov eax,5
mov ebx,5
mcall
mov eax,53
mov ebx,8
mov ecx,[socket]
mcall
mov [header_sent],0
mov [mail_rp],0
call save_file
mov eax,5
mov ebx,20
mcall
mov eax,53
mov ebx,5
mov ecx,25 ; local port # - http
mov edx,0 ; no remote port specified
mov esi,0 ; no remote ip specified
mov edi,0 ; PASSIVE open
mcall
mov [socket], eax
popa
ret
noquit:
cmp [command],byte '.'
jne nodot
mov eax,53
mov ebx,7
mov ecx,[socket]
mov edx,6
mov esi,r250
mcall
mov [cmd],0
popa
ret
nodot:
popa
ret
r250 db '250 ',13,10
r221 db '221 ',13,10
r220 db '220 ',13,10
r354 db '354 ',13,10
draw_data:
pusha
add eax,[text_start]
mov [eax],bl
popa
ret
print_text:
pusha
mov ecx,command-2
add ecx,[cmd]
ptr2:
mov bl,[eax]
cmp bl,dl
je ptr_ret
cmp bl,0
je ptr_ret
call print_character
inc eax
cmp eax,ecx
jbe ptr2
ptr_ret:
mov eax,[text_start]
mov [eax+120*60],byte 1
popa
ret
print_character:
pusha
cmp bl,13 ; line beginning
jne nobol
mov ecx,[pos]
add ecx,1
boll1:
sub ecx,1
mov eax,ecx
xor edx,edx
mov ebx,[rxs]
div ebx
cmp edx,0
jne boll1
mov [pos],ecx
jmp newdata
nobol:
cmp bl,10 ; line down
jne nolf
addx1:
add [pos],dword 1
mov eax,[pos]
xor edx,edx
mov ecx,[rxs]
div ecx
cmp edx,0
jnz addx1
mov eax,[pos]
jmp cm1
nolf:
no_lf_ret:
cmp bl,15 ; character
jbe newdata
mov eax,[irc_data]
shl eax,8
mov al,bl
mov [irc_data],eax
mov eax,[pos]
call draw_data
mov eax,[pos]
add eax,1
cm1:
mov ebx,[scroll+4]
imul ebx,[rxs]
cmp eax,ebx
jb noeaxz
mov esi,[text_start]
add esi,[rxs]
mov edi,[text_start]
mov ecx,ebx
cld
rep movsb
mov esi,[text_start]
mov ecx,[rxs]
imul ecx,61
add esi,ecx
mov edi,[text_start]
mov ecx,[rxs]
imul ecx,60
add edi,ecx
mov ecx,ebx
cld
rep movsb
mov eax,ebx
sub eax,[rxs]
noeaxz:
mov [pos],eax
newdata:
mov eax,[text_start]
mov [eax+120*60],byte 1
popa
ret
read_incoming_byte:
mov eax, 53
mov ebx, 2
mov ecx, [socket]
mcall
mov ecx,-1
cmp eax,0
je no_more_data
mov eax, 53
mov ebx, 3
mov ecx, [socket]
mcall
mov ecx,0
no_more_data:
ret
draw_window:
pusha
mov eax,12
mov ebx,1
mcall
mov [old_status],300
mov eax,0 ; draw window
mov ebx,5*65536+400
mov ecx,5*65536+200
mov edx,0x13ffffff
mov edi,title
mcall
mov eax,8 ; button: open socket
mov ebx,23*65536+22
mov ecx,169*65536+10
mov edx,22
mov esi,0x55aa55
mcall
; mov eax,8 ; button: close socket
mov ebx,265*65536+22
mov edx,24
mov esi,0xaa5555
mcall
mov eax,38 ; line
mov ebx,5*65536+395
mov ecx,108*65536+108
mov edx,0x000000
mcall
mov eax,4
mov ebx,5*65536+123 ; info text
mov ecx,0x000000
mov edx,text
mov esi,70
newline:
mcall
add ebx,12
add edx,70
cmp [edx],byte 'x'
jne newline
mov edx,I_END ; text from server
call draw_channel_text
mov eax,12
mov ebx,2
mcall
popa
ret
draw_channel_text:
pusha
mov eax,4
mov ebx,10*65536+26
mov ecx,[scroll+4]
mov esi,[rxs]
dct:
pusha
mov cx,bx
shl ecx,16
mov cx,9
mov eax,13
mov ebx,10*65536
mov bx,word [rxs]
imul bx,6
mov edx,0xffffff
mcall
popa
push ecx
mov eax,4
mov ecx,0
cmp [edx],word '* '
jne no_red
mov ecx,0xff0000
no_red:
cmp [edx],word '**'
jne no_light_blue
cmp [edx+2],byte '*'
jne no_light_blue
mov ecx,0x0000ff
no_light_blue:
cmp [edx],byte '#'
jne no_blue
mov ecx,0x00ff00
no_blue:
mcall
add edx,[rxs]
add ebx,10
pop ecx
loop dct
popa
ret
text:
db ' Incoming mails are written to /sys/smtps.txt '
db ' The file can be fetched with TinyServer and a Html-browser. '
db ' Timeout is set to 15 seconds. '
db ' '
db ' Open SMTP server port 25 Close SMTP '
db 'x' ; <- END MARKER, DONT DELETE
irc_server_ip db 192,168,1,1
file_start dd 0x100000
files:
dd 2,0,0,?,0x100000
db '/sys/smtps.txt',0
filel:
dd 0,0,0,0x100000,0x100000
db '/sys/smtps.txt',0
server_active dd 0
status dd 0x0
header_sent db 0
channel_temp: times 100 db 0
channel_temp_length dd 0x0
close_connection dd 0x0
mail_rp dd 0
socket dd 0x0
bgc dd 0x000000
dd 0x000000
dd 0x00ff00
dd 0x0000ff
dd 0x005500
dd 0xff00ff
dd 0x00ffff
dd 0x770077
tc dd 0xffffff
dd 0xff00ff
dd 0xffffff
dd 0xffffff
dd 0xffffff
dd 0xffffff
dd 0xffffff
dd 0xffffff
cursor_on_off dd 0x0
max_windows dd 20
thread_stack dd 0x9fff0
thread_nro dd 1
thread_screen dd I_END+120*80*1
action_header_blue db 10,'*** ',0
action_header_red db 10,'*** ',0
action_header_short db 10,'* ',0
posx dd 0x0
incoming_pos dd 0x0
incoming_string: times 128 db 0
pos dd 0x0
text_start dd I_END
irc_data dd 0x0
print db 0x0
cmd dd 0x0
rxs dd 56
res: db 0,0
command: times 256 db 0x0
nick dd 0,0,0
irc_command dd 0,0
command_position dd 0x0
counter dd 0
send_to_server db 0
channel_list: times 32*20 db 32
send_to_channel dd 0x0
send_string: times 100 db 0x0
xpos dd 0
attribute dd 0
scroll dd 1
dd 8
numtext db ' '
title db 'Tiny SMTP email server v ',version,0
I_END:

View File

@ -1,5 +0,0 @@
@erase lang.inc
@echo lang fix en >lang.inc
@fasm tftpa.asm tftpa
@erase lang.inc
@pause

View File

@ -1,5 +0,0 @@
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm tftpa.asm tftpa
@erase lang.inc
@pause

View File

@ -1,725 +0,0 @@
;
; TFTP Wave Player
;
; Compile with FASM for Menuet
;
;
; 12.7.2002 - Audio system calls by VT
;
use32
org 0x0
db 'MENUET01' ; header
dd 0x01 ; header version
dd START ; entry point
dd I_END ; image size
dd I_END+0x10000 ; required memory
dd I_END+0x10000 ; esp
dd 0x0 , 0x0 ; I_Param , I_Path
include 'lang.inc'
include '..\..\..\macros.inc'
delay dd 145
wait_for dd 0x0
START: ; start of execution
mov dword [prompt], p9
mov dword [promptlen], p9len - p9
red:
call draw_window ; at first, draw the window
still:
mov eax,10 ; wait here for event
mcall
cmp eax,1 ; redraw request ?
jz red
cmp eax,2 ; key in buffer ?
jz key
cmp eax,3 ; button in buffer ?
jz button
jmp still
key: ; Keys are not valid at this part of the
mov eax,2 ; loop. Just read it and ignore
mcall
jmp still
button: ; button
mov eax,17 ; get id
mcall
cmp ah,1 ; button id=1 ?
jnz noclose
; close socket before exiting
mov eax, 53
mov ebx, 1
mov ecx, [socketNum]
mcall
mov [socketNum], dword 0
or eax,-1 ; close this program
mcall
noclose:
cmp ah,2 ; copy file to local machine?
jnz nocopyl
mov dword [prompt], p5
mov dword [promptlen], p5len - p5
call draw_window ;
; Copy File from Remote Host to this machine
call translateData ; Convert Filename & IP address
mov edi, tftp_filename + 1
mov [edi], byte 0x01 ; setup tftp msg
call copyFromRemote
jmp still
nocopyl:
cmp ah,4
jz f1
cmp ah,5
jz f2
jmp nof12
f1:
mov [addr],dword source
mov [ya],dword 35
jmp rk
f2:
mov [addr],dword destination
mov [ya],dword 35+16
rk:
mov ecx,15
mov edi,[addr]
mov al,' '
rep stosb
call print_text
mov edi,[addr]
f11:
mov eax,10
mcall
cmp eax,2
jz fbu
jmp still
fbu:
mov eax,2
mcall ; get key
shr eax,8
cmp eax,8
jnz nobs
cmp edi,[addr]
jz f11
sub edi,1
mov [edi],byte ' '
call print_text
jmp f11
nobs:
cmp eax,dword 31
jbe f11
cmp eax,dword 95
jb keyok
sub eax,32
keyok:
mov [edi],al
call print_text
add edi,1
mov esi,[addr]
add esi,15
cmp esi,edi
jnz f11
jmp still
print_text:
mov eax,13
mov ebx,103*65536+15*6
mov ecx,[ya]
shl ecx,16
mov cx,8
mov edx,0x224466
mcall
mov eax,4
mov ebx,103*65536
add ebx,[ya]
mov ecx,0xffffff
mov edx,[addr]
mov esi,15
mcall
ret
nof12:
jmp still
;***************************************************************************
; Function
; translateData
;
; Description
; Coverts the filename and IP address typed in by the user into
; a format suitable for the IP layer.
;
; The filename, in source, is converted and stored in tftp_filename
; The host ip, in destination, is converted and stored in tftp_IP
;
;***************************************************************************
translateData:
; first, build up the tftp command string. This includes the filename
; and the transfer protocol
; First, write 0,0
mov al, 0
mov edi, tftp_filename
mov [edi], al
inc edi
mov [edi], al
inc edi
; Now, write the file name itself, and null terminate it
mov ecx, 15
mov ah, ' '
mov esi, source
td001:
lodsb
stosb
cmp al, ah
loopnz td001
cmp al,ah ; Was the entire buffer full of characters?
jne td002
dec edi ; No - so remove ' ' character
td002:
mov [edi], byte 0
inc edi
mov [edi], byte 'O'
inc edi
mov [edi], byte 'C'
inc edi
mov [edi], byte 'T'
inc edi
mov [edi], byte 'E'
inc edi
mov [edi], byte 'T'
inc edi
mov [edi], byte 0
mov esi, tftp_filename
sub edi, esi
mov [tftp_len], edi
; Now, convert the typed IP address into a real address
; No validation is done on the number entered
; ip addresses must be typed in normally, eg
; 192.1.45.24
xor eax, eax
mov dh, 10
mov dl, al
mov [tftp_IP], eax
; 192.168.24.1 1.1.1.1 1. 9.2.3.
mov esi, destination
mov edi, tftp_IP
mov ecx, 4
td003:
lodsb
sub al, '0'
add dl, al
lodsb
cmp al, '.'
je ipNext
cmp al, ' '
je ipNext
mov dh, al
sub dh, '0'
mov al, 10
mul dl
add al, dh
mov dl, al
lodsb
cmp al, '.'
je ipNext
cmp al, ' '
je ipNext
mov dh, al
sub dh, '0'
mov al, 10
mul dl
add al, dh
mov dl, al
lodsb
ipNext:
mov [edi], dl
inc edi
mov dl, 0
loop td003
ret
;***************************************************************************
; Function
; copyFromRemote
;
; Description
;
;***************************************************************************
copyFromRemote:
mov eax,0x20000-512
mov [fileposition], eax
; Get a random # for the local socket port #
mov eax, 3
mcall
mov ecx, eax
shr ecx, 8 ; Set up the local port # with a random #
; open socket
mov eax, 53
mov ebx, 0
mov edx, 69 ; remote port
mov esi, [tftp_IP] ; remote IP ( in intenet format )
mcall
mov [socketNum], eax
; make sure there is no data in the socket - there shouldn't be..
cfr001:
mov eax, 53
mov ebx, 3
mov ecx, [socketNum]
mcall ; read byte
mov eax, 53
mov ebx, 2
mov ecx, [socketNum]
mcall ; any more data?
cmp eax, 0
jne cfr001 ; yes, so get it
; Now, request the file
mov eax, 53
mov ebx, 4
mov ecx, [socketNum]
mov edx, [tftp_len]
mov esi, tftp_filename
mcall
cfr002:
mov eax,23 ; wait here for event
mov ebx,1 ; Time out after 10ms
mcall
cmp eax,1 ; redraw request ?
je cfr003
cmp eax,2 ; key in buffer ?
je cfr004
cmp eax,3 ; button in buffer ?
je cfr005
; Any data to fetch?
mov eax, 53
mov ebx, 2
mov ecx, [socketNum]
mcall
cmp eax, 0
je cfr002
push eax ; eax holds # chars
; Update the text on the display - once
mov eax, [prompt]
cmp eax, p3
je cfr008
mov dword [prompt], p3
mov dword [promptlen], p3len - p3
call draw_window ;
cfr008:
; we have data - this will be a tftp frame
; read first two bytes - opcode
mov eax, 53
mov ebx, 3
mov ecx, [socketNum]
mcall ; read byte
mov eax, 53
mov ebx, 3
mov ecx, [socketNum]
mcall ; read byte
pop eax
; bl holds tftp opcode. Can only be 3 (data) or 5 ( error )
cmp bl, 3
jne cfrerr
push eax
; do data stuff. Read block #. Read data. Send Ack.
mov eax, 53
mov ebx, 3
mov ecx, [socketNum]
mcall ; read byte
mov [blockNumber], bl
mov eax, 53
mov ebx, 3
mov ecx, [socketNum]
mcall ; read byte
mov [blockNumber+1], bl
cfr007:
mov eax, 53
mov ebx, 3
mov ecx, [socketNum]
mcall ; read byte
mov esi, [fileposition]
mov [esi], bl
mov [esi+1],bl
add dword [fileposition],2
mov eax, 53
mov ebx, 2
mov ecx, [socketNum]
mcall ; any more data?
cmp eax, 0
jne cfr007 ; yes, so get it
cmp [fileposition],0x20000+0xffff
jb get_more_stream
wait_more:
mov eax,5 ; wait for correct timer position
; to trigger new play block
mov ebx,1
mcall
mov eax,26
mov ebx,9
mcall
cmp eax,[wait_for]
jb wait_more
add eax,[delay]
mov [wait_for],eax
mov esi,0x20000
mov edi,0x10000
mov ecx,65536
cld
rep movsb
mov eax,55
mov ebx,0
mov ecx,0x10000
mcall
mov eax,55
mov ebx,1
mcall
mov [fileposition],0x20000
get_more_stream:
; write the block number into the ack
mov al, [blockNumber]
mov [ack + 2], al
mov al, [blockNumber+1]
mov [ack + 3], al
; send an 'ack'
mov eax, 53
mov ebx, 4
mov ecx, [socketNum]
mov edx, ackLen - ack
mov esi, ack
mcall
; If # of chars in the frame is less that 516,
; this frame is the last
pop eax
cmp eax, 516
je cfr002
; Write the file
mov eax, 33
mov ebx, source
mov edx, [filesize]
mov ecx, I_END + 512
mov esi, 0
mcall
jmp cfrexit
cfrerr:
; simple implementation on error - just read all data, and return
mov eax, 53
mov ebx, 3
mov ecx, [socketNum]
mcall ; read byte
mov eax, 53
mov ebx, 2
mov ecx, [socketNum]
mcall ; any more data?
cmp eax, 0
jne cfrerr ; yes, so get it
jmp cfr006 ; close socket and close app
cfr003: ; redraw request
call draw_window
jmp cfr002
cfr004: ; key pressed
mov eax,2 ; just read it and ignore
mcall
jmp cfr002
cfr005: ; button
mov eax,17 ; get id
mcall
cmp ah,1 ; button id=1 ?
jne cfr002 ; If not, ignore.
cfr006:
; close socket
mov eax, 53
mov ebx, 1
mov ecx, [socketNum]
mcall
mov [socketNum], dword 0
mov eax,-1 ; close this program
mcall
jmp $
cfrexit:
; close socket
mov eax, 53
mov ebx, 1
mov ecx, [socketNum]
mcall
mov [socketNum], dword 0
mov dword [prompt], p4
mov dword [promptlen], p4len - p4
call draw_window ;
ret
; *********************************************
; ******* WINDOW DEFINITIONS AND DRAW ********
; *********************************************
draw_window:
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,1 ; 1, start of draw
mcall
; DRAW WINDOW
mov eax,0 ; function 0 : define and draw window
mov ebx,100*65536+230 ; [x start] *65536 + [x size]
mov ecx,100*65536+170 ; [y start] *65536 + [y size]
mov edx,0x14224466 ; color of work area RRGGBB
mov edi,title
mcall
mov eax,8 ; DELETE BUTTON
mov ebx,20*65536+190
mov ecx,111*65536+15
mov edx,2
mov esi,0x557799
mcall
mov ebx,200*65536+10
mov ecx,34*65536+10
mov edx,4
mcall
mov ecx,50*65536+10
mov edx,5
mcall
; Copy the file name to the screen buffer
; file name is same length as IP address, to
; make the math easier later.
cld
mov esi,source
mov edi,text+13
mov ecx,15
rep movsb
; copy the IP address to the screen buffer
mov esi,destination
mov edi,text+40+13
mov ecx,15
rep movsb
; copy the prompt to the screen buffer
mov esi,[prompt]
mov edi,text+280
mov ecx,[promptlen]
rep movsb
; Re-draw the screen text
cld
mov eax,4
mov ebx,25*65536+35 ; draw info text with function 4
mov ecx,0xffffff
mov edx,text
mov esi,40
newline:
mcall
add ebx,16
add edx,40
cmp [edx],byte 'x'
jnz newline
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,2 ; 2, end of draw
mcall
ret
; DATA AREA
source db 'HEAT8M22.WAV '
destination db '192.168.1.24 '
tftp_filename: times 15 + 9 db 0
tftp_IP: dd 0
tftp_len: dd 0
addr dd 0x0
ya dd 0x0
fileposition dd 0 ; Points to the current point in the file
filesize dd 0 ; The number of bytes written / left to write
fileblocksize dw 0 ; The number of bytes to send in this frame
text:
db 'SOURCE FILE: xxxxxxxxxxxxxxx '
db 'HOST IP ADD: xxx.xxx.xxx.xxx '
db ' '
db 'WAVE FORMAT: 8 BIT,MONO,22050HZ '
db ' '
db ' SERVER -> PLAY FILE '
db ' '
db ' '
db 'x' ; <- END MARKER, DONT DELETE
title db 'TFTP Wave Player',0
prompt: dd 0
promptlen: dd 0
p1: db 'Waiting for Command '
p1len:
p9: db 'Define SB with setup'
p9len:
p2: db 'Sending File '
p2len:
p3: db 'Playing File '
p3len:
p4: db 'Complete '
p4len:
p5: db 'Contacting Host... '
p5len:
p6: db 'File not found. '
p6len:
ack:
db 00,04,0,1
ackLen:
socketNum:
dd 0
blockNumber:
dw 0
; This must be the last part of the file, because the blockBuffer
; continues at I_END.
blockBuffer:
db 00, 03, 00, 01
I_END:

View File

@ -1,5 +0,0 @@
@erase lang.inc
@echo lang fix en >lang.inc
@fasm ym.asm ym
@erase lang.inc
@pause

View File

@ -1,5 +0,0 @@
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm ym.asm ym
@erase lang.inc
@pause

File diff suppressed because it is too large Load Diff