Skip to content

Commit

Permalink
Merge pull request #170 from JayFoxRox/fix-crashes
Browse files Browse the repository at this point in the history
Fix bugs which can cause bad memory access
  • Loading branch information
JayFoxRox authored Jan 18, 2019
2 parents fc13ad3 + e0c6d6a commit 7815f6b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion main.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ uint32_t tls[1000] = {0};
static void UnknownImport(void* uc, Address address, void* user_data);
Address CreateInterface(const char* name, unsigned int slotCount) {
//FIXME: Unsure about most terminology / inner workings here
Address interfaceAddress = Allocate(100); //FIXME: Size of object
Address interfaceAddress = Allocate(1000); //FIXME: Size of object
Address vtableAddress = Allocate(4 * slotCount);
uint32_t* vtable = (uint32_t*)Memory(vtableAddress);
for(unsigned int i = 0; i < slotCount; i++) {
Expand Down Expand Up @@ -599,6 +599,9 @@ HACKY_IMPORT_END()

HACKY_IMPORT_BEGIN(GetStartupInfoA)
hacky_printf("lpStartupInfo 0x%" PRIX32 "\n", stack[1]);

memset(Memory(stack[1]), 0x00, 68);

esp += 1 * 4;
HACKY_IMPORT_END()

Expand Down

0 comments on commit 7815f6b

Please sign in to comment.