Rev 2610 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2610 | Rev 2624 | ||
---|---|---|---|
Line 15... | Line 15... | ||
15 | datasocketnum dd ? ; socket used for data transfers |
15 | datasocketnum dd ? ; socket used for data transfers |
16 | permissions dd ? ; read/write/execute/.... |
16 | permissions dd ? ; read/write/execute/.... |
17 | buffer_ptr dd ? |
17 | buffer_ptr dd ? |
18 | 18 | pid dd ? ; Process id of the current thread |
|
19 | datasock sockaddr_in |
19 | |
- | 20 | datasock sockaddr_in |
|
Line 20... | Line 21... | ||
20 | 21 | ||
Line 21... | Line 22... | ||
21 | buffer rb BUFFERSIZE |
22 | buffer rb BUFFERSIZE |
22 | ends |
23 | ends |
Line 450... | Line 451... | ||
450 | .not_active: |
451 | .not_active: |
451 | cmp [ebp + thread_data.mode], MODE_PASSIVE_WAIT |
452 | cmp [ebp + thread_data.mode], MODE_PASSIVE_WAIT |
452 | jne socketerror |
453 | jne socketerror |
453 | mov [ebp + thread_data.mode], MODE_PASSIVE_FAILED ; assume that we will fail |
454 | .try_now: |
454 | .try_now: |
- | |
455 | mov ecx, [ebp + thread_data.passivesocknum] |
455 | mov ecx, [ebp + thread_data.passivesocknum] |
456 | lea edx, [ebp + thread_data.datasock] |
456 | lea edx, [ebp + thread_data.datasock] |
457 | mov esi, sizeof.thread_data.datasock |
457 | mov esi, sizeof.thread_data.datasock |
458 | mcall accept |
458 | mcall accept |
459 | cmp eax, -1 |
459 | cmp eax, -1 |
460 | jne .pasv_ok |
460 | jne .pasv_ok |
461 | mcall 23, 200 |
461 | mov [ebp + thread_data.mode], MODE_PASSIVE_FAILED ; assume that we will fail |
- | 462 | mcall 23, 200 |
|
462 | mcall accept |
463 | mcall accept |
463 | cmp eax, -1 |
464 | cmp eax, -1 |
464 | je socketerror |
465 | je socketerror |
465 | .pasv_ok: |
466 | .pasv_ok: |
466 | mov [ebp + thread_data.datasocketnum], eax |
467 | mov [ebp + thread_data.datasocketnum], eax |
Line 570... | Line 571... | ||
570 | ; check next file |
571 | ; check next file |
Line 571... | Line 572... | ||
571 | invoke file.find.next, ebx |
572 | invoke file.find.next, ebx |
572 | jmp .parse_file |
573 | jmp .parse_file |
573 | ;;; mov eax, ebx ;;;;; |
574 | |
574 | - | ||
Line 575... | Line 575... | ||
575 | ; close file desc |
575 | ; close file desc |
576 | .done: |
576 | .done: |
577 | invoke file.find.close, ebx ; ebx is the |
577 | invoke file.find.close, ebx ; ebx is descriptor of last file, eax will be -1 !! |
Line 578... | Line 578... | ||
578 | 578 | ||
579 | ; append the string with a 0 |
579 | ; append the string with a 0 |
580 | xor al, al |
580 | xor al, al |
Line 586... | Line 586... | ||
586 | pop esi |
586 | pop esi |
587 | 587 | ||
588 | ; and send it to the client |
588 | ; and send it to the client |
Line 589... | Line 589... | ||
589 | mov ecx, [ebp + thread_data.datasocketnum] |
589 | mov ecx, [ebp + thread_data.datasocketnum] ; socket num |
590 | lea edx, [ebp + thread_data.buffer] |
590 | lea edx, [ebp + thread_data.buffer] ; buffer ptr |
591 | sub esi, edx |
591 | sub esi, edx ; length |
592 | xor edi, edi |
592 | xor edi, edi ; flags |
593 | mcall send |
593 | mcall send |
594 | 594 | ||
Line 595... | Line 595... | ||
595 | ; close the data socket.. |
595 | ; close the data socket.. |
596 | mov [ebp + thread_data.mode], MODE_NOTREADY |
596 | mov [ebp + thread_data.mode], MODE_NOTREADY |
597 | mcall close, [ebp + thread_data.datasocketnum] |
597 | mcall close, [ebp + thread_data.datasocketnum] |
Line 642... | Line 642... | ||
642 | 642 | ||
643 | ; read the password from users.ini |
643 | ; read the password from users.ini |
Line 644... | Line 644... | ||
644 | lea edi, [ebp + thread_data.buffer + 512] ; temp pass |
644 | lea edi, [ebp + thread_data.buffer + 512] ; temp pass |
645 | mov byte [edi], 0 |
645 | lea ebx, [ebp + thread_data.fpath] ; temp username |
646 | lea ebx, [ebp + thread_data.fpath] ; temp username |
- | |
647 | invoke ini.get_str, path2, ebx, str_pass, edi, 512, str_infinity |
646 | invoke ini.get_str, path2, ebx, str_pass, edi, 512, str_infinity |
648 | test eax, eax ; unable to read password? fail! |
647 | test eax, eax ; unable to read password? fail! |
649 | jnz .incorrect |
648 | jnz .incorrect |
650 | cmp dword [edi], -1 ; no key, section or file found.. fail! |
649 | cmp dword [edi], -1 ; no key, section or file found.. fail! |
651 | je .incorrect |
650 | je .incorrect |
652 | cmp byte [edi], 0 ; zero password? ok! |
651 | ;;; cmp byte [edi], 0 ; zero password? ok! |
653 | je .ok |
652 | ;;; je .ok |
654 | 653 | ||
Line 655... | Line 654... | ||
655 | add esi, 5 |
654 | add esi, 5 |
656 | sub ecx, 5 |
655 | sub ecx, 5 |
657 | jbe .incorrect ; no password given? but hey, we need one! fail.. |
656 | jbe .incorrect ; no password given? but hey, we need one! fail.. |