fix: warnings, delete: debug function
This commit is contained in:
@@ -11,12 +11,6 @@
|
|||||||
extern int dprintf(int stream, const char *format, ...);
|
extern int dprintf(int stream, const char *format, ...);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void api_get_data() {
|
|
||||||
static const char dat[] = "Hello, World !";
|
|
||||||
|
|
||||||
state->registers->eax = (long long)dat;
|
|
||||||
}
|
|
||||||
|
|
||||||
void api_put() {
|
void api_put() {
|
||||||
int mode = (int)state->STACK[state->STACK_IDX--]; // 1 for char, 2 for num
|
int mode = (int)state->STACK[state->STACK_IDX--]; // 1 for char, 2 for num
|
||||||
if (mode != 1 && mode != 2) return;
|
if (mode != 1 && mode != 2) return;
|
||||||
@@ -37,7 +31,7 @@ void api_put() {
|
|||||||
dprintf(f, "%c", c); //using printf and not write because of the buffer
|
dprintf(f, "%c", c); //using printf and not write because of the buffer
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
dprintf(f, "%d", state->STACK[state->STACK_IDX--]);
|
dprintf(f, "%lld", state->STACK[state->STACK_IDX--]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "instructions.h"
|
#include "instructions.h"
|
||||||
|
|
||||||
void api_get_data();
|
|
||||||
void api_put();
|
void api_put();
|
||||||
void api_getasynckeystate();
|
void api_getasynckeystate();
|
||||||
|
|
||||||
static const command_t api_map[] = {
|
static const command_t api_map[] = {
|
||||||
{.command = "put", .fptr = api_put},
|
{.command = "put", .fptr = api_put},
|
||||||
{.command = "get_data", .fptr = api_get_data},
|
|
||||||
{.command = "GetAsyncKeyState", .fptr = api_getasynckeystate},
|
{.command = "GetAsyncKeyState", .fptr = api_getasynckeystate},
|
||||||
|
|
||||||
{.command = NULL, .fptr = NULL}
|
{.command = NULL, .fptr = NULL}
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ long long* get_reg(char* reg_char) {
|
|||||||
++reg_char;
|
++reg_char;
|
||||||
for (int i = 0; i < state->num_arrays; i++)
|
for (int i = 0; i < state->num_arrays; i++)
|
||||||
if (strcmp(state->ARRAYS_NAME[i], reg_char) == 0)
|
if (strcmp(state->ARRAYS_NAME[i], reg_char) == 0)
|
||||||
return &state->ARRAYS_VALUES[i];
|
return (long long *)&state->ARRAYS_VALUES[i];
|
||||||
switch (reg_char[1]) {
|
switch (reg_char[1]) {
|
||||||
case '1' :
|
case '1' :
|
||||||
return &state->registers->a1;
|
return &state->registers->a1;
|
||||||
@@ -81,7 +81,7 @@ long long get_value(char* arg) {
|
|||||||
|
|
||||||
if (is_reg(arg)) {
|
if (is_reg(arg)) {
|
||||||
if (arg[0] == '&') {
|
if (arg[0] == '&') {
|
||||||
ret = get_reg(arg);
|
ret = (long long)get_reg(arg);
|
||||||
}
|
}
|
||||||
else if (arg[0] == '*') {
|
else if (arg[0] == '*') {
|
||||||
ret = *(long long *)(*get_reg(arg));
|
ret = *(long long *)(*get_reg(arg));
|
||||||
|
|||||||
BIN
tests/vgcore.12835
Normal file
BIN
tests/vgcore.12835
Normal file
Binary file not shown.
Reference in New Issue
Block a user