Subversion Repositories Kolibri OS

Rev

Rev 3947 | Rev 4655 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3947 Rev 4468
Line 1... Line 1...
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
;;                                                                 ;;
2
;;                                                                 ;;
3
;; Copyright (C) KolibriOS team 2010-2013. All rights reserved.    ;;
3
;; Copyright (C) KolibriOS team 2010-2014. All rights reserved.    ;;
4
;; Distributed under terms of the GNU General Public License       ;;
4
;; Distributed under terms of the GNU General Public License       ;;
5
;;                                                                 ;;
5
;;                                                                 ;;
6
;;  tftpc.asm - TFTP client for KolibriOS                          ;;
6
;;  tftpc.asm - TFTP client for KolibriOS                          ;;
7
;;                                                                 ;;
7
;;                                                                 ;;
8
;;  Written by hidnplayr@kolibrios.org                             ;;
8
;;  Written by hidnplayr@kolibrios.org                             ;;
Line 80... Line 80...
80
        stdcall dll.Load, @IMPORT
80
        stdcall dll.Load, @IMPORT
81
        or      eax, eax
81
        or      eax, eax
82
        jnz     exit
82
        jnz     exit
Line 83... Line 83...
83
 
83
 
84
stop_transfer:
84
stop_transfer:
Line 85... Line 85...
85
        mcall   40, 0x80000027 ; 00100111b
85
        mcall   40, EVM_MOUSE + EVM_MOUSE_FILTER + EVM_REDRAW + EVM_BUTTON + EVM_KEY + EVM_STACK
86
 
86
 
Line 87... Line 87...
87
red_win:
87
red_win:
Line 98... Line 98...
98
        jz      key
98
        jz      key
Line 99... Line 99...
99
 
99
 
100
        dec     eax
100
        dec     eax
Line 101... Line 101...
101
        jz      button
101
        jz      button
102
 
102
 
-
 
103
        invoke  edit_box_mouse, edit1
-
 
104
        invoke  edit_box_mouse, edit2
Line 103... Line -...
103
        push    dword edit1
-
 
104
        call    [edit_box_mouse]
-
 
105
 
-
 
106
        push    dword edit2
-
 
107
        call    [edit_box_mouse]
-
 
108
 
-
 
109
        push    dword edit3
-
 
110
        call    [edit_box_mouse]
-
 
111
 
-
 
112
        push    dword edit4
-
 
113
        call    [edit_box_mouse]
105
        invoke  edit_box_mouse, edit3
114
 
-
 
115
        push    dword Option_boxs1
-
 
116
        call    [option_box_mouse]
106
        invoke  edit_box_mouse, edit4
Line 117... Line 107...
117
 
107
 
Line 118... Line 108...
118
        push    dword Option_boxs2
108
        invoke  option_box_mouse, Option_boxs1
119
        call    [option_box_mouse]
109
        invoke  option_box_mouse, Option_boxs2
Line 120... Line 110...
120
 
110
 
121
        jmp     still
111
        jmp     still
Line 122... Line -...
122
 
-
 
123
button:
112
 
124
        mcall   17
113
button:
Line -... Line 114...
-
 
114
        mcall   17
125
 
115
 
126
        cmp     ah,0x10
116
        cmp     ah, 0x10        ; connect button
127
        je      start_transfer
117
        je      start_transfer
Line 128... Line -...
128
 
-
 
129
 
118
 
130
        test    ah , ah
-
 
131
        jz      still
-
 
132
 
119
        test    ah , ah
133
exit:   mcall   -1
-
 
134
key:
-
 
135
        mcall   2
120
        jz      still
136
 
-
 
137
        push    dword edit1
-
 
138
        call    [edit_box_key]
121
 
Line 139... Line 122...
139
 
122
exit:
Line 140... Line -...
140
        push    dword edit2
-
 
141
        call    [edit_box_key]
123
        mcall   -1
142
 
124
key:
143
        push    dword edit3
125
        mcall   2
Line 144... Line 126...
144
        call    [edit_box_key]
126
 
Line -... Line 127...
-
 
127
        invoke  edit_box_key, edit1
-
 
128
        invoke  edit_box_key, edit2
-
 
