Bitwise AND (&)

Post a reply


In an effort to prevent automatic submissions, we require that you complete the following challenge.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :| :mrgreen: :geek: :ugeek: :arrow: :angel: :clap: :crazy: :eh: :lolno: :problem: :shh: :shifty: :sick: :silent: :think: :thumbup: :thumbdown: :salute: :wave: :wtf: :yawn: :facepalm: :bravo: :dance: :beard: :morebeard: :xmas: :HeHe: :trollface: :cookie: :rainbow: :monkeysee: :monkeysay: :happybday: :headwall: :offtopic: :superhappy: :terms: :beer:
View more smilies

BBCode is ON
[img] is OFF
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Bitwise AND (&)

Re: Bitwise AND (&)

Post by T1ran1403 » 15 Apr 2021, 16:36

Thanks for the answer. I found a way out of the situation this way:

Code: Select all

new_duck := duck & 0xFFF

Re: Bitwise AND (&)

Post by mcl » 15 Apr 2021, 16:22

Code: Select all

duck := ReadMemory(offset_1 + offset_2 + (i * 0x10) & 0xFFF, PID, ProcessHandle)
                  (                      (        ) &                          )

duck = pm.read_int(offset_1 + offset_2 + (i - 1) * 0x4) & 0xFFF
                  (                      (     )      ) &
В ahk-примере BitAnd-ится адрес в памяти, из которого читается число.
В python-примере BitAnd-ится результат чтения read_int.

Bitwise AND (&)

Post by T1ran1403 » 14 Apr 2021, 18:14

Здравствуйте, у меня возникла проблема с одной строкой:

Code: Select all

duck := ReadMemory(offset_1 + offset_2 + (i * 0x10) & 0xFFF, PID, ProcessHandle)

Побитовый оператор (&) не работает, подскажите как можно это исправить. На других языках например Python я записал так:

Code: Select all

duck = pm.read_int(offset_1 + offset_2 + (i - 1) * 0x4) & 0xFFF
Вариант с Python работает хорошо. Заранее спасибо.

Top