Skip to content

Commit b2366e6

Browse files
committed
oleaut alloc more space
1 parent 9b7363c commit b2366e6

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

crates/libmwemu/src/engine/instructions/movdqa.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ pub fn execute(emu: &mut Emu, ins: &Instruction, instruction_sz: usize, _rep_ste
1414
let xmm = match emu.get_operand_xmm_value_128(ins, 1, true) {
1515
Some(v) => v,
1616
None => {
17-
log::info!("error getting xmm value1");
17+
log::info!("{} error getting xmm value1", emu.pos);
1818
return false;
1919
}
2020
};
2121
let addr = match emu.get_operand_value(ins, 0, false) {
2222
Some(v) => v,
2323
None => {
24-
log::info!("error getting address value0");
24+
log::info!("{} error getting address value0", emu.pos);
2525
return false;
2626
}
2727
};
@@ -41,14 +41,14 @@ pub fn execute(emu: &mut Emu, ins: &Instruction, instruction_sz: usize, _rep_ste
4141
let addr = match emu.get_operand_value(ins, 1, false) {
4242
Some(v) => v,
4343
None => {
44-
log::info!("error reading address value1");
44+
log::info!("{} error reading address value1", emu.pos);
4545
return false;
4646
}
4747
};
4848

4949
let bytes = emu.maps.read_bytes(addr, 16);
5050
if bytes.len() != 16 {
51-
log::info!("error reading 16 bytes at {addr:x}");
51+
log::info!("{} error reading 16 bytes at {addr:x}", emu.pos);
5252
return false;
5353
}
5454

@@ -63,14 +63,14 @@ pub fn execute(emu: &mut Emu, ins: &Instruction, instruction_sz: usize, _rep_ste
6363
let xmm = match emu.get_operand_xmm_value_128(ins, 1, true) {
6464
Some(v) => v,
6565
None => {
66-
log::info!("error getting xmm value1");
66+
log::info!("{} error getting xmm value1", emu.pos);
6767
return false;
6868
}
6969
};
7070

7171
emu.set_operand_xmm_value_128(ins, 0, xmm);
7272
} else {
73-
log::info!("sz0: {} sz1: {}\n", sz0, sz1);
73+
log::info!("{} sz0: {} sz1: {}\n", emu.pos, sz0, sz1);
7474
unimplemented!("movdqa");
7575
}
7676
true

crates/libmwemu/src/winapi/winapi64/oleaut32.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,10 @@ fn SysAllocStringLen(emu: &mut emu::Emu) {
5050

5151
// Calculate exact sizes like the real API
5252
let string_bytes = char_count * 2; // Requested characters in bytes
53-
let total_alloc_size = 4 + string_bytes + 2; // Length prefix + string + null terminator
53+
let total_alloc_size = 4 + string_bytes + 2 + 16; // Length prefix + string + null terminator
54+
// the extra 16 byes are not allocated on the
55+
// real winapi, but it's needed to allo some
56+
// optimizations
5457

5558
// Allocate memory (no extra padding needed)
5659
let bstr = emu.maps.alloc(total_alloc_size)

0 commit comments

Comments
 (0)