(
c_in: FilePath,
asm_out: FilePath,
short_call_patching: bool = False,
)
| 72 | |
| 73 | # NOTE: Mostly copy-pasted from compiler.py::compile() |
| 74 | def compile_dev( |
| 75 | c_in: FilePath, |
| 76 | asm_out: FilePath, |
| 77 | short_call_patching: bool = False, |
| 78 | ): |
| 79 | logger.info("-( Carrier: Compile C to ASM: {} -> {} ".format(c_in, asm_out)) |
| 80 | |
| 81 | # Compile C To Assembly (text) |
| 82 | run_process_checkret([ |
| 83 | config.get("path_cl"), |
| 84 | "/c", |
| 85 | "/FA", |
| 86 | "/GS-", |
| 87 | "/favor:AMD64", |
| 88 | "/Fa{}/".format(os.path.dirname(c_in)), |
| 89 | c_in, |
| 90 | ]) |
| 91 | if not os.path.isfile(asm_out): |
| 92 | raise Exception("Error: Compiling failed") |
| 93 | |
| 94 | asm_text: str = file_readall_text(asm_out) |
| 95 | observer.add_text_file("carrier_asm_orig", asm_text) |
| 96 | |
| 97 | logger.info(" ASM masm_shc: {} ".format(asm_out)) |
| 98 | settings = Settings() |
| 99 | injectable = Injectable("test.exe") # ??? |
| 100 | asm_text_lines: List[str] = parse_asm_text_file(injectable, asm_text, settings) |
| 101 | asm_text = masm_shc(asm_text_lines) |
| 102 | observer.add_text_file("carrier_asm_cleanup", asm_text) |
| 103 | |
| 104 | with open(asm_out, "w") as f: |
| 105 | f.write(asm_text) |
| 106 | |
| 107 | |
| 108 | def compile( |
nothing calls this directly
no test coverage detected