得知key是这四个,4个输入使用ECB分组模式进行加密的(tea每次加密两个).
print
(
"rax:0x%x rdx:0x%x rcx:0x%x rbx:0x%x"
%
(GetRegValue(
'rax'
),GetRegValue(
'rdx'
),GetRegValue(
'rcx'
),GetRegValue(
'rbx'
)))
AddBpt(
0x4015F1
)
AddBpt(
0x401594
)
AddBpt(
0x401535
)
AddBpt(
0x401477
)
AddBpt(
0x4014D6
)
AddBpt(
0x4013FA
)
AddBpt(
0x40145E
)
AddBpt(
0x4012EA
)
while
True
:
RunTo(
0x40115E
)
GetDebuggerEvent(WFNE_SUSP,
-
1
)
tmp
=
GetRegValue(
'rip'
)
arg1
=
GetRegValue(
'rax'
)
arg2
=
GetRegValue(
'rdx'
)
arg3
=
GetRegValue(
'rcx'
)
arg4
=
GetRegValue(
'rbx'
)
if
tmp
=
=
0x4015F1
:
if
arg4!
=
0
:
print
'arg2[%d] = arg2[%d]'
%
(arg1,arg3),
else
:
print
'arg2[%d] = 0x%x'
%
(arg1,arg3),
elif
tmp
=
=
0x401594
:
if
arg4!
=
0
:
print
'arg3 = arg2[%d]'
%
arg3
print
'arg2[%d] = arg2[%d] + arg3'
%
(arg1,arg1),
else
:
print
'arg2[%d] = arg2[%d] + %d'
%
(arg1,arg1,arg3),
elif
tmp
=
=
0x401535
:
if
arg4!
=
0
:
print
'arg2[%d] = arg2[%d] >> arg2[%d]'
%
(arg1,arg1,arg3),
else
:
print
'arg2[%d] = arg2[%d] >> 0x%x'
%
(arg1,arg1,arg3),
elif
tmp
=
=
0x401477
:
if
arg4!
=
0
:
print
'arg2[%d] = arg2[%d] ^ arg2[%d]'
%
(arg1,arg3,arg1),
else
:
print
'arg2[%d] = arg2[%d] ^ 0x%x'
%
(arg1,arg1,arg3),
elif
tmp
=
=
0x4014D6
:
if
arg4!
=
0
:
print
'arg2[%d] = arg2[%d] << arg2[%d]'
%
(arg1,arg1,arg3),
else
:
print
'arg2[%d] = arg2[%d] << 0x%x'
%
(arg1,arg1,arg3),
elif
tmp
=
=
0x4013FA
:
if
arg4!
=
0
:
print
'dword_40C0C0 = arg2[%d] != arg2[%d]'
%
(arg1,arg3),
else
:
print
'dword_40C0C0 = arg2[%d] != 0x%x'
%
(arg1,arg3),
elif
tmp
=
=
0x40145E
:
print
'if dword_40C0C0 == 0 : retn \nelse mov rsp, rax'
,
print
"rip = %x rax = 0x%x rdx = 0x%x rcx = 0x%x rbx = 0x%x"
%
(GetRegValue(
'rip'
),GetRegValue(
'rax'
),GetRegValue(
'rdx'
),GetRegValue(
'rcx'
),GetRegValue(
'rbx'
))