dotnet: check mcs output exists

This commit is contained in:
Oleksii Shevchuk 2019-04-02 20:55:54 +03:00
parent 4b78dc5825
commit 22cea52fe4
1 changed files with 5 additions and 1 deletions

View File

@ -9,7 +9,7 @@ import random
import shlex
from string import ascii_uppercase, ascii_lowercase
from os.path import join, splitext
from os.path import join, splitext, isfile
from base64 import b64encode
from pupylib.PupyOutput import Success, Error, List
@ -136,6 +136,10 @@ def dotnet_serve_payload(display, server, rawdll, conf, link_ip="<your_ip>"):
dn = DotNetPayload(display, server, conf, rawdll)
exe_path = dn.gen_exe(options='-target:library')
if not exe_path or not isfile(exe_path):
display(Error('Build failed'))
return
with open(exe_path, 'rb') as r:
payload = r.read()