129
        invoke  edit_box_key, edit3
-
 
130
        invoke  edit_box_key, edit4
-
 
131
 
-
 
132
        jmp still
-
 
133
 
-
 
134
 
-
 
135
draw_window:
-
 
136
; get system colors
-
 
137
        mcall   48, 3, sc, 40
145
 
138
 
146
        push    dword edit4
139
        mcall   12, 1
147
        call    [edit_box_key]
140
 
148
 
-
 
149
        jmp still
141
        mov     edx, [sc.work]
150
 
142
        or      edx, 0x34000000
151
 
143
        xor     esi, esi
152
align 4
-
 
153
draw_window:
144
        mov     edi, str_title
154
        mcall   12,1
145
        mcall   0, 50 shl 16 + 400, 30 shl 16 + 180
155
        mcall   0, (50*65536+400), (30*65536+180), 0x34AABBCC, 0x085080DD, str_title
146
 
156
 
-
 
157
        mcall   4, 35*65536+10, 0x80000000, str_server
147
        mov     ebx, 35 shl 16 + 10
158
 
148
        mov     ecx, 0x80000000
159
        mov     ebx, 5*65536+30
149
        or      ecx, [sc.work_text]
160
        mov     edx, str_source
-
 
161
        mcall
150
        mov     edx, str_server
162
 
151
        mcall   4
163
        mov     ebx, 11*65536+50
152
        mov     ebx, 5 shl 16 + 30
Line 164... Line 153...
164
        mov     edx, str_destination
153
        mov     edx, str_source
165
        mcall
154
        mcall
-
 
155
        mov     ebx, 11 shl 16 + 50
-
 
156
        mov     edx, str_destination
-
 
157
        mcall
-
 
158
        mov     ebx, 47 shl 16 + 72
-
 
159
        mov     edx, str_mode
-
 
160
        mcall
-
 
161
        mov     ebx, 160 shl 16 + 72
-
 
162
        mov     edx, str_method
-
 
163
        mcall
-
 
164
        mov     ebx, 270 shl 16 + 72
-
 
165
        mov     edx, str_blocksize
-
 
166
        mcall
-
 
167
 
-
 
168
        invoke  edit_box_draw, edit1
-
 
169
        invoke  edit_box_draw, edit2
-
 
170
        invoke  edit_box_draw, edit3
-
 
171
        invoke  edit_box_draw, edit4
Line 166... Line -...
166
 
-
 
167
        mov     ebx, 47*65536+72
172
 
Line 168... Line -...
168
        mov     edx, str_mode
-
 
169
        mcall
-
 
170
 
-
 
171
        mov     ebx, 160*65536+72
-
 
172
        mov     edx, str_method
-
 
173
        mcall
-
 
174
 
-
 
175
        mov     ebx, 270*65536+72
-
 
176
        mov     edx, str_blocksize
-
 
177
        mcall
-
 
178
 
-
 
179
        push    dword edit1
-
 
180
        call    [edit_box_draw]
-
 
181
 
-
 
182
        push    dword edit2
-
 
183
        call    [edit_box_draw]
-
 
184
 
-
 
185
        push    dword edit3
-
 
186
        call    [edit_box_draw]
-
 
187
 
-
 
188
        push    dword edit4
173
        invoke  option_box_draw, Option_boxs1
189
        call    [edit_box_draw]
-
 
190
 
-
 
191
        push    dword Option_boxs1
-
 
192
        call    [option_box_draw]
174
        invoke  option_box_draw, Option_boxs2
Line 193... Line 175...
193
 
175
 
Line 194... Line 176...
194
        push    dword Option_boxs2
176
        mov     esi, [sc.work_button]
Line 286... Line 268...
286
 
268
 
287
        sub     edi, I_END
269
        sub     edi, I_END
288
        mov     esi, edi
270
        mov     esi, edi
Line 289... Line 271...
289
        mcall   send, [socketnum], I_END
271
        mcall   send, [socketnum], I_END
Line 290... Line 272...
290
 
272
 
Line 291... Line -...
291
        mcall   40, 0x80000085 ; 10000101b
-
 
292
 
-
 
293
        mov     [last_ack], 0
273
        mcall   40, EVM_REDRAW + EVM_BUTTON + EVM_STACK
