1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

[Python] Converting python byte code to regular python code

Discussão em 'Python' iniciado por Stack, Julho 30, 2025.

  1. Stack

    Stack Membro Participativo

    How do I convert the following byte code to normal python code? I got this code by decompiling a pyc file. Some of the code was decompiled to its original code but the majority did not. Any idea how I can get this byte code to its source code?

    L. 174 396 BUILD_LIST_0 0
    398 STORE_FAST 'javascripts'

    L. 177 400 SETUP_LOOP 490 'to 490'
    402 LOAD_GLOBAL range
    404 LOAD_CONST 0
    406 LOAD_GLOBAL len
    408 LOAD_FAST 'incident_tags'
    410 CALL_FUNCTION_1 1 '1 positional argument'
    412 CALL_FUNCTION_2 2 '2 positional arguments'
    414 GET_ITER
    416 FOR_ITER 488 'to 488'
    418 STORE_FAST 'i'

    L. 178 420 LOAD_GLOBAL str
    422 LOAD_FAST 'incident_tags'
    424 LOAD_FAST 'i'
    426 BINARY_SUBSCR
    428 LOAD_ATTR text
    430 CALL_FUNCTION_1 1 '1 positional argument'
    432 LOAD_GLOBAL list_of_incidents
    434 COMPARE_OP not-in
    436_438 POP_JUMP_IF_FALSE 462 'to 462'

    L. 179 440 LOAD_FAST 'javascripts'
    442 LOAD_METHOD append
    444 LOAD_FAST 'incident_tags'
    446 LOAD_FAST 'i'
    448 BINARY_SUBSCR
    450 LOAD_METHOD get_attribute
    452 LOAD_STR 'href'
    454 CALL_METHOD_1 1 '1 positional argument'
    456 CALL_METHOD_1 1 '1 positional argument'
    458 POP_TOP
    460 JUMP_BACK 416 'to 416'
    462_0 COME_FROM 436 '436'

    L. 181 462 LOAD_GLOBAL print
    464 LOAD_STR 'Ignore '
    466 LOAD_FAST 'incident_tags'
    468 LOAD_FAST 'i'
    470 BINARY_SUBSCR
    472 LOAD_ATTR text
    474 BINARY_ADD
    476 LOAD_STR '. It is already completed.'
    478 BINARY_ADD
    480 CALL_FUNCTION_1 1 '1 positional argument'
    482 POP_TOP
    484_486 JUMP_BACK 416 'to 416'
    488 POP_BLOCK
    490_0 COME_FROM_LOOP 400 '400'

    L. 184 490_492 SETUP_LOOP 3694 'to 3694'
    494 LOAD_GLOBAL range
    496 LOAD_CONST 0
    498 LOAD_GLOBAL len
    500 LOAD_FAST 'javascripts'
    502 CALL_FUNCTION_1 1 '1 positional argument'
    504 CALL_FUNCTION_2 2 '2 positional arguments'
    506 GET_ITER
    508_0 COME_FROM 636 '636'
    508_510 FOR_ITER 3692 'to 3692'
    512 STORE_FAST 'i'

    L. 187 514 LOAD_FAST 'self'
    516 LOAD_ATTR driver
    518 LOAD_METHOD execute_script
    520 LOAD_FAST 'javascripts'
    522 LOAD_FAST 'i'
    524 BINARY_SUBSCR
    526 CALL_METHOD_1 1 '1 positional argument'
    528 POP_TOP

    L. 189 530 LOAD_GLOBAL time
    532 LOAD_METHOD sleep
    534 LOAD_CONST 1
    536 CALL_METHOD_1 1 '1 positional argument'
    538 POP_TOP

    Continue reading...

Compartilhe esta Página