从跳跃返回主场

时间:2019-05-10 15:55:52

标签: windows x86 nasm

ERROR: Complete output from command python setup.py egg_info:
    ERROR: Traceback (most recent call last):
      File "/tmp/pip-install-cm90jl7u/pdal/setup.py", line 64, in get_pdal_config
        stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
      File "/usr/lib/python3.6/subprocess.py", line 709, in __init__
        restore_signals, start_new_session)
      File "/usr/lib/python3.6/subprocess.py", line 1344, in _execute_child
        raise child_exception_type(errno_num, err_msg, err_filename)
    FileNotFoundError: [Errno 2] No such file or directory: 'pdal-config': 'pdal-config'

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-cm90jl7u/pdal/setup.py", line 120, in <module>
        for item in get_pdal_config('--python-version').split():
      File "/tmp/pip-install-cm90jl7u/pdal/setup.py", line 68, in get_pdal_config
        'Could not find pdal-config %r: %s' % (pdal_config, ex))
    OSError: Could not find pdal-config 'pdal-config': [Errno 2] No such file or directory: 'pdal-config': 'pdal-config'
    ----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-cm90jl7u/pdal/

“ call” 标签_1的地址压入堆栈,并执行其代码。为了继续执行“ operation_a”等,“ label_1”必须包含一个“ ret”,该弹出弹出 label_1的地址并以“ operation_a”继续,依此类推。

我有问题

_main:
    .
    ..
    ...
    call label_1 
    operation_a
    ...
    ..
    .

在这种情况下,“ je”跳至label_1,因此我无法在“ label_1”中的指令集中添加“ ret”,然后...

如何从跳转到主要代码的后面回来?是否有条件跳转来“调用”标签?

一个朋友提到我可以在label_1的末尾添加一个“ jmp aux_label”,并在main函数中添加该“ aux_label”,但是如果我碰巧做了很多“ je”,我最终会创建很多标签

1 个答案:

答案 0 :(得分:0)

没有条件调用之类的东西。但是您可以将呼叫与条件跳转结合起来:

  ...
  jne no_call
  call label_1 
no_call:
  operation_a
  ...

这样,如果不满足相等条件,则跳过call命令,并且不会进行任何调用。如果满足相等条件,JNE不执行任何操作,则您执行call,然后最终ret从它到operation_a

no_call不是一个操作,它是一个标签。因此,no_call的地址和operation_a的地址是同一件事,以防万一。

“将JNE标记向下几行”的技巧与汇编中的if()语句一样接近。

在汇编中编码时,创建许多标签是生活中不幸的事实。 :)

相关问题