使用exeinfo得知这个exe文件是经过upx加密的
使用upx进行脱壳:
把脱壳的exe文件拖到ida进行分析。
main函数没有任何flag的线索,查看strings window发现有个字符串很想是flag的一部分:
但是这个字符串没有任何的交叉引用:
从它的名字f_part2,那应该会有个part1。但是strings window并没有任何part1类似的名字。应该是从代码产生的。在函数名处查找,有一个part1函数:
因为是放在栈上的,以小端序存储。用下面的代码输出答案:
def little_endian_hex_to_string(hex_value):
byte_array = bytearray.fromhex(hex_value)[::-1]
string_value = byte_array.decode('utf-8')
return string_value
hex_input = '6e345f5850557B67616C66'
part1= little_endian_hex_to_string(hex_input)
print(part1)
part2 = 'd_0n3_4nd_tw0}'
print(part1+part2)