windows: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=121c16ba1218dc3686b3cdac4705bc7496fb0fe7, for GNU/Linux 3.2.0, not stripped
Arch: amd64-64-little
RELRO: Partial RELRO
Stack: No canary found
NX: NX enabled
PIE: PIE enabled
The program wants the user to input a password (flag). If the password incorrect, it will show this.
Checking the code using Ghidra, i can see that line 18 compares variable local_d with array arr.
local_d is the sum of the value at current index and the index after from user input.
The value in each of the array is the value of local_d, which i explained earlier. So, we need to calculate the value (in ascii) for the user input.
9C = H (48) + T (54)
96 = T (54) + B (42)
BD = B (42) + { (7B)
AF = { (7B) + 4 (34)
...
the rest of the calculations
...
9E = ! (21) + } (7D)
We get a flag from it, check it just to make sure it is legit.
Flag
HTB{4_d00r_cl0s35_bu7_4_w1nd0w_0p3n5!}
The flag format starts with HTB{. It should be easy for us to start calculate the rest of the value. You can use as guidance and some simple math skills.