start of implementation of issue #1909

This commit is contained in:
inisider 2015-05-25 17:48:43 +03:00 committed by pancake
parent 595433aeb3
commit 6536e6cb28
4 changed files with 12 additions and 4 deletions

View File

@ -761,6 +761,7 @@ int main(int argc, char **argv) {
opt.symbol_server = (char *)r_config_get (core.config, "pdb.server");
opt.user_agent = (char *)r_config_get (core.config, "pdb.user_agent");
opt.path = path;
opt.extract = r_config_get_i(core.config, "pdb.extract");
init_pdb_downloader (&opt, &pdb_downloader);
ret = pdb_downloader.download (&pdb_downloader);

View File

@ -77,11 +77,15 @@ static int download(struct SPDBDownloader *pd) {
res = 0;
}
if (res && (r_sys_cmd (extractor_cmd) != 0)) {
eprintf ("cab extrach has not been finished with sucess\n");
res = 0;
if (opt->extract == 1) {
if (res && (r_sys_cmd (extractor_cmd) != 0)) {
eprintf ("cab extrach has not been finished with sucess\n");
res = 0;
}
r_file_rm (abspath_to_archive);
}
r_file_rm (abspath_to_archive);
R_FREE (archive_name);
R_FREE (curl_cmd);
R_FREE (extractor_cmd);
@ -96,6 +100,7 @@ void init_pdb_downloader(SPDBDownloaderOpt *opt, SPDBDownloader *pd) {
pd->opt->symbol_server = strdup(opt->symbol_server);
pd->opt->user_agent = strdup (opt->user_agent);
pd->opt->path = strdup (opt->path);
pd->opt->extract = opt->extract;
pd->download = download;
}

View File

@ -11,6 +11,7 @@ typedef struct SPDBDownloaderOpt {
char *dbg_file;
char *guid;
char *path;
int extract;
} SPDBDownloaderOpt;
typedef struct SPDBDownloader {

View File

@ -989,6 +989,7 @@ R_API int r_core_config_init(RCore *core) {
/* pdb */
SETPREF("pdb.user_agent", "Microsoft-Symbol-Server/6.11.0001.402", "User agent for Microsoft symbol server");
SETPREF("pdb.server", "http://msdl.microsoft.com/download/symbols", "Base URL for Microsoft symbol server");
SETI("pdb.extract", 1, "Avoid extract of the pdb file, just download");
/* anal */
SETPREF("anal.a2f", "false", "Use the new WIP analysis algorithm (core/p/a2f), anal.depth ignored atm");