mirror of
https://github.com/momo5502/emulator.git
synced 2026-01-10 16:16:16 +00:00
Set PEB64/32 HeapSegmentReserve & HeapSegmentCommit from Executable. (#682)
This commit is contained in:
@@ -586,10 +586,10 @@ typedef struct _PEB64
|
|||||||
ULONG NtGlobalFlag;
|
ULONG NtGlobalFlag;
|
||||||
|
|
||||||
ULARGE_INTEGER CriticalSectionTimeout;
|
ULARGE_INTEGER CriticalSectionTimeout;
|
||||||
EMULATOR_CAST(std::int64_t, SIZE_T) HeapSegmentReserve;
|
EMULATOR_CAST(std::uint64_t, SIZE_T) HeapSegmentReserve;
|
||||||
EMULATOR_CAST(std::int64_t, SIZE_T) HeapSegmentCommit;
|
EMULATOR_CAST(std::uint64_t, SIZE_T) HeapSegmentCommit;
|
||||||
EMULATOR_CAST(std::int64_t, SIZE_T) HeapDeCommitTotalFreeThreshold;
|
EMULATOR_CAST(std::uint64_t, SIZE_T) HeapDeCommitTotalFreeThreshold;
|
||||||
EMULATOR_CAST(std::int64_t, SIZE_T) HeapDeCommitFreeBlockThreshold;
|
EMULATOR_CAST(std::uint64_t, SIZE_T) HeapDeCommitFreeBlockThreshold;
|
||||||
|
|
||||||
ULONG NumberOfHeaps;
|
ULONG NumberOfHeaps;
|
||||||
ULONG MaximumNumberOfHeaps;
|
ULONG MaximumNumberOfHeaps;
|
||||||
|
|||||||
@@ -266,8 +266,8 @@ void process_context::setup(x86_64_emulator& emu, memory_manager& memory, regist
|
|||||||
|
|
||||||
p.ProcessHeap = 0;
|
p.ProcessHeap = 0;
|
||||||
p.ProcessHeaps = 0;
|
p.ProcessHeaps = 0;
|
||||||
p.HeapSegmentReserve = 0x0000000000100000; // TODO: Read from executable
|
p.HeapSegmentReserve = executable.size_of_heap_reserve;
|
||||||
p.HeapSegmentCommit = 0x0000000000002000;
|
p.HeapSegmentCommit = executable.size_of_heap_commit;
|
||||||
p.HeapDeCommitTotalFreeThreshold = 0x0000000000010000;
|
p.HeapDeCommitTotalFreeThreshold = 0x0000000000010000;
|
||||||
p.HeapDeCommitFreeBlockThreshold = 0x0000000000001000;
|
p.HeapDeCommitFreeBlockThreshold = 0x0000000000001000;
|
||||||
p.NumberOfHeaps = 0x00000000;
|
p.NumberOfHeaps = 0x00000000;
|
||||||
@@ -357,8 +357,8 @@ void process_context::setup(x86_64_emulator& emu, memory_manager& memory, regist
|
|||||||
// Copy similar settings from PEB64
|
// Copy similar settings from PEB64
|
||||||
p32.ProcessHeap = 0;
|
p32.ProcessHeap = 0;
|
||||||
p32.ProcessHeaps = 0;
|
p32.ProcessHeaps = 0;
|
||||||
p32.HeapSegmentReserve = 0x00100000;
|
p32.HeapSegmentReserve = static_cast<uint32_t>(executable.size_of_heap_reserve);
|
||||||
p32.HeapSegmentCommit = 0x00002000;
|
p32.HeapSegmentCommit = static_cast<uint32_t>(executable.size_of_heap_commit);
|
||||||
p32.HeapDeCommitTotalFreeThreshold = 0x00010000;
|
p32.HeapDeCommitTotalFreeThreshold = 0x00010000;
|
||||||
p32.HeapDeCommitFreeBlockThreshold = 0x00001000;
|
p32.HeapDeCommitFreeBlockThreshold = 0x00001000;
|
||||||
p32.NumberOfHeaps = 0;
|
p32.NumberOfHeaps = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user