diff --git a/bencode.asm b/bencode.asm index faff413..23bf731 100644 --- a/bencode.asm +++ b/bencode.asm @@ -662,11 +662,11 @@ proc torrent._.bdecode_tracker_peers _torrent, _arg mov [edi + peer.am_choking], al mov [edi + peer.is_choking], al lodsd - bswap eax +; bswap eax mov [edi + peer.ipv4], eax xor eax, eax lodsw -; xchg al, ah + xchg al, ah mov [edi + peer.port], eax add edi, sizeof.peer dec ecx diff --git a/bittorrent_backend.asm b/bittorrent_backend.asm index 9eebf7b..ecc13cb 100644 --- a/bittorrent_backend.asm +++ b/bittorrent_backend.asm @@ -113,4 +113,4 @@ torrent_filename1 db '/usbhd0/1/test.torrent',0 I_END: rb 0x1000 ; stack -E_END: \ No newline at end of file +E_END: diff --git a/kolibri.img b/kolibri.img index 4cefc27..39ac2b5 100644 Binary files a/kolibri.img and b/kolibri.img differ diff --git a/peer.asm b/peer.asm index 7045b3c..df7d4a9 100644 --- a/peer.asm +++ b/peer.asm @@ -21,8 +21,8 @@ proc peer._.handshake _torrent, _peer ;Preparing handshake message lea edi, [handshake_msg] - mov eax, protocol_string_len - stosb + movzx eax, [protocol_string_len] + stosb lea esi, [protocol_string] mov ecx, 19 rep movsb @@ -78,7 +78,7 @@ proc peer._.handshake _torrent, _peer cmp al, [protocol_string_len] jne .close inc edi - lea esi, [protocol_string] + lea esi, [protocol_string] ; same as (mov esi, protocol_string), read/ask about lea vs mov mov ecx, protocol_string_len repe cmpsb cmp ecx, 0 diff --git a/test.torrent b/test.torrent index 0171b41..92d39c6 100644 Binary files a/test.torrent and b/test.torrent differ diff --git a/torrent.asm b/torrent.asm index 061806c..de6dc38 100644 --- a/torrent.asm +++ b/torrent.asm @@ -130,7 +130,8 @@ proc torrent.new _bt_new_type, _src mov esi, def_peer_id mov ecx, 20 rep movsb - mov [ebx + torrent.port], def_port_num + mov eax, [def_port_num] + mov [ebx + torrent.port], eax cmp [_bt_new_type], BT_NEW_FILE jnz .magnet @@ -468,4 +469,4 @@ final_size dd 0 final_buffer dd 0 db 0 dd fname_buf -fname_buf db '/usbhd0/1/get.out',0 \ No newline at end of file +fname_buf db '/usbhd0/1/get.out',0 diff --git a/torrent.obj b/torrent.obj index 81b6abb..473ad23 100644 Binary files a/torrent.obj and b/torrent.obj differ diff --git a/tracker.asm b/tracker.asm index 201a61b..ee3e560 100644 --- a/tracker.asm +++ b/tracker.asm @@ -180,7 +180,7 @@ proc torrent._.tracker_fill_params _torrent, _tracker stosd mov eax, 'act=' stosd - mov eax, '0 ' + mov eax, '1 ' stosb xor eax, eax