160个破解练习之2-Afkayas.1.Exe

好了,今天我们来破解这个小程序。

首先,把文件载入PEiD,查看文件的基本信息,看看是否带壳。载入后的信息如下图:

可以看到这个程序使用VB写的,不带壳,好了,可以破解了。

打开这个程序,出现弹窗

随便输入几个字符,点击OK

载入IDA,搜素文本“...Wrong”,得到以下代码:

.text:00402579 test    si, si
.text:0040257C mov     [ebp-6Ch], eax
.text:0040257F mov     [ebp-54h], ecx
.text:00402582 mov     [ebp-5Ch], eax
.text:00402585 mov     [ebp-44h], ecx
.text:00402588 mov     [ebp-4Ch], eax
.text:0040258B jz      short loc_4025E5         //若条件成立,跳转到注册失败的代码段,这里可以直接NOP掉,或者改写命令 jnz.....

.text:0040258D push    offset aYouGetIt      ; "You Get It"
.text:00402592 push    offset asc_401B9C     ; "\r\n"
.text:00402597 call    edi ; __vbaStrCat
.text:00402599 mov     edx, eax
.tex

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
好的,我理解了您的问题。这是一个求解二元方程的问题,如果行列式小于0,则使用复数类来得到虚根。 以下是我使用 Python 代码进行实现,您可以参考: ```python import math class Complex: def __init__(self, real=0, imag=0): self.real = real self.imag = imag def __add__(self, other): return Complex(self.real + other.real, self.imag + other.imag) def __sub__(self, other): return Complex(self.real - other.real, self.imag - other.imag) def __mul__(self, other): return Complex(self.real * other.real - self.imag * other.imag, self.real * other.imag + self.imag * other.real) def __truediv__(self, other): r = (other.real ** 2 + other.imag ** 2) return Complex((self.real * other.real + self.imag * other.imag) / r, (self.imag * other.real - self.real * other.imag) / r) def __abs__(self): return math.sqrt(self.real ** 2 + self.imag ** 2) def __str__(self): if self.imag >= 0: return "{:.1f}+{:.1f}i".format(self.real, self.imag) else: return "{:.1f}{:.1f}i".format(self.real, self.imag) def main(): a, b, c = map(float, input("Enter a, b, c: ").split()) d = b ** 2 - 4 * a * c if d >= 0: r1 = (-b + math.sqrt(d)) / (2 * a) r2 = (-b - math.sqrt(d)) / (2 * a) print("The roots are {:.5f} and {:.5f}".format(r1, r2)) else: r1 = Complex(-b / (2 * a), math.sqrt(-d) / (2 * a)) r2 = Complex(-b / (2 * a), -math.sqrt(-d) / (2 * a)) print("The roots are {} and {}".format(r1, r2)) if __name__ == '__main__': main() ``` 在这个实现中,我们定义了一个名为 Complex 的类来表示复数,并实现了一些基本的操作。在主函数中,我们首先读入 a、b、c 三个系数,然后计算行列式 d。如果 d 大于等于 0,则使用一般的求根公式得到实根,否则使用 Complex 类得到虚根。 以下是一些示例输入输出: ``` Enter a, b, c: 13 1 1 The roots are -0.3820 and -2.6180 ``` ``` Enter a, b, c: 1 2 1 The root is -1.0000 ``` ``` Enter a, b, c: 1 2 3 The roots are -1.0000+1.4142i and -1.0000-1.4142i ``` 希望这个示例代码对您有所帮助!

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值