This repository was archived by the owner on Dec 27, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +27
-6
lines changed Expand file tree Collapse file tree 3 files changed +27
-6
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,6 @@ documentation = "https://docs.rs/libscemu/0.4.15/libscemu/"
10
10
repository = " https://github.com/sha0coder/libscemu"
11
11
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
12
12
13
-
14
13
[dependencies ]
15
14
iced-x86 = " 1.19.0"
16
15
uint = " 0.9.5"
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ pub struct Config {
18
18
pub console2 : bool ,
19
19
pub console_addr : u64 ,
20
20
pub entry_point : u64 ,
21
+ pub exit_position : u64 ,
21
22
pub code_base_addr : u64 ,
22
23
pub is_64bits : bool , // 64bits mode
23
24
pub stack_trace : bool ,
@@ -50,6 +51,7 @@ impl Config {
50
51
console2 : false ,
51
52
console_addr : 0 ,
52
53
entry_point : 0x3c0000 ,
54
+ exit_position : 0 ,
53
55
code_base_addr : 0x3c0000 ,
54
56
is_64bits : false ,
55
57
stack_trace : false ,
Original file line number Diff line number Diff line change @@ -4671,11 +4671,31 @@ impl Emu {
4671
4671
self . rep = Some ( rep_count + 1 ) ;
4672
4672
}
4673
4673
}
4674
- if ins. has_repe_prefix ( ) && !self . flags . f_zf {
4675
- self . rep = None ;
4676
- }
4677
- if ins. has_repne_prefix ( ) && self . flags . f_zf {
4678
- self . rep = None ;
4674
+
4675
+ let is_string_movement = matches ! (
4676
+ ins. mnemonic( ) ,
4677
+ Mnemonic :: Movsb | Mnemonic :: Movsw | Mnemonic :: Movsd | Mnemonic :: Movsq |
4678
+ Mnemonic :: Stosb | Mnemonic :: Stosw | Mnemonic :: Stosd | Mnemonic :: Stosq |
4679
+ Mnemonic :: Lodsb | Mnemonic :: Lodsw | Mnemonic :: Lodsd | Mnemonic :: Lodsq
4680
+ ) ;
4681
+
4682
+ let is_string_comparison = matches ! (
4683
+ ins. mnemonic( ) ,
4684
+ Mnemonic :: Cmpsb | Mnemonic :: Cmpsw | Mnemonic :: Cmpsd | Mnemonic :: Cmpsq |
4685
+ Mnemonic :: Scasb | Mnemonic :: Scasw | Mnemonic :: Scasd | Mnemonic :: Scasq
4686
+ ) ;
4687
+
4688
+ if is_string_movement {
4689
+
4690
+ } else if is_string_comparison {
4691
+ if ins. has_repe_prefix ( ) && !self . flags . f_zf {
4692
+ self . rep = None ;
4693
+ }
4694
+ if ins. has_repne_prefix ( ) && self . flags . f_zf {
4695
+ self . rep = None ;
4696
+ }
4697
+ } else {
4698
+ unimplemented ! ( "string instruction not supported" ) ;
4679
4699
}
4680
4700
}
4681
4701
You can’t perform that action at this time.
0 commit comments