Line 294... Line 274...
294
 
274
 
Line 295... Line 275...
295
 
275
        mov     [last_ack], 0
Line 462... Line 442...
462
 
442
 
463
sockaddr:
443
sockaddr:
464
        dw AF_INET4
444
                dw AF_INET4
465
        dw 0x4500       ; 69
445
                dw 0x4500       ; 69
-
 
446
IP              db 192, 168, 1, 115
466
IP      db 192,168,1,115
447
 
Line 467... Line 448...
467
sockaddr_len = $ - sockaddr
448
sockaddr_len = $ - sockaddr
468
 
449
 
Line 505... Line 486...
505
        inet_ntoa               , 'inet_ntoa'           ,\
486
        inet_ntoa       , 'inet_ntoa'           ,\
506
        getaddrinfo             , 'getaddrinfo'         ,\
487
        getaddrinfo     , 'getaddrinfo'         ,\
507
        freeaddrinfo            , 'freeaddrinfo'
488
        freeaddrinfo    , 'freeaddrinfo'
Line 508... Line 489...
508
 
489
 
509
 
490
 
510
edit1 edit_box 300,80,5 ,0xffffff,0x6f9480,0,0,0,99 ,SRV,mouse_dd,ed_focus,  11,11
491
edit1 edit_box 300, 80, 5, 0xffffff, 0x6f9480, 0, 0, 0, 99, SRV, mouse_dd, ed_focus, 13, 13
511
edit2 edit_box 300,80,25,0xffffff,0x6a9480,0,0,0,99 ,remote_addr,mouse_dd,ed_figure_only, 5,5
492
edit2 edit_box 300, 80, 25, 0xffffff, 0x6a9480, 0, 0, 0, 99, remote_addr, mouse_dd, ed_figure_only, 5, 5
Line 512... Line 493...
512
edit3 edit_box 300,80,45,0xffffff,0x6a9480,0,0,0,99 ,local_addr,mouse_dd,ed_figure_only, 27,27
493
edit3 edit_box 300, 80, 45, 0xffffff, 0x6a9480, 0, 0, 0, 99, local_addr, mouse_dd, ed_figure_only, 27, 27
Line 521... Line 502...
521
option_group1   dd op1
502
option_group1   dd op1
522
option_group2   dd op3
503
option_group2   dd op3
523
Option_boxs1    dd op1,op2,0
504
Option_boxs1    dd op1, op2, 0
524
Option_boxs2    dd op3,op4,0
505
Option_boxs2    dd op3, op4, 0
Line 525... Line 506...
525
 
506
 
526
str_title       db 'TFTP client for KolibriOS',0
507
str_title       db 'TFTP client', 0
527
str_server      db 'Server:',0
508
str_server      db 'Server:', 0
528
str_source      db 'Remote file:',0
509
str_source      db 'Remote file:', 0
529
str_destination db 'Local file:',0
510
str_destination db 'Local file:', 0
530
str_mode        db 'Mode:',0
511
str_mode        db 'Mode:', 0
531
str_method      db 'Method:',0
512
str_method      db 'Method:', 0
532
str_blocksize   db 'Blocksize:',0
513
str_blocksize   db 'Blocksize:', 0
533
str_kb_s        db 'kb/s',0
514
str_kb_s        db 'kB/s', 0
534
str_complete    db '% complete',0
515
str_complete    db '% complete', 0
Line 535... Line 516...
535
str_transfer    db 'Transfer',0
516
str_transfer    db 'Transfer', 0
536
 
517
 
Line 566... Line 547...
566
 
547
 
567
local_addr  db "/hd0/1/KolibriOS/kernel.mnt",0
548
local_addr      db "/hd0/1/KolibriOS/kernel.mnt", 0
Line 568... Line 549...
568
rb (local_addr + 256 - $)
549
                rb (local_addr + 256 - $)
-
 
550
 
-
 
551
I_END:
-
 
552
 
569
 
553
sc              system_colors
570
I_END:
-
 
571
mouse_dd        dd ?
554
 
Line 572... Line 555...
572
buffer:
555
mouse_dd        dd ?
573
rb buffer_len
556
buffer          rb buffer_len