Skip to content

Commit

Permalink
Minor fixes here and there
Browse files Browse the repository at this point in the history
  • Loading branch information
Vasiliev Ivan committed Apr 7, 2017
1 parent 0954ce5 commit 1217baf
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 112 deletions.
10 changes: 5 additions & 5 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -860,9 +860,9 @@ for opt do
;;
--block-drv-ro-whitelist=*) block_drv_ro_whitelist=$(echo "$optarg" | sed -e 's/,/ /g')
;;
--enable-plugin) plugin="yes"
--enable-plugins) plugin="yes"
;;
--disable-plugin) plugin="no"
--disable-plugins) plugin="no"
;;
--enable-debug-tcg) debug_tcg="yes"
;;
Expand Down Expand Up @@ -1309,9 +1309,9 @@ Advanced options (experts only):
--bindir=PATH install binaries in PATH
--libdir=PATH install libraries in PATH
--sysconfdir=PATH install config in PATH$confsuffix
--libexecdir=PATH install TCG plugins in PATH"
--enable-plugin enable plugin support"
--disable-plugin disable plugin support (default)"
--libexecdir=PATH install plugins in PATH"
--enable-plugins enable plugin support"
--disable-plugins disable plugin support (default)"
--localstatedir=PATH install local state in PATH (set at runtime on win32)
--with-confsuffix=SUFFIX suffix for QEMU data inside datadir/libdir/sysconfdir [$confsuffix]
--enable-debug enable common debug build options
Expand Down
5 changes: 2 additions & 3 deletions monitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -2570,8 +2570,7 @@ const mon_cmd_t *monitor_parse_command(Monitor *mon,

cmd = search_dispatch_table(table, cmdname);
if (!cmd) {
monitor_printf(mon, "unknown command: '%.*s'\n",
(int)(p - *cmdp), *cmdp);
*cmdp = p;
return NULL;
}

Expand Down Expand Up @@ -2972,8 +2971,8 @@ static void handle_hmp_command(Monitor *mon, const char *cmdline)
cmdline = start;
cmd = plugin_parse_command(mon, &cmdline);
end = cmdline;
if (!cmd)
#endif
if (!cmd)
{
monitor_printf(mon, "unknown command: '%.*s'\n", (int)(end - start), start);
return;
Expand Down
5 changes: 0 additions & 5 deletions plugins/plugins_src/syscall_lin.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include "guest_string.h"

static FILE *syscallfile;
static FILE *log;


void printf_log(const char *format, ...)
Expand Down Expand Up @@ -167,10 +166,6 @@ Parameters_c *syscall_close_os(CPUArchState *env)

int syscall_init_log(void)
{
log = fopen("log_sys_ret.log", "w");
if (!log)
printf("Can\'t read file %s\n", "log_sys_ret.log");

const char *fname = "syscall.log";
syscallfile = fopen(fname, "w");
if (!syscallfile) {
Expand Down
103 changes: 4 additions & 99 deletions plugins/plugins_src/syscall_win.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,38 +142,7 @@ Parameters_oc *syscall_open_os(CPUArchState *env)
printf_log("\t\t\tObjectName 0x%x\n", ldl_p(&data_struct[8]));
{
addr = ldl_p(&data_struct[8]);
/*uint8_t data_oname[8];
cpu_memory_rw_debug(first_cpu, addr, data_oname, sizeof(data_oname), 0);
printf_log("\t\t\t\tLength 0x%x\n", lduw_p(data_oname));
printf_log("\t\t\t\tMaximumLength 0x%x\n", lduw_p(&data_oname[2]));
printf_log("\t\t\t\tpBuffer 0x%x\n", ldl_p(&data_oname[4]));
{
uint32_t addr = ldl_p(&data_oname[4]);
if (addr)
{
uint16_t len = lduw_p(data_oname);
uint16_t buf[len / 2];
cpu_memory_rw_debug(first_cpu, addr, (uint8_t*)buf, sizeof(buf), 0);
printf_log("\t\t\t\t\tname: ");
char name[len / 2 + 1];
int j = 0;
params->name = g_malloc(len / 2 + 1);
for (i = 0; i < len / 2; i++)
{
printf_log("%lc", buf[i]);
if (buf[i] == '\\')
j = 0;
else
name[j++] = buf[i];
params->name[i] = buf[i];
}
name[j] = 0;
params->name[i] = 0;
printf_log("\n\t\t\t\t\tname = %s\n", name);
}
}
*/
//printf_log("\t\t\t\t\t");

if (addr)
params->name = printf_unicode_string(addr);
}
Expand All @@ -193,7 +162,6 @@ Parameters_oc *syscall_create_os(CPUArchState *env)
{
Parameters_oc *params = g_malloc0(sizeof(Parameters_oc));

//fprintf(log, "syscall CREATE\n");
uint8_t data[44];
write_prolog(env, data, sizeof(data));
printf_log("\tNtCreateFile addr_arg = 0x"TARGET_FMT_lx"\n", env->regs[R_EDX] + 8);
Expand Down Expand Up @@ -223,39 +191,7 @@ Parameters_oc *syscall_create_os(CPUArchState *env)
printf_log("\t\t\tObjectName 0x%x\n", ldl_p(&data_struct[8]));
{
addr = ldl_p(&data_struct[8]);
/*
uint8_t data_oname[8];
cpu_memory_rw_debug(first_cpu, addr, data_oname, sizeof(data_oname), 0);
printf_log("\t\t\t\tLength 0x%x\n", lduw_p(data_oname));
printf_log("\t\t\t\tMaximumLength 0x%x\n", lduw_p(&data_oname[2]));
printf_log("\t\t\t\tpBuffer 0x%x\n", ldl_p(&data_oname[4]));
{
uint32_t addr = ldl_p(&data_oname[4]);
if (addr)
{
uint16_t len = lduw_p(data_oname);
uint16_t buf[len / 2];
cpu_memory_rw_debug(first_cpu, addr, (uint8_t*)buf, sizeof(buf), 0);
printf_log("\t\t\t\t\tname: ");
char name[len / 2 + 1];
int j = 0;
params->name = g_malloc(len / 2 + 1);
for (i = 0; i < len / 2; i++)
{
printf_log("%lc", buf[i]);
if (buf[i] == '\\')
j = 0;
else
name[j++] = buf[i];
params->name[i] = buf[i];
}
name[j] = 0;
params->name[i] = 0;
printf_log("\n\t\t\t\t\tname = %s\n", name);
}
}
*/
//printf_log("\t\t\t\t\t");

if (addr)
params->name = printf_unicode_string(addr);
}
Expand Down Expand Up @@ -343,7 +279,6 @@ Parameters_rw *syscall_write_os(CPUArchState *env)
Parameters_c *syscall_close_os(CPUArchState *env)
{
Parameters_c *params = g_malloc0(sizeof(Parameters_c));
//fprintf(log, "syscall CLOSE\n");
uint8_t data[4];
write_prolog(env, data, sizeof(data));
printf_log("\tNtClose addr_arg = 0x"TARGET_FMT_lx"\n", env->regs[R_EDX] + 8);
Expand All @@ -357,7 +292,6 @@ Parameters_cs *syscall_create_section_os(CPUArchState *env)
{
Parameters_cs *params = g_malloc0(sizeof(Parameters_cs));

//fprintf(log, "syscall CREATE_SECTION\n");
uint8_t data[44];
write_prolog(env, data, sizeof(data));
printf_log("\tNtCreateSection addr_arg = 0x"TARGET_FMT_lx"\n", env->regs[R_EDX] + 8);
Expand All @@ -384,28 +318,7 @@ Parameters_cs *syscall_create_section_os(CPUArchState *env)
printf_log("\t\t\tObjectName 0x%x\n", ldl_p(&data_struct[8]));
{
addr = ldl_p(&data_struct[8]);
/*uint8_t data_oname[8];
cpu_memory_rw_debug(first_cpu, addr, data_oname, sizeof(data_oname), 0);
printf_log("\t\t\t\tLength 0x%x\n", lduw_p(data_oname));
printf_log("\t\t\t\tMaximumLength 0x%x\n", lduw_p(&data_oname[2]));
printf_log("\t\t\t\tpBuffer 0x%x\n", ldl_p(&data_oname[4]));
{
uint32_t addr = ldl_p(&data_oname[4]);
if (addr)
{
uint16_t len = lduw_p(data_oname);
uint16_t buf[len / 2];
cpu_memory_rw_debug(first_cpu, addr, (uint8_t*)buf, sizeof(buf), 0);
printf_log("\t\t\t\t\tname: ");
for (i = 0; i < len / 2; i++)
{
printf_log("%lc", buf[i]);
}
printf_log("\n");
}
}
*/
//printf_log("\t\t\t\t");

if (addr)
params->name = printf_unicode_string(addr);
}
Expand Down Expand Up @@ -434,9 +347,7 @@ Parameters_map *syscall_map_view_of_section_os(CPUArchState *env)
printf_log("\t\tProcessHandle 0x%x\n", ldl_p(&data[4]));
printf_log("\t\t*BaseAddress 0x%x\n", ldl_p(&data[8]));
params->pBaseAddress = ldl_p(&data[8]);
//uint8_t data2[4];
//cpu_memory_rw_debug(first_cpu, params->pBaseAddress, data2, 4, 0);
//printf_log("\t\tBaseAddress 0x%x\n", ldl_p(data2));

printf_log("\t\tZeroBits 0x%x\n", ldl_p(&data[12]));
printf_log("\t\tCommitSize 0x%x\n", ldl_p(&data[16]));
printf_log("\t\tpSectionOffset 0x%x\n", ldl_p(&data[20]));
Expand All @@ -447,7 +358,6 @@ Parameters_map *syscall_map_view_of_section_os(CPUArchState *env)
uint8_t data[4];
cpu_memory_rw_debug(first_cpu, params->viewSize, data, 4, 0);
uint32_t viewSize = ldl_p(data);
//params->viewSize = ldl_p(data);
printf_log("!!view size: 0x%x\n", viewSize);
}
printf_log("\t\tInheritDisposition 0x%x\n", ldl_p(&data[28]));
Expand Down Expand Up @@ -507,7 +417,6 @@ Parameters_os *syscall_open_section_os(CPUArchState *env)
printf_log("\t\t\tObjectName 0x%x\n", ldl_p(&data_struct[8]));
{
addr = ldl_p(&data_struct[8]);
//printf_log("\t\t\t\t");
if (addr)
params->name = printf_unicode_string(addr);
}
Expand Down Expand Up @@ -577,10 +486,6 @@ Parameters_do *syscall_duplicate_object_os(CPUArchState *env)

int syscall_init_log(void)
{
//log = fopen("log_sys_ret.log", "w");
//if (!log)
// printf("Can\'t read file %s\n", "log_sys_ret.log");

const char *fname = "syscall.log";
syscallfile = fopen(fname, "w");
if (!syscallfile) {
Expand Down

0 comments on commit 1217baf

Please sign in to comment.