mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-01-11 00:35:46 +00:00
Added return values in main() to rw_hookstack.c so that it builds in MinGW.
This commit is contained in:
parent
f111d7d1ca
commit
d871e17ffd
|
@ -49,32 +49,32 @@ int main(int argc, char *argv[])
|
||||||
err = uc_open(UC_ARCH_X86, UC_MODE_32, &uc);
|
err = uc_open(UC_ARCH_X86, UC_MODE_32, &uc);
|
||||||
if(err) {
|
if(err) {
|
||||||
printf("Failed on uc_open() with error returned: %s\n", uc_strerror(err));
|
printf("Failed on uc_open() with error returned: %s\n", uc_strerror(err));
|
||||||
return;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
err = uc_mem_map(uc, ADDRESS, SIZE, UC_PROT_ALL);
|
err = uc_mem_map(uc, ADDRESS, SIZE, UC_PROT_ALL);
|
||||||
if(err != UC_ERR_OK) {
|
if(err != UC_ERR_OK) {
|
||||||
printf("Failed to map memory %s\n", uc_strerror(err));
|
printf("Failed to map memory %s\n", uc_strerror(err));
|
||||||
return;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
err = uc_mem_write(uc, ADDRESS, CODE32, sizeof(CODE32) - 1);
|
err = uc_mem_write(uc, ADDRESS, CODE32, sizeof(CODE32) - 1);
|
||||||
if(err != UC_ERR_OK) {
|
if(err != UC_ERR_OK) {
|
||||||
printf("Failed to write to memory %s\n", uc_strerror(err));
|
printf("Failed to write to memory %s\n", uc_strerror(err));
|
||||||
return;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
loop:
|
loop:
|
||||||
err = uc_mem_map(uc, stkval, STACK_SIZE, UC_PROT_ALL);
|
err = uc_mem_map(uc, stkval, STACK_SIZE, UC_PROT_ALL);
|
||||||
if(err != UC_ERR_OK) {
|
if(err != UC_ERR_OK) {
|
||||||
printf("Failed to map memory %s\n", uc_strerror(err));
|
printf("Failed to map memory %s\n", uc_strerror(err));
|
||||||
return;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
err = uc_mem_write(uc, ESP, &val, sizeof(val));
|
err = uc_mem_write(uc, ESP, &val, sizeof(val));
|
||||||
if(err != UC_ERR_OK) {
|
if(err != UC_ERR_OK) {
|
||||||
printf("Failed to write to memory %s\n", uc_strerror(err));
|
printf("Failed to write to memory %s\n", uc_strerror(err));
|
||||||
return;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ loop:
|
||||||
printf("Failed on uc_emu_start() with error returned %u: %s\n", err, uc_strerror(err));
|
printf("Failed on uc_emu_start() with error returned %u: %s\n", err, uc_strerror(err));
|
||||||
|
|
||||||
uc_close(uc);
|
uc_close(uc);
|
||||||
return;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
uc_reg_read(uc, UC_X86_REG_EAX, &EAX);
|
uc_reg_read(uc, UC_X86_REG_EAX, &EAX);
|
||||||
|
|
Loading…
Reference in a new issue