pwncollege.ReverseEngineering

激情写逆向

  • 5.0
origin =[
  0xC3, 0xC2, 0xDF, 0xC7, 0xC4, 0x00
]
result = ""
for i in range(5):
	origin[i] = origin [i] ^ 0xB7
	result += chr(origin[i])

print(result)
  • 5.1
origin =[
  0xa3, 0xb5, 0xb1, 0xb4, 0xa1
]
result = ""
for i in range(5):
	origin[i] = origin [i] ^ 0xD0
	result += chr(origin[i])

print(result)
  • 6.0
origin = [
  0x49, 0x4B, 0x4E, 0x4F, 0x55, 0x55, 0x59, 0x5D, 0x82, 0x86, 
  0x88, 0x8B, 0x8D, 0x93, 0x93, 0x93, 0x96,0x00
]
result = ""
resul_j = ""
resul_o = ""

for i in range(17):
	tem1 = origin[i] ^ 224 # 偶数 9
	tem2 = origin[i] ^ 60  # 奇数 8
	if((tem1 > 31) and (tem1 < 127)):
		resul_j += chr(tem1)
	elif(tem2 > 31 and tem2 < 127):
		resul_o += chr(tem2)

print(resul_j)
print(resul_o)

string1 = resul_j
string2 = resul_o

# 初始化一个空字符串来存储整合后的结果
result = ""

# 使用循环遍历两个字符串,分别添加字符到新字符串中
index1, index2 = 0, 0

while index1 < len(string1) or index2 < len(string2):
    if index1 < len(string1):
        result += string1[index1]
        index1 += 1

    if index2 < len(string2):
        result += string2[index2]
        index2 += 1

# 输出整合后的结果
print(result)
  • 6.1
origin = [
  0x28, 0xCC, 0x28, 0xD5, 0x2C, 0xC9, 0x2C, 0xC4, 0x2A, 0xC3, 
  0x2F, 0xD5, 0x34, 0xC1, 0x2F, 0xD7
]



for i in range(16):
	if i % 2 == 1:
		origin[i] ^= 0xBA
	else:
		origin[i] ^= 0x5E

for i in range(16):
	origin[i] ^= 0x1d

for i in range(7):
	v3 = origin[i]
	origin[i] = origin[15 - i]
	origin[15 - i] = v3

result = ""
for i in range(16):
	result += chr(origin[i])
print(result)

# plfwrldiconorkkk
# plfwrldcionorkkk
  • 7.0
origin = [
  0xF8, 0xA9, 0xA9, 0xAA, 0xE4, 0xF4, 0xAB, 0xAA, 0xAE, 0xE1, 
  0xF1, 0xB1, 0xB0, 0xB1, 0xFC, 0xEC, 0xB2, 0xB5, 0xB5, 0xF7, 
  0xE7, 0xBA, 0xBA, 0xBD, 0xF2, 0xE0, 0xBF
]

# 逆转
for i in range(13):
	tem = origin[i]
	origin[i] = origin[26 - i]
	origin[26 - i] = tem

# 异或
for i in range(27):
	origin[i] ^= 0x2C

# 分别异或
for i in range(27):
	if i % 5 == 0:
		origin[i] ^= 0xF2
	elif i % 5 == 1:
		origin[i] ^= 0xad
	elif i % 5 == 2:
		origin[i] ^= 0xbd
	elif i % 5 == 3:
		origin[i] ^= 0xF0
	elif i % 5 == 4:
		origin[i] ^= 0xF2

v4 = origin[2]
origin[2] = origin[3]
origin[3] = v4

result = ""
for i in range(27):
	result += chr(origin[i])
print(result)

你可能感兴趣的:(pwncollege)