├── .project ├── src ├── .properties ├── Unicorn │ ├── package.st │ ├── UnicornError.class.st │ ├── UnicornTypes.class.st │ ├── UcHook.class.st │ ├── UnicornLibrary.class.st │ ├── UcHookType.class.st │ ├── UcMemoryAccessType.class.st │ ├── UnicornConstants.class.st │ ├── UcARMRegisters.class.st │ ├── Unicorn.class.st │ ├── UcX86Registers.class.st │ └── UcARM64Registers.class.st └── BaselineOfUnicorn │ ├── package.st │ └── BaselineOfUnicorn.class.st ├── README.md └── LICENSE /.project: -------------------------------------------------------------------------------- 1 | { 2 | 'srcDirectory' : 'src' 3 | } -------------------------------------------------------------------------------- /src/.properties: -------------------------------------------------------------------------------- 1 | { 2 | #format : #tonel 3 | } -------------------------------------------------------------------------------- /src/Unicorn/package.st: -------------------------------------------------------------------------------- 1 | Package { #name : #Unicorn } 2 | -------------------------------------------------------------------------------- /src/BaselineOfUnicorn/package.st: -------------------------------------------------------------------------------- 1 | Package { #name : #BaselineOfUnicorn } 2 | -------------------------------------------------------------------------------- /src/Unicorn/UnicornError.class.st: -------------------------------------------------------------------------------- 1 | Class { 2 | #name : #UnicornError, 3 | #superclass : #Error, 4 | #category : #Unicorn 5 | } 6 | -------------------------------------------------------------------------------- /src/Unicorn/UnicornTypes.class.st: -------------------------------------------------------------------------------- 1 | " 2 | Shared pool containing type definitions and aliases for the Unicorn library 3 | " 4 | Class { 5 | #name : #UnicornTypes, 6 | #superclass : #SharedPool, 7 | #classVars : [ 8 | 'UC_arch', 9 | 'UC_err', 10 | 'UC_mode' 11 | ], 12 | #category : #Unicorn 13 | } 14 | 15 | { #category : #'class initialization' } 16 | UnicornTypes class >> initialize [ 17 | 18 | UC_err := #int. 19 | UC_arch := #int. 20 | UC_mode := #int. 21 | ] 22 | -------------------------------------------------------------------------------- /src/BaselineOfUnicorn/BaselineOfUnicorn.class.st: -------------------------------------------------------------------------------- 1 | Class { 2 | #name : #BaselineOfUnicorn, 3 | #superclass : #BaselineOf, 4 | #category : #BaselineOfUnicorn 5 | } 6 | 7 | { #category : #baseline } 8 | BaselineOfUnicorn >> baseline: spec [ 9 | 10 | spec 11 | for: #common 12 | do: [ 13 | spec package: 'Unicorn' ] 14 | ] 15 | 16 | { #category : #accessing } 17 | BaselineOfUnicorn >> project [ 18 | 19 | ^ super project 20 | loadType: #atomic; 21 | yourself 22 | ] 23 | -------------------------------------------------------------------------------- /src/Unicorn/UcHook.class.st: -------------------------------------------------------------------------------- 1 | Class { 2 | #name : #UcHook, 3 | #superclass : #Object, 4 | #instVars : [ 5 | 'handle', 6 | 'callback', 7 | 'type' 8 | ], 9 | #category : #Unicorn 10 | } 11 | 12 | { #category : #accessing } 13 | UcHook >> callback: aFFICallback [ 14 | callback := aFFICallback 15 | ] 16 | 17 | { #category : #accessing } 18 | UcHook >> handle: aCollection [ 19 | handle := aCollection 20 | ] 21 | 22 | { #category : #accessing } 23 | UcHook >> type: anUcHookType [ 24 | type := anUcHookType 25 | ] 26 | -------------------------------------------------------------------------------- /src/Unicorn/UnicornLibrary.class.st: -------------------------------------------------------------------------------- 1 | " 2 | I represent the Unicorn library, and I'm in charge of fetching it from the disk for further loading. 3 | " 4 | Class { 5 | #name : #UnicornLibrary, 6 | #superclass : #FFILibrary, 7 | #pools : [ 8 | 'UnicornTypes' 9 | ], 10 | #category : #Unicorn 11 | } 12 | 13 | { #category : #'accessing platform' } 14 | UnicornLibrary >> macModuleName [ 15 | 16 | ^ FFIMacLibraryFinder findLibrary: 'libunicorn.1.dylib' 17 | ] 18 | 19 | { #category : #'accessing platform' } 20 | UnicornLibrary >> unixModuleName [ 21 | ^ FFIUnix64LibraryFinder findLibrary: 'libunicorn.so' 22 | ] 23 | -------------------------------------------------------------------------------- /src/Unicorn/UcHookType.class.st: -------------------------------------------------------------------------------- 1 | Class { 2 | #name : #UcHookType, 3 | #superclass : #FFIExternalEnumeration, 4 | #classVars : [ 5 | 'UC_HOOK_BLOCK', 6 | 'UC_HOOK_CODE', 7 | 'UC_HOOK_INSN', 8 | 'UC_HOOK_INTR', 9 | 'UC_HOOK_MEM_FETCH', 10 | 'UC_HOOK_MEM_FETCH_PROT', 11 | 'UC_HOOK_MEM_FETCH_UNMAPPED', 12 | 'UC_HOOK_MEM_READ', 13 | 'UC_HOOK_MEM_READ_AFTER', 14 | 'UC_HOOK_MEM_READ_PROT', 15 | 'UC_HOOK_MEM_READ_UNMAPPED', 16 | 'UC_HOOK_MEM_WRITE', 17 | 'UC_HOOK_MEM_WRITE_PROT', 18 | 'UC_HOOK_MEM_WRITE_UNMAPPED' 19 | ], 20 | #category : #Unicorn 21 | } 22 | 23 | { #category : #'enum declaration' } 24 | UcHookType class >> enumDecl [ 25 | 26 | ^ #( 27 | UC_HOOK_INTR 1 "Hook all interrupt/syscall events" 28 | UC_HOOK_INSN 2 "Hook a particular instruction - only a very small subset of instructions supported here" 29 | UC_HOOK_CODE 4 "Hook a range of code" 30 | UC_HOOK_BLOCK 8 "Hook basic blocks" 31 | UC_HOOK_MEM_READ_UNMAPPED 16 "Hook for memory read on unmapped memory" 32 | UC_HOOK_MEM_WRITE_UNMAPPED 32 "Hook for invalid memory write events" 33 | UC_HOOK_MEM_FETCH_UNMAPPED 64 "Hook for invalid memory fetch for execution events" 34 | UC_HOOK_MEM_READ_PROT 128 "Hook for memory read on read-protected memory" 35 | UC_HOOK_MEM_WRITE_PROT 256 "Hook for memory write on write-protected memory" 36 | UC_HOOK_MEM_FETCH_PROT 512 "Hook for memory fetch on non-executable memory" 37 | UC_HOOK_MEM_READ 1024 "Hook memory read events." 38 | UC_HOOK_MEM_WRITE 2048 "Hook memory write events." 39 | UC_HOOK_MEM_FETCH 4096 "Hook memory fetch for execution events" 40 | UC_HOOK_MEM_READ_AFTER 8192 "Hook memory read events but only successful access. The callback will be triggered after successful read." 41 | ) 42 | ] 43 | 44 | { #category : #'as yet unclassified' } 45 | UcHookType class >> fetchingAccess [ 46 | 47 | ^ UC_HOOK_MEM_FETCH 48 | ] 49 | 50 | { #category : #'as yet unclassified' } 51 | UcHookType class >> illegalProtectedMemoryAccess [ 52 | 53 | "Hook type for all events of illegal protected memory access" 54 | ^ UC_HOOK_MEM_READ_PROT + UC_HOOK_MEM_WRITE_PROT + UC_HOOK_MEM_FETCH_PROT 55 | ] 56 | 57 | { #category : #'enum declaration' } 58 | UcHookType class >> initialize [ 59 | self initializeEnumeration 60 | ] 61 | 62 | { #category : #'enum declaration' } 63 | UcHookType class >> invalidMemoryAccess [ 64 | 65 | ^ self unmappedMemoryAccess + self illegalProtectedMemoryAccess 66 | ] 67 | 68 | { #category : #'as yet unclassified' } 69 | UcHookType class >> unmappedMemoryAccess [ 70 | 71 | "Hook type for all events of unmapped memory access" 72 | ^ UC_HOOK_MEM_READ_UNMAPPED + UC_HOOK_MEM_WRITE_UNMAPPED + UC_HOOK_MEM_FETCH_UNMAPPED 73 | ] 74 | 75 | { #category : #arithmetic } 76 | UcHookType >> + aHookType [ 77 | 78 | ^ self class basicNew 79 | value: (self value + aHookType value); 80 | yourself 81 | ] 82 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # pharo-unicorn 2 | Pharo bindings to the Unicorn library (https://www.unicorn-engine.org) 3 | 4 | ## Basic Example 5 | 6 | The following example shows the basic usage of the Unicorn binding, based on the original example from Unicorn's site in https://www.unicorn-engine.org/docs/tutorial.html. The example first creates an emulator and sets up 2MB of memory. It then writes two instructions on it that increase register ECX and decrease register EDX, and it initializes registers ECX and EDX with two values. Finally, it runs the programs and retrieves the modified values from the registers. 7 | 8 | ```smalltalk 9 | unicorn := Unicorn x86. 10 | address := 16r1000000. 11 | errorCode := unicorn mapMemoryOfSize: 2 * 1024 * 1024 atAddress: address withPermissions: UnicornConstants permissionAll. 12 | 13 | x86_CODE32 := #[ 16r41 16r4a ]. "INC ecx; DEC edx". 14 | errorCode := unicorn memoryAt: address write: x86_CODE32 size: x86_CODE32 size. 15 | 16 | ecx := UcX86Registers ecx. 17 | edx := UcX86Registers edx. 18 | 19 | ecxValue := #[ 16r34 16r12 ]. 20 | edxValue := #[ 16r90 16r78 ]. 21 | unicorn register: ecx value write: ecxValue. 22 | unicorn register: edx value write: edxValue. 23 | 24 | errorCode := unicorn startAt: address until: address + x86_CODE32 size timeout: 0 count: 0. 25 | 26 | unicorn register: ecx value readInto: ecxValue. 27 | unicorn register: edx value readInto: edxValue. 28 | ``` 29 | 30 | ## Creating a Unicorn engine 31 | 32 | Creating an engine requires providing an architecture and a mode to #architecture:mode: using the constants defined in UnicornConstants. Unicorn's class side defines some predefined constructors for common configurations: 33 | ```smalltalk 34 | engine := Unicorn arm. 35 | engine := Unicorn arm64. 36 | 37 | engine := Unicorn x86. 38 | engine := Unicorn x8664 39 | ``` 40 | ## Manipulating Memory 41 | 42 | ### Mapping memory 43 | 44 | To setup a memory in the emulator, two different ways are supported: either to map a new chunk of memory of a certain size to an address: 45 | ```smalltalk 46 | unicorn mapMemoryOfSize: 2 * 1024 * 1024 atAddress: address withPermissions: UnicornConstants permissionAll 47 | ``` 48 | Or to map an existing piece of memory (typically a pharo byte array). 49 | ```smalltalk 50 | unicorn mapHostMemory: aByteArray atAddress: address withPermissions: UnicornConstants permissionAll 51 | ``` 52 | Permissions set what is doable with that chunk of mapped memory and are combinable by simple aritmethic (they are a bit mask). 53 | 54 | ### Reading / Writing 55 | 56 | Methods #memoryAt:write: and #memoryAt:readNext: allow to write a byte array or read into a byte array to/from the memory at an address. 57 | 58 | ## Registers 59 | 60 | Two main methods allow reading and writing from/to registers: #register:readInto: and #register:write:. 61 | Registers are represented by ids in the different *Registers enumerations (see for example UcX86Registers). 62 | 63 | ## Emulation 64 | 65 | A single method (#startAt:until:timeout:count:) allows to start the execution of a memory at a location. Three different stop conditions can be set: a final address, a timeout in microseconds or a number of instructions to execute. 66 | -------------------------------------------------------------------------------- /src/Unicorn/UcMemoryAccessType.class.st: -------------------------------------------------------------------------------- 1 | Class { 2 | #name : #UcMemoryAccessType, 3 | #superclass : #FFIExternalEnumeration, 4 | #classVars : [ 5 | 'UC_MEM_FETCH', 6 | 'UC_MEM_FETCH_PROT', 7 | 'UC_MEM_FETCH_UNMAPPED', 8 | 'UC_MEM_READ', 9 | 'UC_MEM_READ_AFTER', 10 | 'UC_MEM_READ_PROT', 11 | 'UC_MEM_READ_UNMAPPED', 12 | 'UC_MEM_WRITE', 13 | 'UC_MEM_WRITE_PROT', 14 | 'UC_MEM_WRITE_UNMAPPED' 15 | ], 16 | #category : #Unicorn 17 | } 18 | 19 | { #category : #'accessing enum' } 20 | UcMemoryAccessType class >> UC_MEM_FETCH [ 21 | "This method was automatically generated" 22 | ^ UC_MEM_FETCH 23 | ] 24 | 25 | { #category : #'accessing enum' } 26 | UcMemoryAccessType class >> UC_MEM_FETCH_PROT [ 27 | "This method was automatically generated" 28 | ^ UC_MEM_FETCH_PROT 29 | ] 30 | 31 | { #category : #'accessing enum' } 32 | UcMemoryAccessType class >> UC_MEM_FETCH_UNMAPPED [ 33 | "This method was automatically generated" 34 | ^ UC_MEM_FETCH_UNMAPPED 35 | ] 36 | 37 | { #category : #'accessing enum' } 38 | UcMemoryAccessType class >> UC_MEM_READ [ 39 | "This method was automatically generated" 40 | ^ UC_MEM_READ 41 | ] 42 | 43 | { #category : #'accessing enum' } 44 | UcMemoryAccessType class >> UC_MEM_READ_AFTER [ 45 | "This method was automatically generated" 46 | ^ UC_MEM_READ_AFTER 47 | ] 48 | 49 | { #category : #'accessing enum' } 50 | UcMemoryAccessType class >> UC_MEM_READ_PROT [ 51 | "This method was automatically generated" 52 | ^ UC_MEM_READ_PROT 53 | ] 54 | 55 | { #category : #'accessing enum' } 56 | UcMemoryAccessType class >> UC_MEM_READ_UNMAPPED [ 57 | "This method was automatically generated" 58 | ^ UC_MEM_READ_UNMAPPED 59 | ] 60 | 61 | { #category : #'accessing enum' } 62 | UcMemoryAccessType class >> UC_MEM_WRITE [ 63 | "This method was automatically generated" 64 | ^ UC_MEM_WRITE 65 | ] 66 | 67 | { #category : #'accessing enum' } 68 | UcMemoryAccessType class >> UC_MEM_WRITE_PROT [ 69 | "This method was automatically generated" 70 | ^ UC_MEM_WRITE_PROT 71 | ] 72 | 73 | { #category : #'accessing enum' } 74 | UcMemoryAccessType class >> UC_MEM_WRITE_UNMAPPED [ 75 | "This method was automatically generated" 76 | ^ UC_MEM_WRITE_UNMAPPED 77 | ] 78 | 79 | { #category : #'enum declaration' } 80 | UcMemoryAccessType class >> enumDecl [ 81 | 82 | ^ #( 83 | UC_MEM_READ 16 "Memory is read from" 84 | UC_MEM_WRITE 17 "Memory is written to" 85 | UC_MEM_FETCH 18 "Memory is fetched" 86 | UC_MEM_READ_UNMAPPED 19 "Unmapped memory is read from" 87 | UC_MEM_WRITE_UNMAPPED 20 "Unmapped memory is written to" 88 | UC_MEM_FETCH_UNMAPPED 21 "Unmapped memory is fetched" 89 | UC_MEM_WRITE_PROT 22 "Write to write protected, but mapped, memory" 90 | UC_MEM_READ_PROT 23 "Read from read protected, but mapped, memory" 91 | UC_MEM_FETCH_PROT 24 "Fetch from non-executable, but mapped, memory" 92 | UC_MEM_READ_AFTER 25 "Memory is read from (successful access)" 93 | ) 94 | ] 95 | 96 | { #category : #'class initialization' } 97 | UcMemoryAccessType class >> initialize [ 98 | self initializeEnumeration 99 | ] 100 | -------------------------------------------------------------------------------- /src/Unicorn/UnicornConstants.class.st: -------------------------------------------------------------------------------- 1 | " 2 | I define constants required for initializing and configuring an engine. 3 | " 4 | Class { 5 | #name : #UnicornConstants, 6 | #superclass : #SharedPool, 7 | #classVars : [ 8 | 'UC_ARCH_ARM', 9 | 'UC_ARCH_ARM64', 10 | 'UC_ARCH_X86', 11 | 'UC_ERR_OK', 12 | 'UC_MODE_16', 13 | 'UC_MODE_32', 14 | 'UC_MODE_64', 15 | 'UC_MODE_ARM', 16 | 'UC_MODE_BIG_ENDIAN', 17 | 'UC_MODE_LITTLE_ENDIAN', 18 | 'UC_MODE_MCLASS', 19 | 'UC_MODE_THUMB', 20 | 'UC_MODE_V8', 21 | 'UC_PROT_ALL', 22 | 'UC_PROT_EXEC', 23 | 'UC_PROT_NONE', 24 | 'UC_PROT_READ', 25 | 'UC_PROT_WRITE', 26 | 'UC_QUERY_ARCH', 27 | 'UC_QUERY_INSTR_COUNT', 28 | 'UC_QUERY_LAST_INSTR_ADDRESS', 29 | 'UC_QUERY_LAST_INSTR_SIZE', 30 | 'UC_QUERY_MODE', 31 | 'UC_QUERY_PAGE_SIZE', 32 | 'UC_QUERY_TIMEOUT' 33 | ], 34 | #pools : [ 35 | 'UnicornTypes' 36 | ], 37 | #category : #Unicorn 38 | } 39 | 40 | { #category : #'class initialization' } 41 | UnicornConstants class >> initialize [ 42 | UC_ARCH_ARM := 1. "ARM architecture (including Thumb, Thumb-2)" 43 | UC_ARCH_ARM64 := 2. "ARM-64, also called AArch64" 44 | "UC_ARCH_MIPS, // Mips architecture" 45 | UC_ARCH_X86 := 4. " // X86 architecture (including x86 & x86-64)" 46 | " 47 | UC_ARCH_PPC, // PowerPC architecture (currently unsupported) 48 | UC_ARCH_SPARC, // Sparc architecture 49 | UC_ARCH_M68K, // M68K architecture" 50 | 51 | "little / big endian" 52 | UC_MODE_LITTLE_ENDIAN := 0. "little-endian mode (default mode)" 53 | UC_MODE_BIG_ENDIAN := 1 << 30. "big-endian mode" 54 | 55 | "arm / arm64" 56 | UC_MODE_ARM := 0. "ARM mode" 57 | UC_MODE_THUMB := 1 << 4. "THUMB mode (including Thumb-2)" 58 | UC_MODE_MCLASS := 1 << 5. "ARM's Cortex-M series (currently unsupported)" 59 | UC_MODE_V8 := 1 << 6. "ARMv8 A32 encodings for ARM (currently unsupported)" 60 | 61 | "x86 / x64" 62 | UC_MODE_16 := 1 << 1. "16-bit mode" 63 | UC_MODE_32 := 1 << 2. "32-bit mode" 64 | UC_MODE_64 := 1 << 3. "64-bit mode" 65 | 66 | UC_ERR_OK := 0. 67 | 68 | "Memory Protection Modes" 69 | UC_PROT_NONE := 0. 70 | UC_PROT_READ := 1. 71 | UC_PROT_WRITE := 2. 72 | UC_PROT_EXEC := 4. 73 | UC_PROT_ALL := 7. 74 | 75 | "All type of queries for uc_query() API." 76 | 77 | UC_QUERY_MODE := 1. "Dynamically query current hardware mode" 78 | UC_QUERY_PAGE_SIZE := 2. "query pagesize of engine" 79 | UC_QUERY_ARCH := 3. "query architecture of engine (for ARM to query Thumb mode)" 80 | UC_QUERY_TIMEOUT := 4. "query if emulation stops due to timeout (indicated if result = True)" 81 | UC_QUERY_INSTR_COUNT := 5. "query the number of counted instructions in last execution" 82 | UC_QUERY_LAST_INSTR_ADDRESS := 6. "query the number of counted instructions in last execution" UC_QUERY_LAST_INSTR_SIZE := 7. "query the number of counted instructions in last execution" 83 | 84 | ] 85 | 86 | { #category : #api } 87 | UnicornConstants class >> isOk: anInteger [ 88 | 89 | ^ anInteger = UC_ERR_OK 90 | ] 91 | 92 | { #category : #accessing } 93 | UnicornConstants class >> permissionAll [ 94 | 95 | ^ UC_PROT_ALL 96 | ] 97 | 98 | { #category : #accessing } 99 | UnicornConstants class >> permissionExecute [ 100 | 101 | ^ UC_PROT_EXEC 102 | ] 103 | 104 | { #category : #accessing } 105 | UnicornConstants class >> permissionNone [ 106 | 107 | ^ UC_PROT_NONE 108 | ] 109 | 110 | { #category : #accessing } 111 | UnicornConstants class >> permissionRead [ 112 | 113 | ^ UC_PROT_READ 114 | ] 115 | 116 | { #category : #accessing } 117 | UnicornConstants class >> permissionWrite [ 118 | 119 | ^ UC_PROT_WRITE 120 | ] 121 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU LESSER GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | 9 | This version of the GNU Lesser General Public License incorporates 10 | the terms and conditions of version 3 of the GNU General Public 11 | License, supplemented by the additional permissions listed below. 12 | 13 | 0. Additional Definitions. 14 | 15 | As used herein, "this License" refers to version 3 of the GNU Lesser 16 | General Public License, and the "GNU GPL" refers to version 3 of the GNU 17 | General Public License. 18 | 19 | "The Library" refers to a covered work governed by this License, 20 | other than an Application or a Combined Work as defined below. 21 | 22 | An "Application" is any work that makes use of an interface provided 23 | by the Library, but which is not otherwise based on the Library. 24 | Defining a subclass of a class defined by the Library is deemed a mode 25 | of using an interface provided by the Library. 26 | 27 | A "Combined Work" is a work produced by combining or linking an 28 | Application with the Library. The particular version of the Library 29 | with which the Combined Work was made is also called the "Linked 30 | Version". 31 | 32 | The "Minimal Corresponding Source" for a Combined Work means the 33 | Corresponding Source for the Combined Work, excluding any source code 34 | for portions of the Combined Work that, considered in isolation, are 35 | based on the Application, and not on the Linked Version. 36 | 37 | The "Corresponding Application Code" for a Combined Work means the 38 | object code and/or source code for the Application, including any data 39 | and utility programs needed for reproducing the Combined Work from the 40 | Application, but excluding the System Libraries of the Combined Work. 41 | 42 | 1. Exception to Section 3 of the GNU GPL. 43 | 44 | You may convey a covered work under sections 3 and 4 of this License 45 | without being bound by section 3 of the GNU GPL. 46 | 47 | 2. Conveying Modified Versions. 48 | 49 | If you modify a copy of the Library, and, in your modifications, a 50 | facility refers to a function or data to be supplied by an Application 51 | that uses the facility (other than as an argument passed when the 52 | facility is invoked), then you may convey a copy of the modified 53 | version: 54 | 55 | a) under this License, provided that you make a good faith effort to 56 | ensure that, in the event an Application does not supply the 57 | function or data, the facility still operates, and performs 58 | whatever part of its purpose remains meaningful, or 59 | 60 | b) under the GNU GPL, with none of the additional permissions of 61 | this License applicable to that copy. 62 | 63 | 3. Object Code Incorporating Material from Library Header Files. 64 | 65 | The object code form of an Application may incorporate material from 66 | a header file that is part of the Library. You may convey such object 67 | code under terms of your choice, provided that, if the incorporated 68 | material is not limited to numerical parameters, data structure 69 | layouts and accessors, or small macros, inline functions and templates 70 | (ten or fewer lines in length), you do both of the following: 71 | 72 | a) Give prominent notice with each copy of the object code that the 73 | Library is used in it and that the Library and its use are 74 | covered by this License. 75 | 76 | b) Accompany the object code with a copy of the GNU GPL and this license 77 | document. 78 | 79 | 4. Combined Works. 80 | 81 | You may convey a Combined Work under terms of your choice that, 82 | taken together, effectively do not restrict modification of the 83 | portions of the Library contained in the Combined Work and reverse 84 | engineering for debugging such modifications, if you also do each of 85 | the following: 86 | 87 | a) Give prominent notice with each copy of the Combined Work that 88 | the Library is used in it and that the Library and its use are 89 | covered by this License. 90 | 91 | b) Accompany the Combined Work with a copy of the GNU GPL and this license 92 | document. 93 | 94 | c) For a Combined Work that displays copyright notices during 95 | execution, include the copyright notice for the Library among 96 | these notices, as well as a reference directing the user to the 97 | copies of the GNU GPL and this license document. 98 | 99 | d) Do one of the following: 100 | 101 | 0) Convey the Minimal Corresponding Source under the terms of this 102 | License, and the Corresponding Application Code in a form 103 | suitable for, and under terms that permit, the user to 104 | recombine or relink the Application with a modified version of 105 | the Linked Version to produce a modified Combined Work, in the 106 | manner specified by section 6 of the GNU GPL for conveying 107 | Corresponding Source. 108 | 109 | 1) Use a suitable shared library mechanism for linking with the 110 | Library. A suitable mechanism is one that (a) uses at run time 111 | a copy of the Library already present on the user's computer 112 | system, and (b) will operate properly with a modified version 113 | of the Library that is interface-compatible with the Linked 114 | Version. 115 | 116 | e) Provide Installation Information, but only if you would otherwise 117 | be required to provide such information under section 6 of the 118 | GNU GPL, and only to the extent that such information is 119 | necessary to install and execute a modified version of the 120 | Combined Work produced by recombining or relinking the 121 | Application with a modified version of the Linked Version. (If 122 | you use option 4d0, the Installation Information must accompany 123 | the Minimal Corresponding Source and Corresponding Application 124 | Code. If you use option 4d1, you must provide the Installation 125 | Information in the manner specified by section 6 of the GNU GPL 126 | for conveying Corresponding Source.) 127 | 128 | 5. Combined Libraries. 129 | 130 | You may place library facilities that are a work based on the 131 | Library side by side in a single library together with other library 132 | facilities that are not Applications and are not covered by this 133 | License, and convey such a combined library under terms of your 134 | choice, if you do both of the following: 135 | 136 | a) Accompany the combined library with a copy of the same work based 137 | on the Library, uncombined with any other library facilities, 138 | conveyed under the terms of this License. 139 | 140 | b) Give prominent notice with the combined library that part of it 141 | is a work based on the Library, and explaining where to find the 142 | accompanying uncombined form of the same work. 143 | 144 | 6. Revised Versions of the GNU Lesser General Public License. 145 | 146 | The Free Software Foundation may publish revised and/or new versions 147 | of the GNU Lesser General Public License from time to time. Such new 148 | versions will be similar in spirit to the present version, but may 149 | differ in detail to address new problems or concerns. 150 | 151 | Each version is given a distinguishing version number. If the 152 | Library as you received it specifies that a certain numbered version 153 | of the GNU Lesser General Public License "or any later version" 154 | applies to it, you have the option of following the terms and 155 | conditions either of that published version or of any later version 156 | published by the Free Software Foundation. If the Library as you 157 | received it does not specify a version number of the GNU Lesser 158 | General Public License, you may choose any version of the GNU Lesser 159 | General Public License ever published by the Free Software Foundation. 160 | 161 | If the Library as you received it specifies that a proxy can decide 162 | whether future versions of the GNU Lesser General Public License shall 163 | apply, that proxy's public statement of acceptance of any version is 164 | permanent authorization for you to choose that version for the 165 | Library. 166 | -------------------------------------------------------------------------------- /src/Unicorn/UcARMRegisters.class.st: -------------------------------------------------------------------------------- 1 | " 2 | I define ARM 32bits register constants. 3 | " 4 | Class { 5 | #name : #UcARMRegisters, 6 | #superclass : #FFIExternalEnumeration, 7 | #classVars : [ 8 | 'UC_ARM_REG_APSR', 9 | 'UC_ARM_REG_APSR_NZCV', 10 | 'UC_ARM_REG_C13_C0_2', 11 | 'UC_ARM_REG_C13_C0_3', 12 | 'UC_ARM_REG_C1_C0_2', 13 | 'UC_ARM_REG_CONTROL', 14 | 'UC_ARM_REG_CPSR', 15 | 'UC_ARM_REG_D0', 16 | 'UC_ARM_REG_D1', 17 | 'UC_ARM_REG_D10', 18 | 'UC_ARM_REG_D11', 19 | 'UC_ARM_REG_D12', 20 | 'UC_ARM_REG_D13', 21 | 'UC_ARM_REG_D14', 22 | 'UC_ARM_REG_D15', 23 | 'UC_ARM_REG_D16', 24 | 'UC_ARM_REG_D17', 25 | 'UC_ARM_REG_D18', 26 | 'UC_ARM_REG_D19', 27 | 'UC_ARM_REG_D2', 28 | 'UC_ARM_REG_D20', 29 | 'UC_ARM_REG_D21', 30 | 'UC_ARM_REG_D22', 31 | 'UC_ARM_REG_D23', 32 | 'UC_ARM_REG_D24', 33 | 'UC_ARM_REG_D25', 34 | 'UC_ARM_REG_D26', 35 | 'UC_ARM_REG_D27', 36 | 'UC_ARM_REG_D28', 37 | 'UC_ARM_REG_D29', 38 | 'UC_ARM_REG_D3', 39 | 'UC_ARM_REG_D30', 40 | 'UC_ARM_REG_D31', 41 | 'UC_ARM_REG_D4', 42 | 'UC_ARM_REG_D5', 43 | 'UC_ARM_REG_D6', 44 | 'UC_ARM_REG_D7', 45 | 'UC_ARM_REG_D8', 46 | 'UC_ARM_REG_D9', 47 | 'UC_ARM_REG_ENDING', 48 | 'UC_ARM_REG_FP', 49 | 'UC_ARM_REG_FPEXC', 50 | 'UC_ARM_REG_FPINST', 51 | 'UC_ARM_REG_FPINST2', 52 | 'UC_ARM_REG_FPSCR', 53 | 'UC_ARM_REG_FPSCR_NZCV', 54 | 'UC_ARM_REG_FPSID', 55 | 'UC_ARM_REG_INVALID', 56 | 'UC_ARM_REG_IP', 57 | 'UC_ARM_REG_IPSR', 58 | 'UC_ARM_REG_ITSTATE', 59 | 'UC_ARM_REG_LR', 60 | 'UC_ARM_REG_MSP', 61 | 'UC_ARM_REG_MVFR0', 62 | 'UC_ARM_REG_MVFR1', 63 | 'UC_ARM_REG_MVFR2', 64 | 'UC_ARM_REG_PC', 65 | 'UC_ARM_REG_PSP', 66 | 'UC_ARM_REG_Q0', 67 | 'UC_ARM_REG_Q1', 68 | 'UC_ARM_REG_Q10', 69 | 'UC_ARM_REG_Q11', 70 | 'UC_ARM_REG_Q12', 71 | 'UC_ARM_REG_Q13', 72 | 'UC_ARM_REG_Q14', 73 | 'UC_ARM_REG_Q15', 74 | 'UC_ARM_REG_Q2', 75 | 'UC_ARM_REG_Q3', 76 | 'UC_ARM_REG_Q4', 77 | 'UC_ARM_REG_Q5', 78 | 'UC_ARM_REG_Q6', 79 | 'UC_ARM_REG_Q7', 80 | 'UC_ARM_REG_Q8', 81 | 'UC_ARM_REG_Q9', 82 | 'UC_ARM_REG_R0', 83 | 'UC_ARM_REG_R1', 84 | 'UC_ARM_REG_R10', 85 | 'UC_ARM_REG_R11', 86 | 'UC_ARM_REG_R12', 87 | 'UC_ARM_REG_R13', 88 | 'UC_ARM_REG_R14', 89 | 'UC_ARM_REG_R15', 90 | 'UC_ARM_REG_R2', 91 | 'UC_ARM_REG_R3', 92 | 'UC_ARM_REG_R4', 93 | 'UC_ARM_REG_R5', 94 | 'UC_ARM_REG_R6', 95 | 'UC_ARM_REG_R7', 96 | 'UC_ARM_REG_R8', 97 | 'UC_ARM_REG_R9', 98 | 'UC_ARM_REG_S0', 99 | 'UC_ARM_REG_S1', 100 | 'UC_ARM_REG_S10', 101 | 'UC_ARM_REG_S11', 102 | 'UC_ARM_REG_S12', 103 | 'UC_ARM_REG_S13', 104 | 'UC_ARM_REG_S14', 105 | 'UC_ARM_REG_S15', 106 | 'UC_ARM_REG_S16', 107 | 'UC_ARM_REG_S17', 108 | 'UC_ARM_REG_S18', 109 | 'UC_ARM_REG_S19', 110 | 'UC_ARM_REG_S2', 111 | 'UC_ARM_REG_S20', 112 | 'UC_ARM_REG_S21', 113 | 'UC_ARM_REG_S22', 114 | 'UC_ARM_REG_S23', 115 | 'UC_ARM_REG_S24', 116 | 'UC_ARM_REG_S25', 117 | 'UC_ARM_REG_S26', 118 | 'UC_ARM_REG_S27', 119 | 'UC_ARM_REG_S28', 120 | 'UC_ARM_REG_S29', 121 | 'UC_ARM_REG_S3', 122 | 'UC_ARM_REG_S30', 123 | 'UC_ARM_REG_S31', 124 | 'UC_ARM_REG_S4', 125 | 'UC_ARM_REG_S5', 126 | 'UC_ARM_REG_S6', 127 | 'UC_ARM_REG_S7', 128 | 'UC_ARM_REG_S8', 129 | 'UC_ARM_REG_S9', 130 | 'UC_ARM_REG_SB', 131 | 'UC_ARM_REG_SL', 132 | 'UC_ARM_REG_SP', 133 | 'UC_ARM_REG_SPSR' 134 | ], 135 | #category : #Unicorn 136 | } 137 | 138 | { #category : #accessing } 139 | UcARMRegisters class >> d0 [ 140 | ^ UC_ARM_REG_D0 141 | ] 142 | 143 | { #category : #accessing } 144 | UcARMRegisters class >> d1 [ 145 | ^ UC_ARM_REG_D1 146 | ] 147 | 148 | { #category : #accessing } 149 | UcARMRegisters class >> d10 [ 150 | ^ UC_ARM_REG_D10 151 | ] 152 | 153 | { #category : #accessing } 154 | UcARMRegisters class >> d11 [ 155 | ^ UC_ARM_REG_D11 156 | ] 157 | 158 | { #category : #accessing } 159 | UcARMRegisters class >> d12 [ 160 | ^ UC_ARM_REG_D12 161 | ] 162 | 163 | { #category : #accessing } 164 | UcARMRegisters class >> d13 [ 165 | ^ UC_ARM_REG_D13 166 | ] 167 | 168 | { #category : #accessing } 169 | UcARMRegisters class >> d14 [ 170 | ^ UC_ARM_REG_D14 171 | ] 172 | 173 | { #category : #accessing } 174 | UcARMRegisters class >> d15 [ 175 | ^ UC_ARM_REG_D15 176 | ] 177 | 178 | { #category : #accessing } 179 | UcARMRegisters class >> d2 [ 180 | ^ UC_ARM_REG_D2 181 | ] 182 | 183 | { #category : #accessing } 184 | UcARMRegisters class >> d3 [ 185 | ^ UC_ARM_REG_D3 186 | ] 187 | 188 | { #category : #accessing } 189 | UcARMRegisters class >> d4 [ 190 | ^ UC_ARM_REG_D4 191 | ] 192 | 193 | { #category : #accessing } 194 | UcARMRegisters class >> d5 [ 195 | ^ UC_ARM_REG_D5 196 | ] 197 | 198 | { #category : #accessing } 199 | UcARMRegisters class >> d6 [ 200 | ^ UC_ARM_REG_D6 201 | ] 202 | 203 | { #category : #accessing } 204 | UcARMRegisters class >> d7 [ 205 | ^ UC_ARM_REG_D7 206 | ] 207 | 208 | { #category : #accessing } 209 | UcARMRegisters class >> d8 [ 210 | ^ UC_ARM_REG_D8 211 | ] 212 | 213 | { #category : #accessing } 214 | UcARMRegisters class >> d9 [ 215 | ^ UC_ARM_REG_D9 216 | ] 217 | 218 | { #category : #accessing } 219 | UcARMRegisters class >> eflags [ 220 | ^ UC_ARM_REG_EFLAGS 221 | ] 222 | 223 | { #category : #'enum declaration' } 224 | UcARMRegisters class >> enumDecl [ 225 | 226 | ^ #( 227 | UC_ARM_REG_INVALID 0 228 | UC_ARM_REG_APSR 1 229 | UC_ARM_REG_APSR_NZCV 2 230 | UC_ARM_REG_CPSR 3 231 | UC_ARM_REG_FPEXC 4 232 | UC_ARM_REG_FPINST 5 233 | UC_ARM_REG_FPSCR 6 234 | UC_ARM_REG_FPSCR_NZCV 7 235 | UC_ARM_REG_FPSID 8 236 | UC_ARM_REG_ITSTATE 9 237 | UC_ARM_REG_LR 10 238 | UC_ARM_REG_PC 11 239 | UC_ARM_REG_SP 12 240 | UC_ARM_REG_SPSR 13 241 | UC_ARM_REG_D0 14 242 | UC_ARM_REG_D1 15 243 | UC_ARM_REG_D2 16 244 | UC_ARM_REG_D3 17 245 | UC_ARM_REG_D4 18 246 | UC_ARM_REG_D5 19 247 | UC_ARM_REG_D6 20 248 | UC_ARM_REG_D7 21 249 | UC_ARM_REG_D8 22 250 | UC_ARM_REG_D9 23 251 | UC_ARM_REG_D10 24 252 | UC_ARM_REG_D11 25 253 | UC_ARM_REG_D12 26 254 | UC_ARM_REG_D13 27 255 | UC_ARM_REG_D14 28 256 | UC_ARM_REG_D15 29 257 | UC_ARM_REG_D16 30 258 | UC_ARM_REG_D17 31 259 | UC_ARM_REG_D18 32 260 | UC_ARM_REG_D19 33 261 | UC_ARM_REG_D20 34 262 | UC_ARM_REG_D21 35 263 | UC_ARM_REG_D22 36 264 | UC_ARM_REG_D23 37 265 | UC_ARM_REG_D24 38 266 | UC_ARM_REG_D25 39 267 | UC_ARM_REG_D26 40 268 | UC_ARM_REG_D27 41 269 | UC_ARM_REG_D28 42 270 | UC_ARM_REG_D29 43 271 | UC_ARM_REG_D30 44 272 | UC_ARM_REG_D31 45 273 | UC_ARM_REG_FPINST2 46 274 | UC_ARM_REG_MVFR0 47 275 | UC_ARM_REG_MVFR1 48 276 | UC_ARM_REG_MVFR2 49 277 | UC_ARM_REG_Q0 50 278 | UC_ARM_REG_Q1 51 279 | UC_ARM_REG_Q2 52 280 | UC_ARM_REG_Q3 53 281 | UC_ARM_REG_Q4 54 282 | UC_ARM_REG_Q5 55 283 | UC_ARM_REG_Q6 56 284 | UC_ARM_REG_Q7 57 285 | UC_ARM_REG_Q8 58 286 | UC_ARM_REG_Q9 59 287 | UC_ARM_REG_Q10 60 288 | UC_ARM_REG_Q11 61 289 | UC_ARM_REG_Q12 62 290 | UC_ARM_REG_Q13 63 291 | UC_ARM_REG_Q14 64 292 | UC_ARM_REG_Q15 65 293 | UC_ARM_REG_R0 66 294 | UC_ARM_REG_R1 67 295 | UC_ARM_REG_R2 68 296 | UC_ARM_REG_R3 69 297 | UC_ARM_REG_R4 70 298 | UC_ARM_REG_R5 71 299 | UC_ARM_REG_R6 72 300 | UC_ARM_REG_R7 73 301 | UC_ARM_REG_R8 74 302 | UC_ARM_REG_R9 75 303 | UC_ARM_REG_R10 76 304 | UC_ARM_REG_R11 77 305 | UC_ARM_REG_R12 78 306 | UC_ARM_REG_S0 79 307 | UC_ARM_REG_S1 80 308 | UC_ARM_REG_S2 81 309 | UC_ARM_REG_S3 82 310 | UC_ARM_REG_S4 83 311 | UC_ARM_REG_S5 84 312 | UC_ARM_REG_S6 85 313 | UC_ARM_REG_S7 86 314 | UC_ARM_REG_S8 87 315 | UC_ARM_REG_S9 88 316 | UC_ARM_REG_S10 89 317 | UC_ARM_REG_S11 90 318 | UC_ARM_REG_S12 91 319 | UC_ARM_REG_S13 92 320 | UC_ARM_REG_S14 93 321 | UC_ARM_REG_S15 94 322 | UC_ARM_REG_S16 95 323 | UC_ARM_REG_S17 96 324 | UC_ARM_REG_S18 97 325 | UC_ARM_REG_S19 98 326 | UC_ARM_REG_S20 99 327 | UC_ARM_REG_S21 100 328 | UC_ARM_REG_S22 101 329 | UC_ARM_REG_S23 102 330 | UC_ARM_REG_S24 103 331 | UC_ARM_REG_S25 104 332 | UC_ARM_REG_S26 105 333 | UC_ARM_REG_S27 106 334 | UC_ARM_REG_S28 107 335 | UC_ARM_REG_S29 108 336 | UC_ARM_REG_S30 109 337 | UC_ARM_REG_S31 110 338 | UC_ARM_REG_C1_C0_2 111 339 | UC_ARM_REG_C13_C0_2 112 340 | UC_ARM_REG_C13_C0_3 113 341 | UC_ARM_REG_IPSR 114 342 | UC_ARM_REG_MSP 115 343 | UC_ARM_REG_PSP 116 344 | UC_ARM_REG_CONTROL 117 345 | UC_ARM_REG_ENDING 118 346 | UC_ARM_REG_R13 12 347 | UC_ARM_REG_R14 10 348 | UC_ARM_REG_R15 11 349 | UC_ARM_REG_SB 75 350 | UC_ARM_REG_SL 76 351 | UC_ARM_REG_FP 77 352 | UC_ARM_REG_IP 78 353 | ) 354 | ] 355 | 356 | { #category : #accessing } 357 | UcARMRegisters class >> fp [ 358 | ^ UC_ARM_REG_FP 359 | ] 360 | 361 | { #category : #'as yet unclassified' } 362 | UcARMRegisters class >> fpexc [ 363 | 364 | ^ UC_ARM_REG_FPEXC 365 | ] 366 | 367 | { #category : #'class initialization' } 368 | UcARMRegisters class >> initialize [ 369 | self initializeEnumeration 370 | ] 371 | 372 | { #category : #accessing } 373 | UcARMRegisters class >> lr [ 374 | ^ UC_ARM_REG_LR 375 | ] 376 | 377 | { #category : #accessing } 378 | UcARMRegisters class >> pc [ 379 | ^ UC_ARM_REG_PC 380 | ] 381 | 382 | { #category : #accessing } 383 | UcARMRegisters class >> r0 [ 384 | ^ UC_ARM_REG_R0 385 | ] 386 | 387 | { #category : #accessing } 388 | UcARMRegisters class >> r1 [ 389 | ^ UC_ARM_REG_R1 390 | ] 391 | 392 | { #category : #accessing } 393 | UcARMRegisters class >> r10 [ 394 | ^ UC_ARM_REG_R10 395 | ] 396 | 397 | { #category : #accessing } 398 | UcARMRegisters class >> r11 [ 399 | 400 | ^ UC_ARM_REG_R11 401 | ] 402 | 403 | { #category : #accessing } 404 | UcARMRegisters class >> r12 [ 405 | ^ UC_ARM_REG_R12 406 | ] 407 | 408 | { #category : #accessing } 409 | UcARMRegisters class >> r2 [ 410 | ^ UC_ARM_REG_R2 411 | ] 412 | 413 | { #category : #accessing } 414 | UcARMRegisters class >> r3 [ 415 | ^ UC_ARM_REG_R3 416 | ] 417 | 418 | { #category : #accessing } 419 | UcARMRegisters class >> r4 [ 420 | ^ UC_ARM_REG_R4 421 | ] 422 | 423 | { #category : #accessing } 424 | UcARMRegisters class >> r5 [ 425 | ^ UC_ARM_REG_R5 426 | ] 427 | 428 | { #category : #accessing } 429 | UcARMRegisters class >> r6 [ 430 | ^ UC_ARM_REG_R6 431 | ] 432 | 433 | { #category : #accessing } 434 | UcARMRegisters class >> r7 [ 435 | ^ UC_ARM_REG_R7 436 | ] 437 | 438 | { #category : #accessing } 439 | UcARMRegisters class >> r8 [ 440 | ^ UC_ARM_REG_R8 441 | ] 442 | 443 | { #category : #accessing } 444 | UcARMRegisters class >> r9 [ 445 | ^ UC_ARM_REG_R9 446 | ] 447 | 448 | { #category : #accessing } 449 | UcARMRegisters class >> sl [ 450 | ^ UC_ARM_REG_SL 451 | ] 452 | 453 | { #category : #accessing } 454 | UcARMRegisters class >> sp [ 455 | ^ UC_ARM_REG_SP 456 | ] 457 | -------------------------------------------------------------------------------- /src/Unicorn/Unicorn.class.st: -------------------------------------------------------------------------------- 1 | " 2 | I am the main entry point for Unicorn users. 3 | Once an engine is created, users can use me to read/write memory and registers, and execute code. 4 | 5 | # Basic Example 6 | 7 | The following example shows the basic usage of the Unicorn binding, based on the original example from Unicorn's site in https://www.unicorn-engine.org/docs/tutorial.html. The example first creates an emulator and sets up 2MB of memory. It then writes two instructions on it that increase register ECX and decrease register EDX, and it initializes registers ECX and EDX with two values. Finally, it runs the programs and retrieves the modified values from the registers. 8 | 9 | unicorn := Unicorn x86. 10 | address := 16r1000000. 11 | errorCode := unicorn mapMemoryOfSize: 2 * 1024 * 1024 atAddress: address withPermissions: UnicornConstants permissionAll. 12 | 13 | x86_CODE32 := #[ 16r41 16r4a ]. ""INC ecx; DEC edx"". 14 | errorCode := unicorn memoryAt: address write: x86_CODE32 size: x86_CODE32 size. 15 | 16 | ecx := UcX86Registers ecx. 17 | edx := UcX86Registers edx. 18 | 19 | ecxValue := #[ 16r34 16r12 ]. 20 | edxValue := #[ 16r90 16r78 ]. 21 | unicorn register: ecx value write: ecxValue. 22 | unicorn register: edx value write: edxValue. 23 | 24 | errorCode := unicorn startAt: address until: address + x86_CODE32 size timeout: 0 count: 0. 25 | 26 | unicorn register: ecx value readInto: ecxValue. 27 | unicorn register: edx value readInto: edxValue. 28 | 29 | # Creating a Unicorn engine 30 | 31 | Creating an engine requires providing an architecture and a mode to #architecture:mode: using the constants defined in UnicornConstants. Unicorn's class side defines some predefined constructors for common configurations: 32 | 33 | engine := Unicorn arm. 34 | engine := Unicorn arm64. 35 | 36 | engine := Unicorn x86. 37 | engine := Unicorn x8664 38 | 39 | # Manipulating Memory 40 | 41 | ## Mapping memory 42 | 43 | To setup a memory in the emulator, two different ways are supported: either to map a new chunk of memory of a certain size to an address: 44 | 45 | unicorn mapMemoryOfSize: 2 * 1024 * 1024 atAddress: address withPermissions: UnicornConstants permissionAll 46 | 47 | Or to map an existing piece of memory (typically a pharo byte array). 48 | 49 | unicorn mapHostMemory: aByteArray atAddress: address withPermissions: UnicornConstants permissionAll 50 | 51 | Permissions set what is doable with that chunk of mapped memory and are combinable by simple aritmethic (they are a bit mask). 52 | 53 | ## Reading / Writing 54 | 55 | Methods #memoryAt:write: and #memoryAt:readNext: allow to write a byte array or read into a byte array to/from the memory at an address. 56 | 57 | ## Registers 58 | 59 | Two main methods allow reading and writing from/to registers: #register:readInto: and #register:write:. 60 | Registers are represented by ids in the different *Registers enumerations (see for example UcX86Registers). 61 | 62 | # Emulation 63 | 64 | A single method (#startAt:until:timeout:count:) allows to start the execution of a memory at a location. Three different stop conditions can be set: a final address, a timeout in microseconds or a number of instructions to execute. 65 | " 66 | Class { 67 | #name : #Unicorn, 68 | #superclass : #FFIExternalObject, 69 | #instVars : [ 70 | 'hooks', 71 | 'runtimeError' 72 | ], 73 | #pools : [ 74 | 'UnicornConstants', 75 | 'UnicornTypes' 76 | ], 77 | #category : #Unicorn 78 | } 79 | 80 | { #category : #'as yet unclassified' } 81 | Unicorn class >> architecture: architecture mode: mode [ 82 | 83 | | return enginePointer | 84 | enginePointer := ExternalAddress new. 85 | return := self 86 | uc_open: architecture 87 | mode: mode 88 | enginePointer: enginePointer. 89 | (UnicornConstants isOk: return) 90 | ifFalse: [ ^ self error: 'Failed to open simulator with error: ', (self uc_strerror: return) ]. 91 | ^ self fromHandle: enginePointer 92 | ] 93 | 94 | { #category : #'instance-creation' } 95 | Unicorn class >> arm [ 96 | 97 | "Returns a unicorn for instructions in A32 encoding" 98 | ^ self architecture: UC_ARCH_ARM mode: UC_MODE_ARM 99 | ] 100 | 101 | { #category : #'instance-creation' } 102 | Unicorn class >> arm64 [ 103 | 104 | "Returns a unicorn for instructions in A64 encoding" 105 | ^ self architecture: UC_ARCH_ARM64 mode: UC_MODE_ARM 106 | ] 107 | 108 | { #category : #resources } 109 | Unicorn class >> ffiLibrary [ 110 | 111 | ^ UnicornLibrary 112 | ] 113 | 114 | { #category : #private } 115 | Unicorn class >> uc_open: architecture mode: mode enginePointer: enginePointer [ 116 | 117 | self ffiCall: #(UC_err uc_open(UC_arch architecture,UC_mode mode,void** enginePointer)) 118 | ] 119 | 120 | { #category : #private } 121 | Unicorn class >> uc_strerror: anErrorCode [ 122 | 123 | self ffiCall: #(String uc_strerror(UC_err anErrorCode)) 124 | ] 125 | 126 | { #category : #'instance-creation' } 127 | Unicorn class >> x86 [ 128 | 129 | ^ self architecture: UC_ARCH_X86 mode: UC_MODE_32 130 | ] 131 | 132 | { #category : #'instance-creation' } 133 | Unicorn class >> x8664 [ 134 | 135 | ^ self architecture: UC_ARCH_X86 mode: UC_MODE_64 136 | ] 137 | 138 | { #category : #private } 139 | Unicorn >> addHookOfType: type withCallback: callback forHandle: hookHandle [ 140 | 141 | self ffiCall: #(UC_err uc_hook_add( 142 | self, 143 | void *hookHandle, 144 | int type, 145 | FFICallback callback, 146 | NULL, 147 | uint64 1, 148 | uint64 0)) 149 | ] 150 | 151 | { #category : #private } 152 | Unicorn >> doMapHostMemory: aMemory ofSize: size atAddress: address withPermissions: permissions [ 153 | 154 | self ffiCall: #(UC_err uc_mem_map_ptr(self, uint64 address, size_t size, uint32 permissions, void *aMemory)) 155 | ] 156 | 157 | { #category : #private } 158 | Unicorn >> doMapMemoryOfSize: size atAddress: address withPermissions: perms [ 159 | 160 | self ffiCall: #(UC_err uc_mem_map(self, uint64 address, size_t size, uint32 perms)) module: UnicornLibrary 161 | ] 162 | 163 | { #category : #private } 164 | Unicorn >> doMemoryAt: address write: bytes size: size [ 165 | 166 | ^ self ffiCall: #(UC_err uc_mem_write(self, uint64 address, const void *bytes, size_t size)) module: UnicornLibrary 167 | ] 168 | 169 | { #category : #private } 170 | Unicorn >> doMemoryReadBytes: size atAddress: address inBuffer: bytes [ 171 | 172 | self ffiCall: #(UC_err uc_mem_read(self, uint64 address, void *bytes, size_t size)) 173 | ] 174 | 175 | { #category : #private } 176 | Unicorn >> doMemorySetFrom: address to: size with: bytes [ 177 | 178 | self ffiCall: #(UC_err uc_mem_write(self, uint64 address, const void *bytes, size_t size)) 179 | ] 180 | 181 | { #category : #private } 182 | Unicorn >> doQuery: type intoHolder: result [ 183 | 184 | self ffiCall: #(UC_err uc_query(self, uint32 type, void *result)) 185 | ] 186 | 187 | { #category : #private } 188 | Unicorn >> doStartAt: begin until: until timeout: timeout count: count [ 189 | 190 | self ffiCall: #(UC_err uc_emu_start(self, uint64 begin, uint64 until, uint64 timeout, size_t count)) 191 | ] 192 | 193 | { #category : #resources } 194 | Unicorn >> ffiLibrary [ 195 | 196 | ^ UnicornLibrary 197 | ] 198 | 199 | { #category : #resources } 200 | Unicorn >> finalize [ 201 | 202 | ^ self free 203 | ] 204 | 205 | { #category : #private } 206 | Unicorn >> free [ 207 | 208 | self ffiCall: #(UC_err uc_free(self)) 209 | ] 210 | 211 | { #category : #hooks } 212 | Unicorn >> hooks [ 213 | 214 | ^ hooks ifNil: [ hooks := OrderedCollection new ] 215 | ] 216 | 217 | { #category : #initialization } 218 | Unicorn >> initialize [ 219 | 220 | super initialize. 221 | WeakRegistry default add: self 222 | ] 223 | 224 | { #category : #accessing } 225 | Unicorn >> lastExecutedInstructionAddress [ 226 | 227 | ^ self query: UC_QUERY_LAST_INSTR_ADDRESS 228 | ] 229 | 230 | { #category : #accessing } 231 | Unicorn >> lastExecutedInstructionSize [ 232 | 233 | ^ self query: UC_QUERY_LAST_INSTR_SIZE 234 | ] 235 | 236 | { #category : #errors } 237 | Unicorn >> lastInstructionCount [ 238 | 239 | ^ self query: UC_QUERY_INSTR_COUNT 240 | ] 241 | 242 | { #category : #'memory-mapping' } 243 | Unicorn >> mapHostMemory: aMemory atAddress: address withPermissions: permissions [ 244 | 245 | "This address must be aligned to 4KB, or this will return with UC_ERR_ARG error" 246 | "This size must be multiple of 4KB, or this will return with UC_ERR_ARG error." 247 | 248 | | errorCode | 249 | 250 | aMemory size \\ 4096 = 0 251 | ifFalse: [ self error: 'The memory mapped should have a size multiple of 4KB' ]. 252 | 253 | address \\ 4096 = 0 254 | ifFalse: [ self error: 'The memory mapped should be at an address multiple of 4KB' ]. 255 | 256 | aMemory pinInMemory. 257 | errorCode := self 258 | doMapHostMemory: aMemory 259 | ofSize: aMemory size 260 | atAddress: address 261 | withPermissions: permissions. 262 | self verifyErrorCode: errorCode 263 | ] 264 | 265 | { #category : #'memory-mapping' } 266 | Unicorn >> mapMemoryOfSize: size atAddress: address withPermissions: perms [ 267 | 268 | | result | 269 | result := self doMapMemoryOfSize: size atAddress: address withPermissions: perms. 270 | self verifyErrorCode: result. 271 | ^ result 272 | ] 273 | 274 | { #category : #'memory-read/write' } 275 | Unicorn >> memoryAt: address readNext: byteSize [ 276 | 277 | | buffer result | 278 | buffer := ByteArray new: byteSize. 279 | result := self doMemoryReadBytes: byteSize atAddress: address inBuffer: buffer. 280 | self verifyErrorCode: result. 281 | ^ buffer. 282 | ] 283 | 284 | { #category : #'memory-read/write' } 285 | Unicorn >> memoryAt: address until: size setTo: bytes [ 286 | 287 | | result | 288 | result := self doMemorySetFrom: address to: size with: bytes. 289 | self verifyErrorCode: result. 290 | ^ result 291 | ] 292 | 293 | { #category : #'memory-read/write' } 294 | Unicorn >> memoryAt: address write: bytes [ 295 | 296 | ^ self memoryAt: address write: bytes size: bytes size 297 | ] 298 | 299 | { #category : #'memory-read/write' } 300 | Unicorn >> memoryAt: address write: bytes size: size [ 301 | 302 | | result | 303 | result := self doMemoryAt: address write: bytes size: size. 304 | self verifyErrorCode: result. 305 | ^ result 306 | ] 307 | 308 | { #category : #errors } 309 | Unicorn >> query: type [ 310 | 311 | | holder result | 312 | 313 | holder := ByteArray new: Smalltalk wordSize. 314 | 315 | result := self doQuery: type intoHolder: holder. 316 | self verifyErrorCode: result. 317 | 318 | ^ holder integerAt: 1 size: Smalltalk wordSize signed: true. 319 | ] 320 | 321 | { #category : #'register-read/write' } 322 | Unicorn >> readRegisterId: aRegisterId size: aSize [ 323 | 324 | | buffer | 325 | buffer := ByteArray new: aSize. 326 | self register: aRegisterId value readInto: buffer. 327 | ^ buffer 328 | ] 329 | 330 | { #category : #'register-read/write' } 331 | Unicorn >> register: regid readInto: value [ 332 | 333 | self ffiCall: #(UC_err uc_reg_read(self, int regid, void *value)) 334 | ] 335 | 336 | { #category : #'register-read/write' } 337 | Unicorn >> register: regid write: value [ 338 | 339 | self ffiCall: #(UC_err uc_reg_write(self, int regid, void *value)) 340 | ] 341 | 342 | { #category : #hooks } 343 | Unicorn >> registerHook: anUcHook [ 344 | 345 | self hooks add: anUcHook 346 | ] 347 | 348 | { #category : #hooks } 349 | Unicorn >> registerInvalidMemoryAccessHook: hookType doing: aBlock [ 350 | 351 | | callback hookHandle hook returnCode | 352 | callback := FFICallback 353 | signature: #(bool (Unicorn *uc, int type, uint64 address, int size, int64 value, void *user_data)) 354 | block: [ :uc :type :address :size :value :user_data | [ 355 | aBlock value: (UcMemoryAccessType fromInteger: type) value: address value: size value: value. 356 | true ] on: Error do: [ :exception | 357 | runtimeError := exception freeze. 358 | false ] ]. 359 | hookHandle := ByteArray new: Smalltalk wordSize. 360 | 361 | returnCode := self 362 | addHookOfType: hookType value 363 | withCallback: callback 364 | forHandle: hookHandle. 365 | self verifyErrorCode: returnCode. 366 | 367 | hook := UcHook new 368 | handle: hookHandle; 369 | type: hookType; 370 | callback: callback; 371 | yourself. 372 | 373 | self registerHook: hook. 374 | ^ hook 375 | ] 376 | 377 | { #category : #running } 378 | Unicorn >> startAt: begin until: until timeout: timeout count: count [ 379 | 380 | | result | 381 | [ 382 | result := self doStartAt: begin until: until timeout: timeout count: count. 383 | runtimeError ifNotNil: [ 384 | runtimeError privHandlerContext privSender: thisContext. 385 | runtimeError pass ]. 386 | ] ensure: [ runtimeError := nil ]. 387 | ^ result 388 | ] 389 | 390 | { #category : #private } 391 | Unicorn >> stop [ 392 | "Stop emulation. Typically called from a callback" 393 | self ffiCall: #(UC_err uc_emu_stop(self)) 394 | ] 395 | 396 | { #category : #errors } 397 | Unicorn >> stringOfErrorCode: code [ 398 | 399 | ^ self ffiCall: #(const char *uc_strerror(int code)) 400 | ] 401 | 402 | { #category : #private } 403 | Unicorn >> unmapMemoryAt: address size: size [ 404 | 405 | self ffiCall: #(UC_err uc_mem_unmap(self, uint64 address, size_t size)) 406 | ] 407 | 408 | { #category : #errors } 409 | Unicorn >> verifyErrorCode: anInteger [ 410 | 411 | (UnicornConstants isOk: anInteger) ifTrue: [ ^ self ]. 412 | UnicornError signal: (self stringOfErrorCode: anInteger) 413 | ] 414 | -------------------------------------------------------------------------------- /src/Unicorn/UcX86Registers.class.st: -------------------------------------------------------------------------------- 1 | " 2 | I define x86 and x86-64 register constants. 3 | " 4 | Class { 5 | #name : #UcX86Registers, 6 | #superclass : #FFIExternalEnumeration, 7 | #classVars : [ 8 | 'UC_X86_REG_AH', 9 | 'UC_X86_REG_AL', 10 | 'UC_X86_REG_AX', 11 | 'UC_X86_REG_BH', 12 | 'UC_X86_REG_BL', 13 | 'UC_X86_REG_BP', 14 | 'UC_X86_REG_BPL', 15 | 'UC_X86_REG_BX', 16 | 'UC_X86_REG_CH', 17 | 'UC_X86_REG_CL', 18 | 'UC_X86_REG_CR0', 19 | 'UC_X86_REG_CR1', 20 | 'UC_X86_REG_CR10', 21 | 'UC_X86_REG_CR11', 22 | 'UC_X86_REG_CR12', 23 | 'UC_X86_REG_CR13', 24 | 'UC_X86_REG_CR14', 25 | 'UC_X86_REG_CR15', 26 | 'UC_X86_REG_CR2', 27 | 'UC_X86_REG_CR3', 28 | 'UC_X86_REG_CR4', 29 | 'UC_X86_REG_CR5', 30 | 'UC_X86_REG_CR6', 31 | 'UC_X86_REG_CR7', 32 | 'UC_X86_REG_CR8', 33 | 'UC_X86_REG_CR9', 34 | 'UC_X86_REG_CS', 35 | 'UC_X86_REG_CX', 36 | 'UC_X86_REG_DH', 37 | 'UC_X86_REG_DI', 38 | 'UC_X86_REG_DIL', 39 | 'UC_X86_REG_DL', 40 | 'UC_X86_REG_DR0', 41 | 'UC_X86_REG_DR1', 42 | 'UC_X86_REG_DR10', 43 | 'UC_X86_REG_DR11', 44 | 'UC_X86_REG_DR12', 45 | 'UC_X86_REG_DR13', 46 | 'UC_X86_REG_DR14', 47 | 'UC_X86_REG_DR15', 48 | 'UC_X86_REG_DR2', 49 | 'UC_X86_REG_DR3', 50 | 'UC_X86_REG_DR4', 51 | 'UC_X86_REG_DR5', 52 | 'UC_X86_REG_DR6', 53 | 'UC_X86_REG_DR7', 54 | 'UC_X86_REG_DR8', 55 | 'UC_X86_REG_DR9', 56 | 'UC_X86_REG_DS', 57 | 'UC_X86_REG_DX', 58 | 'UC_X86_REG_EAX', 59 | 'UC_X86_REG_EBP', 60 | 'UC_X86_REG_EBX', 61 | 'UC_X86_REG_ECX', 62 | 'UC_X86_REG_EDI', 63 | 'UC_X86_REG_EDX', 64 | 'UC_X86_REG_EFLAGS', 65 | 'UC_X86_REG_EIP', 66 | 'UC_X86_REG_EIZ', 67 | 'UC_X86_REG_ENDING', 68 | 'UC_X86_REG_ES', 69 | 'UC_X86_REG_ESI', 70 | 'UC_X86_REG_ESP', 71 | 'UC_X86_REG_FP0', 72 | 'UC_X86_REG_FP1', 73 | 'UC_X86_REG_FP2', 74 | 'UC_X86_REG_FP3', 75 | 'UC_X86_REG_FP4', 76 | 'UC_X86_REG_FP5', 77 | 'UC_X86_REG_FP6', 78 | 'UC_X86_REG_FP7', 79 | 'UC_X86_REG_FPCW', 80 | 'UC_X86_REG_FPSW', 81 | 'UC_X86_REG_FPTAG', 82 | 'UC_X86_REG_FS', 83 | 'UC_X86_REG_GDTR', 84 | 'UC_X86_REG_GS', 85 | 'UC_X86_REG_IDTR', 86 | 'UC_X86_REG_INVALID', 87 | 'UC_X86_REG_IP', 88 | 'UC_X86_REG_K0', 89 | 'UC_X86_REG_K1', 90 | 'UC_X86_REG_K2', 91 | 'UC_X86_REG_K3', 92 | 'UC_X86_REG_K4', 93 | 'UC_X86_REG_K5', 94 | 'UC_X86_REG_K6', 95 | 'UC_X86_REG_K7', 96 | 'UC_X86_REG_LDTR', 97 | 'UC_X86_REG_MM0', 98 | 'UC_X86_REG_MM1', 99 | 'UC_X86_REG_MM2', 100 | 'UC_X86_REG_MM3', 101 | 'UC_X86_REG_MM4', 102 | 'UC_X86_REG_MM5', 103 | 'UC_X86_REG_MM6', 104 | 'UC_X86_REG_MM7', 105 | 'UC_X86_REG_MSR', 106 | 'UC_X86_REG_MXCSR', 107 | 'UC_X86_REG_R10', 108 | 'UC_X86_REG_R10B', 109 | 'UC_X86_REG_R10D', 110 | 'UC_X86_REG_R10W', 111 | 'UC_X86_REG_R11', 112 | 'UC_X86_REG_R11B', 113 | 'UC_X86_REG_R11D', 114 | 'UC_X86_REG_R11W', 115 | 'UC_X86_REG_R12', 116 | 'UC_X86_REG_R12B', 117 | 'UC_X86_REG_R12D', 118 | 'UC_X86_REG_R12W', 119 | 'UC_X86_REG_R13', 120 | 'UC_X86_REG_R13B', 121 | 'UC_X86_REG_R13D', 122 | 'UC_X86_REG_R13W', 123 | 'UC_X86_REG_R14', 124 | 'UC_X86_REG_R14B', 125 | 'UC_X86_REG_R14D', 126 | 'UC_X86_REG_R14W', 127 | 'UC_X86_REG_R15', 128 | 'UC_X86_REG_R15B', 129 | 'UC_X86_REG_R15D', 130 | 'UC_X86_REG_R15W', 131 | 'UC_X86_REG_R8', 132 | 'UC_X86_REG_R8B', 133 | 'UC_X86_REG_R8D', 134 | 'UC_X86_REG_R8W', 135 | 'UC_X86_REG_R9', 136 | 'UC_X86_REG_R9B', 137 | 'UC_X86_REG_R9D', 138 | 'UC_X86_REG_R9W', 139 | 'UC_X86_REG_RAX', 140 | 'UC_X86_REG_RBP', 141 | 'UC_X86_REG_RBX', 142 | 'UC_X86_REG_RCX', 143 | 'UC_X86_REG_RDI', 144 | 'UC_X86_REG_RDX', 145 | 'UC_X86_REG_RIP', 146 | 'UC_X86_REG_RIZ', 147 | 'UC_X86_REG_RSI', 148 | 'UC_X86_REG_RSP', 149 | 'UC_X86_REG_SI', 150 | 'UC_X86_REG_SIL', 151 | 'UC_X86_REG_SP', 152 | 'UC_X86_REG_SPL', 153 | 'UC_X86_REG_SS', 154 | 'UC_X86_REG_ST0', 155 | 'UC_X86_REG_ST1', 156 | 'UC_X86_REG_ST2', 157 | 'UC_X86_REG_ST3', 158 | 'UC_X86_REG_ST4', 159 | 'UC_X86_REG_ST5', 160 | 'UC_X86_REG_ST6', 161 | 'UC_X86_REG_ST7', 162 | 'UC_X86_REG_TR', 163 | 'UC_X86_REG_XMM0', 164 | 'UC_X86_REG_XMM1', 165 | 'UC_X86_REG_XMM10', 166 | 'UC_X86_REG_XMM11', 167 | 'UC_X86_REG_XMM12', 168 | 'UC_X86_REG_XMM13', 169 | 'UC_X86_REG_XMM14', 170 | 'UC_X86_REG_XMM15', 171 | 'UC_X86_REG_XMM16', 172 | 'UC_X86_REG_XMM17', 173 | 'UC_X86_REG_XMM18', 174 | 'UC_X86_REG_XMM19', 175 | 'UC_X86_REG_XMM2', 176 | 'UC_X86_REG_XMM20', 177 | 'UC_X86_REG_XMM21', 178 | 'UC_X86_REG_XMM22', 179 | 'UC_X86_REG_XMM23', 180 | 'UC_X86_REG_XMM24', 181 | 'UC_X86_REG_XMM25', 182 | 'UC_X86_REG_XMM26', 183 | 'UC_X86_REG_XMM27', 184 | 'UC_X86_REG_XMM28', 185 | 'UC_X86_REG_XMM29', 186 | 'UC_X86_REG_XMM3', 187 | 'UC_X86_REG_XMM30', 188 | 'UC_X86_REG_XMM31', 189 | 'UC_X86_REG_XMM4', 190 | 'UC_X86_REG_XMM5', 191 | 'UC_X86_REG_XMM6', 192 | 'UC_X86_REG_XMM7', 193 | 'UC_X86_REG_XMM8', 194 | 'UC_X86_REG_XMM9', 195 | 'UC_X86_REG_YMM0', 196 | 'UC_X86_REG_YMM1', 197 | 'UC_X86_REG_YMM10', 198 | 'UC_X86_REG_YMM11', 199 | 'UC_X86_REG_YMM12', 200 | 'UC_X86_REG_YMM13', 201 | 'UC_X86_REG_YMM14', 202 | 'UC_X86_REG_YMM15', 203 | 'UC_X86_REG_YMM16', 204 | 'UC_X86_REG_YMM17', 205 | 'UC_X86_REG_YMM18', 206 | 'UC_X86_REG_YMM19', 207 | 'UC_X86_REG_YMM2', 208 | 'UC_X86_REG_YMM20', 209 | 'UC_X86_REG_YMM21', 210 | 'UC_X86_REG_YMM22', 211 | 'UC_X86_REG_YMM23', 212 | 'UC_X86_REG_YMM24', 213 | 'UC_X86_REG_YMM25', 214 | 'UC_X86_REG_YMM26', 215 | 'UC_X86_REG_YMM27', 216 | 'UC_X86_REG_YMM28', 217 | 'UC_X86_REG_YMM29', 218 | 'UC_X86_REG_YMM3', 219 | 'UC_X86_REG_YMM30', 220 | 'UC_X86_REG_YMM31', 221 | 'UC_X86_REG_YMM4', 222 | 'UC_X86_REG_YMM5', 223 | 'UC_X86_REG_YMM6', 224 | 'UC_X86_REG_YMM7', 225 | 'UC_X86_REG_YMM8', 226 | 'UC_X86_REG_YMM9', 227 | 'UC_X86_REG_ZMM0', 228 | 'UC_X86_REG_ZMM1', 229 | 'UC_X86_REG_ZMM10', 230 | 'UC_X86_REG_ZMM11', 231 | 'UC_X86_REG_ZMM12', 232 | 'UC_X86_REG_ZMM13', 233 | 'UC_X86_REG_ZMM14', 234 | 'UC_X86_REG_ZMM15', 235 | 'UC_X86_REG_ZMM16', 236 | 'UC_X86_REG_ZMM17', 237 | 'UC_X86_REG_ZMM18', 238 | 'UC_X86_REG_ZMM19', 239 | 'UC_X86_REG_ZMM2', 240 | 'UC_X86_REG_ZMM20', 241 | 'UC_X86_REG_ZMM21', 242 | 'UC_X86_REG_ZMM22', 243 | 'UC_X86_REG_ZMM23', 244 | 'UC_X86_REG_ZMM24', 245 | 'UC_X86_REG_ZMM25', 246 | 'UC_X86_REG_ZMM26', 247 | 'UC_X86_REG_ZMM27', 248 | 'UC_X86_REG_ZMM28', 249 | 'UC_X86_REG_ZMM29', 250 | 'UC_X86_REG_ZMM3', 251 | 'UC_X86_REG_ZMM30', 252 | 'UC_X86_REG_ZMM31', 253 | 'UC_X86_REG_ZMM4', 254 | 'UC_X86_REG_ZMM5', 255 | 'UC_X86_REG_ZMM6', 256 | 'UC_X86_REG_ZMM7', 257 | 'UC_X86_REG_ZMM8', 258 | 'UC_X86_REG_ZMM9' 259 | ], 260 | #category : #Unicorn 261 | } 262 | 263 | { #category : #accessing } 264 | UcX86Registers class >> al [ 265 | 266 | ^ UC_X86_REG_AL 267 | ] 268 | 269 | { #category : #accessing } 270 | UcX86Registers class >> cr4 [ 271 | 272 | ^ UC_X86_REG_CR4 273 | ] 274 | 275 | { #category : #accessing } 276 | UcX86Registers class >> eax [ 277 | 278 | ^ UC_X86_REG_EAX 279 | ] 280 | 281 | { #category : #accessing } 282 | UcX86Registers class >> ebp [ 283 | 284 | ^ UC_X86_REG_EBP 285 | ] 286 | 287 | { #category : #accessing } 288 | UcX86Registers class >> ebx [ 289 | 290 | ^ UC_X86_REG_EBX 291 | ] 292 | 293 | { #category : #accessing } 294 | UcX86Registers class >> ecx [ 295 | 296 | ^ UC_X86_REG_ECX 297 | ] 298 | 299 | { #category : #accessing } 300 | UcX86Registers class >> edi [ 301 | 302 | ^ UC_X86_REG_EDI 303 | ] 304 | 305 | { #category : #accessing } 306 | UcX86Registers class >> edx [ 307 | 308 | ^ UC_X86_REG_EDX 309 | ] 310 | 311 | { #category : #accessing } 312 | UcX86Registers class >> eflags [ 313 | 314 | ^ UC_X86_REG_EFLAGS 315 | ] 316 | 317 | { #category : #accessing } 318 | UcX86Registers class >> eip [ 319 | 320 | ^ UC_X86_REG_EIP 321 | ] 322 | 323 | { #category : #'enum declaration' } 324 | UcX86Registers class >> enumDecl [ 325 | ^ #(UC_X86_REG_INVALID 0 326 | UC_X86_REG_AH 1 327 | UC_X86_REG_AL 2 328 | UC_X86_REG_AX 3 329 | UC_X86_REG_BH 4 330 | UC_X86_REG_BL 5 331 | UC_X86_REG_BP 6 332 | UC_X86_REG_BPL 7 333 | UC_X86_REG_BX 8 334 | UC_X86_REG_CH 9 335 | UC_X86_REG_CL 10 336 | UC_X86_REG_CS 11 337 | UC_X86_REG_CX 12 338 | UC_X86_REG_DH 13 339 | UC_X86_REG_DI 14 340 | UC_X86_REG_DIL 15 341 | UC_X86_REG_DL 16 342 | UC_X86_REG_DS 17 343 | UC_X86_REG_DX 18 344 | UC_X86_REG_EAX 19 345 | UC_X86_REG_EBP 20 346 | UC_X86_REG_EBX 21 347 | UC_X86_REG_ECX 22 348 | UC_X86_REG_EDI 23 349 | UC_X86_REG_EDX 24 350 | UC_X86_REG_EFLAGS 25 351 | UC_X86_REG_EIP 26 352 | UC_X86_REG_EIZ 27 353 | UC_X86_REG_ES 28 354 | UC_X86_REG_ESI 29 355 | UC_X86_REG_ESP 30 356 | UC_X86_REG_FPSW 31 357 | UC_X86_REG_FS 32 358 | UC_X86_REG_GS 33 359 | UC_X86_REG_IP 34 360 | UC_X86_REG_RAX 35 361 | UC_X86_REG_RBP 36 362 | UC_X86_REG_RBX 37 363 | UC_X86_REG_RCX 38 364 | UC_X86_REG_RDI 39 365 | UC_X86_REG_RDX 40 366 | UC_X86_REG_RIP 41 367 | UC_X86_REG_RIZ 42 368 | UC_X86_REG_RSI 43 369 | UC_X86_REG_RSP 44 370 | UC_X86_REG_SI 45 371 | UC_X86_REG_SIL 46 372 | UC_X86_REG_SP 47 373 | UC_X86_REG_SPL 48 374 | UC_X86_REG_SS 49 375 | UC_X86_REG_CR0 50 376 | UC_X86_REG_CR1 51 377 | UC_X86_REG_CR2 52 378 | UC_X86_REG_CR3 53 379 | UC_X86_REG_CR4 54 380 | UC_X86_REG_CR5 55 381 | UC_X86_REG_CR6 56 382 | UC_X86_REG_CR7 57 383 | UC_X86_REG_CR8 58 384 | UC_X86_REG_CR9 59 385 | UC_X86_REG_CR10 60 386 | UC_X86_REG_CR11 61 387 | UC_X86_REG_CR12 62 388 | UC_X86_REG_CR13 63 389 | UC_X86_REG_CR14 64 390 | UC_X86_REG_CR15 65 391 | UC_X86_REG_DR0 66 392 | UC_X86_REG_DR1 67 393 | UC_X86_REG_DR2 68 394 | UC_X86_REG_DR3 69 395 | UC_X86_REG_DR4 70 396 | UC_X86_REG_DR5 71 397 | UC_X86_REG_DR6 72 398 | UC_X86_REG_DR7 73 399 | UC_X86_REG_DR8 74 400 | UC_X86_REG_DR9 75 401 | UC_X86_REG_DR10 76 402 | UC_X86_REG_DR11 77 403 | UC_X86_REG_DR12 78 404 | UC_X86_REG_DR13 79 405 | UC_X86_REG_DR14 80 406 | UC_X86_REG_DR15 81 407 | UC_X86_REG_FP0 82 408 | UC_X86_REG_FP1 83 409 | UC_X86_REG_FP2 84 410 | UC_X86_REG_FP3 85 411 | UC_X86_REG_FP4 86 412 | UC_X86_REG_FP5 87 413 | UC_X86_REG_FP6 88 414 | UC_X86_REG_FP7 89 415 | UC_X86_REG_K0 90 416 | UC_X86_REG_K1 91 417 | UC_X86_REG_K2 92 418 | UC_X86_REG_K3 93 419 | UC_X86_REG_K4 94 420 | UC_X86_REG_K5 95 421 | UC_X86_REG_K6 96 422 | UC_X86_REG_K7 97 423 | UC_X86_REG_MM0 98 424 | UC_X86_REG_MM1 99 425 | UC_X86_REG_MM2 100 426 | UC_X86_REG_MM3 101 427 | UC_X86_REG_MM4 102 428 | UC_X86_REG_MM5 103 429 | UC_X86_REG_MM6 104 430 | UC_X86_REG_MM7 105 431 | UC_X86_REG_R8 106 432 | UC_X86_REG_R9 107 433 | UC_X86_REG_R10 108 434 | UC_X86_REG_R11 109 435 | UC_X86_REG_R12 110 436 | UC_X86_REG_R13 111 437 | UC_X86_REG_R14 112 438 | UC_X86_REG_R15 113 439 | UC_X86_REG_ST0 114 440 | UC_X86_REG_ST1 115 441 | UC_X86_REG_ST2 116 442 | UC_X86_REG_ST3 117 443 | UC_X86_REG_ST4 118 444 | UC_X86_REG_ST5 119 445 | UC_X86_REG_ST6 120 446 | UC_X86_REG_ST7 121 447 | UC_X86_REG_XMM0 122 448 | UC_X86_REG_XMM1 123 449 | UC_X86_REG_XMM2 124 450 | UC_X86_REG_XMM3 125 451 | UC_X86_REG_XMM4 126 452 | UC_X86_REG_XMM5 127 453 | UC_X86_REG_XMM6 128 454 | UC_X86_REG_XMM7 129 455 | UC_X86_REG_XMM8 130 456 | UC_X86_REG_XMM9 131 457 | UC_X86_REG_XMM10 132 458 | UC_X86_REG_XMM11 133 459 | UC_X86_REG_XMM12 134 460 | UC_X86_REG_XMM13 135 461 | UC_X86_REG_XMM14 136 462 | UC_X86_REG_XMM15 137 463 | UC_X86_REG_XMM16 138 464 | UC_X86_REG_XMM17 139 465 | UC_X86_REG_XMM18 140 466 | UC_X86_REG_XMM19 141 467 | UC_X86_REG_XMM20 142 468 | UC_X86_REG_XMM21 143 469 | UC_X86_REG_XMM22 144 470 | UC_X86_REG_XMM23 145 471 | UC_X86_REG_XMM24 146 472 | UC_X86_REG_XMM25 147 473 | UC_X86_REG_XMM26 148 474 | UC_X86_REG_XMM27 149 475 | UC_X86_REG_XMM28 150 476 | UC_X86_REG_XMM29 151 477 | UC_X86_REG_XMM30 152 478 | UC_X86_REG_XMM31 153 479 | UC_X86_REG_YMM0 154 480 | UC_X86_REG_YMM1 155 481 | UC_X86_REG_YMM2 156 482 | UC_X86_REG_YMM3 157 483 | UC_X86_REG_YMM4 158 484 | UC_X86_REG_YMM5 159 485 | UC_X86_REG_YMM6 160 486 | UC_X86_REG_YMM7 161 487 | UC_X86_REG_YMM8 162 488 | UC_X86_REG_YMM9 163 489 | UC_X86_REG_YMM10 164 490 | UC_X86_REG_YMM11 165 491 | UC_X86_REG_YMM12 166 492 | UC_X86_REG_YMM13 167 493 | UC_X86_REG_YMM14 168 494 | UC_X86_REG_YMM15 169 495 | UC_X86_REG_YMM16 170 496 | UC_X86_REG_YMM17 171 497 | UC_X86_REG_YMM18 172 498 | UC_X86_REG_YMM19 173 499 | UC_X86_REG_YMM20 174 500 | UC_X86_REG_YMM21 175 501 | UC_X86_REG_YMM22 176 502 | UC_X86_REG_YMM23 177 503 | UC_X86_REG_YMM24 178 504 | UC_X86_REG_YMM25 179 505 | UC_X86_REG_YMM26 180 506 | UC_X86_REG_YMM27 181 507 | UC_X86_REG_YMM28 182 508 | UC_X86_REG_YMM29 183 509 | UC_X86_REG_YMM30 184 510 | UC_X86_REG_YMM31 185 511 | UC_X86_REG_ZMM0 186 512 | UC_X86_REG_ZMM1 187 513 | UC_X86_REG_ZMM2 188 514 | UC_X86_REG_ZMM3 189 515 | UC_X86_REG_ZMM4 190 516 | UC_X86_REG_ZMM5 191 517 | UC_X86_REG_ZMM6 192 518 | UC_X86_REG_ZMM7 193 519 | UC_X86_REG_ZMM8 194 520 | UC_X86_REG_ZMM9 195 521 | UC_X86_REG_ZMM10 196 522 | UC_X86_REG_ZMM11 197 523 | UC_X86_REG_ZMM12 198 524 | UC_X86_REG_ZMM13 199 525 | UC_X86_REG_ZMM14 200 526 | UC_X86_REG_ZMM15 201 527 | UC_X86_REG_ZMM16 202 528 | UC_X86_REG_ZMM17 203 529 | UC_X86_REG_ZMM18 204 530 | UC_X86_REG_ZMM19 205 531 | UC_X86_REG_ZMM20 206 532 | UC_X86_REG_ZMM21 207 533 | UC_X86_REG_ZMM22 208 534 | UC_X86_REG_ZMM23 209 535 | UC_X86_REG_ZMM24 210 536 | UC_X86_REG_ZMM25 211 537 | UC_X86_REG_ZMM26 212 538 | UC_X86_REG_ZMM27 213 539 | UC_X86_REG_ZMM28 214 540 | UC_X86_REG_ZMM29 215 541 | UC_X86_REG_ZMM30 216 542 | UC_X86_REG_ZMM31 217 543 | UC_X86_REG_R8B 218 544 | UC_X86_REG_R9B 219 545 | UC_X86_REG_R10B 220 546 | UC_X86_REG_R11B 221 547 | UC_X86_REG_R12B 222 548 | UC_X86_REG_R13B 223 549 | UC_X86_REG_R14B 224 550 | UC_X86_REG_R15B 225 551 | UC_X86_REG_R8D 226 552 | UC_X86_REG_R9D 227 553 | UC_X86_REG_R10D 228 554 | UC_X86_REG_R11D 229 555 | UC_X86_REG_R12D 230 556 | UC_X86_REG_R13D 231 557 | UC_X86_REG_R14D 232 558 | UC_X86_REG_R15D 233 559 | UC_X86_REG_R8W 234 560 | UC_X86_REG_R9W 235 561 | UC_X86_REG_R10W 236 562 | UC_X86_REG_R11W 237 563 | UC_X86_REG_R12W 238 564 | UC_X86_REG_R13W 239 565 | UC_X86_REG_R14W 240 566 | UC_X86_REG_R15W 241 567 | UC_X86_REG_IDTR 242 568 | UC_X86_REG_GDTR 243 569 | UC_X86_REG_LDTR 244 570 | UC_X86_REG_TR 245 571 | UC_X86_REG_FPCW 246 572 | UC_X86_REG_FPTAG 247 573 | UC_X86_REG_MSR 248 "Model-Specific Register" 574 | UC_X86_REG_MXCSR 249 575 | UC_X86_REG_ENDING 250 576 | ) 577 | ] 578 | 579 | { #category : #accessing } 580 | UcX86Registers class >> esi [ 581 | 582 | ^ UC_X86_REG_ESI 583 | ] 584 | 585 | { #category : #accessing } 586 | UcX86Registers class >> esp [ 587 | 588 | ^ UC_X86_REG_ESP 589 | ] 590 | 591 | { #category : #'as yet unclassified' } 592 | UcX86Registers class >> fp0 [ 593 | 594 | ^ UC_X86_REG_FP0 595 | ] 596 | 597 | { #category : #'enum declaration' } 598 | UcX86Registers class >> initialize [ 599 | self initializeEnumeration 600 | ] 601 | 602 | { #category : #'as yet unclassified' } 603 | UcX86Registers class >> r10 [ 604 | ^ UC_X86_REG_R10 605 | ] 606 | 607 | { #category : #'as yet unclassified' } 608 | UcX86Registers class >> r11 [ 609 | ^ UC_X86_REG_R11 610 | ] 611 | 612 | { #category : #'as yet unclassified' } 613 | UcX86Registers class >> r12 [ 614 | ^ UC_X86_REG_R12 615 | ] 616 | 617 | { #category : #'as yet unclassified' } 618 | UcX86Registers class >> r13 [ 619 | ^ UC_X86_REG_R13 620 | ] 621 | 622 | { #category : #'as yet unclassified' } 623 | UcX86Registers class >> r14 [ 624 | ^ UC_X86_REG_R14 625 | ] 626 | 627 | { #category : #'as yet unclassified' } 628 | UcX86Registers class >> r15 [ 629 | ^ UC_X86_REG_R15 630 | ] 631 | 632 | { #category : #'as yet unclassified' } 633 | UcX86Registers class >> r8 [ 634 | ^ UC_X86_REG_R8 635 | ] 636 | 637 | { #category : #'as yet unclassified' } 638 | UcX86Registers class >> r9 [ 639 | ^ UC_X86_REG_R9 640 | ] 641 | 642 | { #category : #'as yet unclassified' } 643 | UcX86Registers class >> r9b [ 644 | 645 | ^ UC_X86_REG_R9B 646 | ] 647 | 648 | { #category : #accessing } 649 | UcX86Registers class >> rax [ 650 | ^ UC_X86_REG_RAX 651 | ] 652 | 653 | { #category : #'as yet unclassified' } 654 | UcX86Registers class >> rbp [ 655 | ^ UC_X86_REG_RBP 656 | ] 657 | 658 | { #category : #'as yet unclassified' } 659 | UcX86Registers class >> rbx [ 660 | ^ UC_X86_REG_RBX 661 | ] 662 | 663 | { #category : #'as yet unclassified' } 664 | UcX86Registers class >> rcx [ 665 | ^ UC_X86_REG_RCX 666 | ] 667 | 668 | { #category : #'as yet unclassified' } 669 | UcX86Registers class >> rdi [ 670 | ^ UC_X86_REG_RDI 671 | ] 672 | 673 | { #category : #'as yet unclassified' } 674 | UcX86Registers class >> rdx [ 675 | ^ UC_X86_REG_RDX 676 | ] 677 | 678 | { #category : #accessing } 679 | UcX86Registers class >> rflags [ 680 | 681 | ^ UC_X86_REG_EFLAGS 682 | ] 683 | 684 | { #category : #'as yet unclassified' } 685 | UcX86Registers class >> rip [ 686 | ^ UC_X86_REG_RIP 687 | ] 688 | 689 | { #category : #'as yet unclassified' } 690 | UcX86Registers class >> rsi [ 691 | ^ UC_X86_REG_RSI 692 | ] 693 | 694 | { #category : #'as yet unclassified' } 695 | UcX86Registers class >> rsp [ 696 | ^ UC_X86_REG_RSP 697 | ] 698 | 699 | { #category : #accessing } 700 | UcX86Registers class >> xmm0 [ 701 | 702 | ^ UC_X86_REG_XMM0 703 | ] 704 | 705 | { #category : #accessing } 706 | UcX86Registers class >> xmm1 [ 707 | 708 | ^ UC_X86_REG_XMM1 709 | ] 710 | -------------------------------------------------------------------------------- /src/Unicorn/UcARM64Registers.class.st: -------------------------------------------------------------------------------- 1 | Class { 2 | #name : #UcARM64Registers, 3 | #superclass : #FFIExternalEnumeration, 4 | #classVars : [ 5 | 'UC_ARM64_REG_B0', 6 | 'UC_ARM64_REG_B1', 7 | 'UC_ARM64_REG_B10', 8 | 'UC_ARM64_REG_B11', 9 | 'UC_ARM64_REG_B12', 10 | 'UC_ARM64_REG_B13', 11 | 'UC_ARM64_REG_B14', 12 | 'UC_ARM64_REG_B15', 13 | 'UC_ARM64_REG_B16', 14 | 'UC_ARM64_REG_B17', 15 | 'UC_ARM64_REG_B18', 16 | 'UC_ARM64_REG_B19', 17 | 'UC_ARM64_REG_B2', 18 | 'UC_ARM64_REG_B20', 19 | 'UC_ARM64_REG_B21', 20 | 'UC_ARM64_REG_B22', 21 | 'UC_ARM64_REG_B23', 22 | 'UC_ARM64_REG_B24', 23 | 'UC_ARM64_REG_B25', 24 | 'UC_ARM64_REG_B26', 25 | 'UC_ARM64_REG_B27', 26 | 'UC_ARM64_REG_B28', 27 | 'UC_ARM64_REG_B29', 28 | 'UC_ARM64_REG_B3', 29 | 'UC_ARM64_REG_B30', 30 | 'UC_ARM64_REG_B31', 31 | 'UC_ARM64_REG_B4', 32 | 'UC_ARM64_REG_B5', 33 | 'UC_ARM64_REG_B6', 34 | 'UC_ARM64_REG_B7', 35 | 'UC_ARM64_REG_B8', 36 | 'UC_ARM64_REG_B9', 37 | 'UC_ARM64_REG_CPACR_EL1', 38 | 'UC_ARM64_REG_D0', 39 | 'UC_ARM64_REG_D1', 40 | 'UC_ARM64_REG_D10', 41 | 'UC_ARM64_REG_D11', 42 | 'UC_ARM64_REG_D12', 43 | 'UC_ARM64_REG_D13', 44 | 'UC_ARM64_REG_D14', 45 | 'UC_ARM64_REG_D15', 46 | 'UC_ARM64_REG_D16', 47 | 'UC_ARM64_REG_D17', 48 | 'UC_ARM64_REG_D18', 49 | 'UC_ARM64_REG_D19', 50 | 'UC_ARM64_REG_D2', 51 | 'UC_ARM64_REG_D20', 52 | 'UC_ARM64_REG_D21', 53 | 'UC_ARM64_REG_D22', 54 | 'UC_ARM64_REG_D23', 55 | 'UC_ARM64_REG_D24', 56 | 'UC_ARM64_REG_D25', 57 | 'UC_ARM64_REG_D26', 58 | 'UC_ARM64_REG_D27', 59 | 'UC_ARM64_REG_D28', 60 | 'UC_ARM64_REG_D29', 61 | 'UC_ARM64_REG_D3', 62 | 'UC_ARM64_REG_D30', 63 | 'UC_ARM64_REG_D31', 64 | 'UC_ARM64_REG_D4', 65 | 'UC_ARM64_REG_D5', 66 | 'UC_ARM64_REG_D6', 67 | 'UC_ARM64_REG_D7', 68 | 'UC_ARM64_REG_D8', 69 | 'UC_ARM64_REG_D9', 70 | 'UC_ARM64_REG_ELR_EL0', 71 | 'UC_ARM64_REG_ELR_EL1', 72 | 'UC_ARM64_REG_ELR_EL2', 73 | 'UC_ARM64_REG_ELR_EL3', 74 | 'UC_ARM64_REG_ENDING', 75 | 'UC_ARM64_REG_ESR_EL0', 76 | 'UC_ARM64_REG_ESR_EL1', 77 | 'UC_ARM64_REG_ESR_EL2', 78 | 'UC_ARM64_REG_ESR_EL3', 79 | 'UC_ARM64_REG_FAR_EL0', 80 | 'UC_ARM64_REG_FAR_EL1', 81 | 'UC_ARM64_REG_FAR_EL2', 82 | 'UC_ARM64_REG_FAR_EL3', 83 | 'UC_ARM64_REG_H0', 84 | 'UC_ARM64_REG_H1', 85 | 'UC_ARM64_REG_H10', 86 | 'UC_ARM64_REG_H11', 87 | 'UC_ARM64_REG_H12', 88 | 'UC_ARM64_REG_H13', 89 | 'UC_ARM64_REG_H14', 90 | 'UC_ARM64_REG_H15', 91 | 'UC_ARM64_REG_H16', 92 | 'UC_ARM64_REG_H17', 93 | 'UC_ARM64_REG_H18', 94 | 'UC_ARM64_REG_H19', 95 | 'UC_ARM64_REG_H2', 96 | 'UC_ARM64_REG_H20', 97 | 'UC_ARM64_REG_H21', 98 | 'UC_ARM64_REG_H22', 99 | 'UC_ARM64_REG_H23', 100 | 'UC_ARM64_REG_H24', 101 | 'UC_ARM64_REG_H25', 102 | 'UC_ARM64_REG_H26', 103 | 'UC_ARM64_REG_H27', 104 | 'UC_ARM64_REG_H28', 105 | 'UC_ARM64_REG_H29', 106 | 'UC_ARM64_REG_H3', 107 | 'UC_ARM64_REG_H30', 108 | 'UC_ARM64_REG_H31', 109 | 'UC_ARM64_REG_H4', 110 | 'UC_ARM64_REG_H5', 111 | 'UC_ARM64_REG_H6', 112 | 'UC_ARM64_REG_H7', 113 | 'UC_ARM64_REG_H8', 114 | 'UC_ARM64_REG_H9', 115 | 'UC_ARM64_REG_INVALID', 116 | 'UC_ARM64_REG_MAIR_EL1', 117 | 'UC_ARM64_REG_NZCV', 118 | 'UC_ARM64_REG_PAR_EL1', 119 | 'UC_ARM64_REG_PC', 120 | 'UC_ARM64_REG_PSTATE', 121 | 'UC_ARM64_REG_Q0', 122 | 'UC_ARM64_REG_Q1', 123 | 'UC_ARM64_REG_Q10', 124 | 'UC_ARM64_REG_Q11', 125 | 'UC_ARM64_REG_Q12', 126 | 'UC_ARM64_REG_Q13', 127 | 'UC_ARM64_REG_Q14', 128 | 'UC_ARM64_REG_Q15', 129 | 'UC_ARM64_REG_Q16', 130 | 'UC_ARM64_REG_Q17', 131 | 'UC_ARM64_REG_Q18', 132 | 'UC_ARM64_REG_Q19', 133 | 'UC_ARM64_REG_Q2', 134 | 'UC_ARM64_REG_Q20', 135 | 'UC_ARM64_REG_Q21', 136 | 'UC_ARM64_REG_Q22', 137 | 'UC_ARM64_REG_Q23', 138 | 'UC_ARM64_REG_Q24', 139 | 'UC_ARM64_REG_Q25', 140 | 'UC_ARM64_REG_Q26', 141 | 'UC_ARM64_REG_Q27', 142 | 'UC_ARM64_REG_Q28', 143 | 'UC_ARM64_REG_Q29', 144 | 'UC_ARM64_REG_Q3', 145 | 'UC_ARM64_REG_Q30', 146 | 'UC_ARM64_REG_Q31', 147 | 'UC_ARM64_REG_Q4', 148 | 'UC_ARM64_REG_Q5', 149 | 'UC_ARM64_REG_Q6', 150 | 'UC_ARM64_REG_Q7', 151 | 'UC_ARM64_REG_Q8', 152 | 'UC_ARM64_REG_Q9', 153 | 'UC_ARM64_REG_S0', 154 | 'UC_ARM64_REG_S1', 155 | 'UC_ARM64_REG_S10', 156 | 'UC_ARM64_REG_S11', 157 | 'UC_ARM64_REG_S12', 158 | 'UC_ARM64_REG_S13', 159 | 'UC_ARM64_REG_S14', 160 | 'UC_ARM64_REG_S15', 161 | 'UC_ARM64_REG_S16', 162 | 'UC_ARM64_REG_S17', 163 | 'UC_ARM64_REG_S18', 164 | 'UC_ARM64_REG_S19', 165 | 'UC_ARM64_REG_S2', 166 | 'UC_ARM64_REG_S20', 167 | 'UC_ARM64_REG_S21', 168 | 'UC_ARM64_REG_S22', 169 | 'UC_ARM64_REG_S23', 170 | 'UC_ARM64_REG_S24', 171 | 'UC_ARM64_REG_S25', 172 | 'UC_ARM64_REG_S26', 173 | 'UC_ARM64_REG_S27', 174 | 'UC_ARM64_REG_S28', 175 | 'UC_ARM64_REG_S29', 176 | 'UC_ARM64_REG_S3', 177 | 'UC_ARM64_REG_S30', 178 | 'UC_ARM64_REG_S31', 179 | 'UC_ARM64_REG_S4', 180 | 'UC_ARM64_REG_S5', 181 | 'UC_ARM64_REG_S6', 182 | 'UC_ARM64_REG_S7', 183 | 'UC_ARM64_REG_S8', 184 | 'UC_ARM64_REG_S9', 185 | 'UC_ARM64_REG_SP', 186 | 'UC_ARM64_REG_SP_EL0', 187 | 'UC_ARM64_REG_SP_EL1', 188 | 'UC_ARM64_REG_SP_EL2', 189 | 'UC_ARM64_REG_SP_EL3', 190 | 'UC_ARM64_REG_TPIDRRO_EL0', 191 | 'UC_ARM64_REG_TPIDR_EL0', 192 | 'UC_ARM64_REG_TPIDR_EL1', 193 | 'UC_ARM64_REG_TTBR0_EL1', 194 | 'UC_ARM64_REG_TTBR1_EL1', 195 | 'UC_ARM64_REG_V0', 196 | 'UC_ARM64_REG_V1', 197 | 'UC_ARM64_REG_V10', 198 | 'UC_ARM64_REG_V11', 199 | 'UC_ARM64_REG_V12', 200 | 'UC_ARM64_REG_V13', 201 | 'UC_ARM64_REG_V14', 202 | 'UC_ARM64_REG_V15', 203 | 'UC_ARM64_REG_V16', 204 | 'UC_ARM64_REG_V17', 205 | 'UC_ARM64_REG_V18', 206 | 'UC_ARM64_REG_V19', 207 | 'UC_ARM64_REG_V2', 208 | 'UC_ARM64_REG_V20', 209 | 'UC_ARM64_REG_V21', 210 | 'UC_ARM64_REG_V22', 211 | 'UC_ARM64_REG_V23', 212 | 'UC_ARM64_REG_V24', 213 | 'UC_ARM64_REG_V25', 214 | 'UC_ARM64_REG_V26', 215 | 'UC_ARM64_REG_V27', 216 | 'UC_ARM64_REG_V28', 217 | 'UC_ARM64_REG_V29', 218 | 'UC_ARM64_REG_V3', 219 | 'UC_ARM64_REG_V30', 220 | 'UC_ARM64_REG_V31', 221 | 'UC_ARM64_REG_V4', 222 | 'UC_ARM64_REG_V5', 223 | 'UC_ARM64_REG_V6', 224 | 'UC_ARM64_REG_V7', 225 | 'UC_ARM64_REG_V8', 226 | 'UC_ARM64_REG_V9', 227 | 'UC_ARM64_REG_VBAR_EL0', 228 | 'UC_ARM64_REG_VBAR_EL1', 229 | 'UC_ARM64_REG_VBAR_EL2', 230 | 'UC_ARM64_REG_VBAR_EL3', 231 | 'UC_ARM64_REG_W0', 232 | 'UC_ARM64_REG_W1', 233 | 'UC_ARM64_REG_W10', 234 | 'UC_ARM64_REG_W11', 235 | 'UC_ARM64_REG_W12', 236 | 'UC_ARM64_REG_W13', 237 | 'UC_ARM64_REG_W14', 238 | 'UC_ARM64_REG_W15', 239 | 'UC_ARM64_REG_W16', 240 | 'UC_ARM64_REG_W17', 241 | 'UC_ARM64_REG_W18', 242 | 'UC_ARM64_REG_W19', 243 | 'UC_ARM64_REG_W2', 244 | 'UC_ARM64_REG_W20', 245 | 'UC_ARM64_REG_W21', 246 | 'UC_ARM64_REG_W22', 247 | 'UC_ARM64_REG_W23', 248 | 'UC_ARM64_REG_W24', 249 | 'UC_ARM64_REG_W25', 250 | 'UC_ARM64_REG_W26', 251 | 'UC_ARM64_REG_W27', 252 | 'UC_ARM64_REG_W28', 253 | 'UC_ARM64_REG_W29', 254 | 'UC_ARM64_REG_W3', 255 | 'UC_ARM64_REG_W30', 256 | 'UC_ARM64_REG_W4', 257 | 'UC_ARM64_REG_W5', 258 | 'UC_ARM64_REG_W6', 259 | 'UC_ARM64_REG_W7', 260 | 'UC_ARM64_REG_W8', 261 | 'UC_ARM64_REG_W9', 262 | 'UC_ARM64_REG_WSP', 263 | 'UC_ARM64_REG_WZR', 264 | 'UC_ARM64_REG_X0', 265 | 'UC_ARM64_REG_X1', 266 | 'UC_ARM64_REG_X10', 267 | 'UC_ARM64_REG_X11', 268 | 'UC_ARM64_REG_X12', 269 | 'UC_ARM64_REG_X13', 270 | 'UC_ARM64_REG_X14', 271 | 'UC_ARM64_REG_X15', 272 | 'UC_ARM64_REG_X16', 273 | 'UC_ARM64_REG_X17', 274 | 'UC_ARM64_REG_X18', 275 | 'UC_ARM64_REG_X19', 276 | 'UC_ARM64_REG_X2', 277 | 'UC_ARM64_REG_X20', 278 | 'UC_ARM64_REG_X21', 279 | 'UC_ARM64_REG_X22', 280 | 'UC_ARM64_REG_X23', 281 | 'UC_ARM64_REG_X24', 282 | 'UC_ARM64_REG_X25', 283 | 'UC_ARM64_REG_X26', 284 | 'UC_ARM64_REG_X27', 285 | 'UC_ARM64_REG_X28', 286 | 'UC_ARM64_REG_X29', 287 | 'UC_ARM64_REG_X3', 288 | 'UC_ARM64_REG_X30', 289 | 'UC_ARM64_REG_X4', 290 | 'UC_ARM64_REG_X5', 291 | 'UC_ARM64_REG_X6', 292 | 'UC_ARM64_REG_X7', 293 | 'UC_ARM64_REG_X8', 294 | 'UC_ARM64_REG_X9', 295 | 'UC_ARM64_REG_XZR' 296 | ], 297 | #category : #Unicorn 298 | } 299 | 300 | { #category : #accessing } 301 | UcARM64Registers class >> cpacr_el1 [ 302 | 303 | ^ UC_ARM64_REG_CPACR_EL1 304 | ] 305 | 306 | { #category : #'as yet unclassified' } 307 | UcARM64Registers class >> d0 [ 308 | 309 | ^ UC_ARM64_REG_D0 310 | ] 311 | 312 | { #category : #'as yet unclassified' } 313 | UcARM64Registers class >> d1 [ 314 | 315 | ^ UC_ARM64_REG_D1 316 | ] 317 | 318 | { #category : #'enum declaration' } 319 | UcARM64Registers class >> enumDecl [ 320 | 321 | ^ #( 322 | #UC_ARM64_REG_INVALID 0 323 | #UC_ARM64_REG_X29 1 324 | #UC_ARM64_REG_X30 2 325 | #UC_ARM64_REG_NZCV 3 326 | #UC_ARM64_REG_SP 4 327 | #UC_ARM64_REG_WSP 5 328 | #UC_ARM64_REG_WZR 6 329 | #UC_ARM64_REG_XZR 7 330 | #UC_ARM64_REG_B0 8 331 | #UC_ARM64_REG_B1 9 332 | #UC_ARM64_REG_B2 10 333 | #UC_ARM64_REG_B3 11 334 | #UC_ARM64_REG_B4 12 335 | #UC_ARM64_REG_B5 13 336 | #UC_ARM64_REG_B6 14 337 | #UC_ARM64_REG_B7 15 338 | #UC_ARM64_REG_B8 16 339 | #UC_ARM64_REG_B9 17 340 | #UC_ARM64_REG_B10 18 341 | #UC_ARM64_REG_B11 19 342 | #UC_ARM64_REG_B12 20 343 | #UC_ARM64_REG_B13 21 344 | #UC_ARM64_REG_B14 22 345 | #UC_ARM64_REG_B15 23 346 | #UC_ARM64_REG_B16 24 347 | #UC_ARM64_REG_B17 25 348 | #UC_ARM64_REG_B18 26 349 | #UC_ARM64_REG_B19 27 350 | #UC_ARM64_REG_B20 28 351 | #UC_ARM64_REG_B21 29 352 | #UC_ARM64_REG_B22 30 353 | #UC_ARM64_REG_B23 31 354 | #UC_ARM64_REG_B24 32 355 | #UC_ARM64_REG_B25 33 356 | #UC_ARM64_REG_B26 34 357 | #UC_ARM64_REG_B27 35 358 | #UC_ARM64_REG_B28 36 359 | #UC_ARM64_REG_B29 37 360 | #UC_ARM64_REG_B30 38 361 | #UC_ARM64_REG_B31 39 362 | #UC_ARM64_REG_D0 40 363 | #UC_ARM64_REG_D1 41 364 | #UC_ARM64_REG_D2 42 365 | #UC_ARM64_REG_D3 43 366 | #UC_ARM64_REG_D4 44 367 | #UC_ARM64_REG_D5 45 368 | #UC_ARM64_REG_D6 46 369 | #UC_ARM64_REG_D7 47 370 | #UC_ARM64_REG_D8 48 371 | #UC_ARM64_REG_D9 49 372 | #UC_ARM64_REG_D10 50 373 | #UC_ARM64_REG_D11 51 374 | #UC_ARM64_REG_D12 52 375 | #UC_ARM64_REG_D13 53 376 | #UC_ARM64_REG_D14 54 377 | #UC_ARM64_REG_D15 55 378 | #UC_ARM64_REG_D16 56 379 | #UC_ARM64_REG_D17 57 380 | #UC_ARM64_REG_D18 58 381 | #UC_ARM64_REG_D19 59 382 | #UC_ARM64_REG_D20 60 383 | #UC_ARM64_REG_D21 61 384 | #UC_ARM64_REG_D22 62 385 | #UC_ARM64_REG_D23 63 386 | #UC_ARM64_REG_D24 64 387 | #UC_ARM64_REG_D25 65 388 | #UC_ARM64_REG_D26 66 389 | #UC_ARM64_REG_D27 67 390 | #UC_ARM64_REG_D28 68 391 | #UC_ARM64_REG_D29 69 392 | #UC_ARM64_REG_D30 70 393 | #UC_ARM64_REG_D31 71 394 | #UC_ARM64_REG_H0 72 395 | #UC_ARM64_REG_H1 73 396 | #UC_ARM64_REG_H2 74 397 | #UC_ARM64_REG_H3 75 398 | #UC_ARM64_REG_H4 76 399 | #UC_ARM64_REG_H5 77 400 | #UC_ARM64_REG_H6 78 401 | #UC_ARM64_REG_H7 79 402 | #UC_ARM64_REG_H8 80 403 | #UC_ARM64_REG_H9 81 404 | #UC_ARM64_REG_H10 82 405 | #UC_ARM64_REG_H11 83 406 | #UC_ARM64_REG_H12 84 407 | #UC_ARM64_REG_H13 85 408 | #UC_ARM64_REG_H14 86 409 | #UC_ARM64_REG_H15 87 410 | #UC_ARM64_REG_H16 88 411 | #UC_ARM64_REG_H17 89 412 | #UC_ARM64_REG_H18 90 413 | #UC_ARM64_REG_H19 91 414 | #UC_ARM64_REG_H20 92 415 | #UC_ARM64_REG_H21 93 416 | #UC_ARM64_REG_H22 94 417 | #UC_ARM64_REG_H23 95 418 | #UC_ARM64_REG_H24 96 419 | #UC_ARM64_REG_H25 97 420 | #UC_ARM64_REG_H26 98 421 | #UC_ARM64_REG_H27 99 422 | #UC_ARM64_REG_H28 100 423 | #UC_ARM64_REG_H29 101 424 | #UC_ARM64_REG_H30 102 425 | #UC_ARM64_REG_H31 103 426 | #UC_ARM64_REG_Q0 104 427 | #UC_ARM64_REG_Q1 105 428 | #UC_ARM64_REG_Q2 106 429 | #UC_ARM64_REG_Q3 107 430 | #UC_ARM64_REG_Q4 108 431 | #UC_ARM64_REG_Q5 109 432 | #UC_ARM64_REG_Q6 110 433 | #UC_ARM64_REG_Q7 111 434 | #UC_ARM64_REG_Q8 112 435 | #UC_ARM64_REG_Q9 113 436 | #UC_ARM64_REG_Q10 114 437 | #UC_ARM64_REG_Q11 115 438 | #UC_ARM64_REG_Q12 116 439 | #UC_ARM64_REG_Q13 117 440 | #UC_ARM64_REG_Q14 118 441 | #UC_ARM64_REG_Q15 119 442 | #UC_ARM64_REG_Q16 120 443 | #UC_ARM64_REG_Q17 121 444 | #UC_ARM64_REG_Q18 122 445 | #UC_ARM64_REG_Q19 123 446 | #UC_ARM64_REG_Q20 124 447 | #UC_ARM64_REG_Q21 125 448 | #UC_ARM64_REG_Q22 126 449 | #UC_ARM64_REG_Q23 127 450 | #UC_ARM64_REG_Q24 128 451 | #UC_ARM64_REG_Q25 129 452 | #UC_ARM64_REG_Q26 130 453 | #UC_ARM64_REG_Q27 131 454 | #UC_ARM64_REG_Q28 132 455 | #UC_ARM64_REG_Q29 133 456 | #UC_ARM64_REG_Q30 134 457 | #UC_ARM64_REG_Q31 135 458 | #UC_ARM64_REG_S0 136 459 | #UC_ARM64_REG_S1 137 460 | #UC_ARM64_REG_S2 138 461 | #UC_ARM64_REG_S3 139 462 | #UC_ARM64_REG_S4 140 463 | #UC_ARM64_REG_S5 141 464 | #UC_ARM64_REG_S6 142 465 | #UC_ARM64_REG_S7 143 466 | #UC_ARM64_REG_S8 144 467 | #UC_ARM64_REG_S9 145 468 | #UC_ARM64_REG_S10 146 469 | #UC_ARM64_REG_S11 147 470 | #UC_ARM64_REG_S12 148 471 | #UC_ARM64_REG_S13 149 472 | #UC_ARM64_REG_S14 150 473 | #UC_ARM64_REG_S15 151 474 | #UC_ARM64_REG_S16 152 475 | #UC_ARM64_REG_S17 153 476 | #UC_ARM64_REG_S18 154 477 | #UC_ARM64_REG_S19 155 478 | #UC_ARM64_REG_S20 156 479 | #UC_ARM64_REG_S21 157 480 | #UC_ARM64_REG_S22 158 481 | #UC_ARM64_REG_S23 159 482 | #UC_ARM64_REG_S24 160 483 | #UC_ARM64_REG_S25 161 484 | #UC_ARM64_REG_S26 162 485 | #UC_ARM64_REG_S27 163 486 | #UC_ARM64_REG_S28 164 487 | #UC_ARM64_REG_S29 165 488 | #UC_ARM64_REG_S30 166 489 | #UC_ARM64_REG_S31 167 490 | #UC_ARM64_REG_W0 168 491 | #UC_ARM64_REG_W1 169 492 | #UC_ARM64_REG_W2 170 493 | #UC_ARM64_REG_W3 171 494 | #UC_ARM64_REG_W4 172 495 | #UC_ARM64_REG_W5 173 496 | #UC_ARM64_REG_W6 174 497 | #UC_ARM64_REG_W7 175 498 | #UC_ARM64_REG_W8 176 499 | #UC_ARM64_REG_W9 177 500 | #UC_ARM64_REG_W10 178 501 | #UC_ARM64_REG_W11 179 502 | #UC_ARM64_REG_W12 180 503 | #UC_ARM64_REG_W13 181 504 | #UC_ARM64_REG_W14 182 505 | #UC_ARM64_REG_W15 183 506 | #UC_ARM64_REG_W16 184 507 | #UC_ARM64_REG_W17 185 508 | #UC_ARM64_REG_W18 186 509 | #UC_ARM64_REG_W19 187 510 | #UC_ARM64_REG_W20 188 511 | #UC_ARM64_REG_W21 189 512 | #UC_ARM64_REG_W22 190 513 | #UC_ARM64_REG_W23 191 514 | #UC_ARM64_REG_W24 192 515 | #UC_ARM64_REG_W25 193 516 | #UC_ARM64_REG_W26 194 517 | #UC_ARM64_REG_W27 195 518 | #UC_ARM64_REG_W28 196 519 | #UC_ARM64_REG_W29 197 520 | #UC_ARM64_REG_W30 198 521 | #UC_ARM64_REG_X0 199 522 | #UC_ARM64_REG_X1 200 523 | #UC_ARM64_REG_X2 201 524 | #UC_ARM64_REG_X3 202 525 | #UC_ARM64_REG_X4 203 526 | #UC_ARM64_REG_X5 204 527 | #UC_ARM64_REG_X6 205 528 | #UC_ARM64_REG_X7 206 529 | #UC_ARM64_REG_X8 207 530 | #UC_ARM64_REG_X9 208 531 | #UC_ARM64_REG_X10 209 532 | #UC_ARM64_REG_X11 210 533 | #UC_ARM64_REG_X12 211 534 | #UC_ARM64_REG_X13 212 535 | #UC_ARM64_REG_X14 213 536 | #UC_ARM64_REG_X15 214 537 | #UC_ARM64_REG_X16 215 538 | #UC_ARM64_REG_X17 216 539 | #UC_ARM64_REG_X18 217 540 | #UC_ARM64_REG_X19 218 541 | #UC_ARM64_REG_X20 219 542 | #UC_ARM64_REG_X21 220 543 | #UC_ARM64_REG_X22 221 544 | #UC_ARM64_REG_X23 222 545 | #UC_ARM64_REG_X24 223 546 | #UC_ARM64_REG_X25 224 547 | #UC_ARM64_REG_X26 225 548 | #UC_ARM64_REG_X27 226 549 | #UC_ARM64_REG_X28 227 550 | #UC_ARM64_REG_V0 228 551 | #UC_ARM64_REG_V1 229 552 | #UC_ARM64_REG_V2 230 553 | #UC_ARM64_REG_V3 231 554 | #UC_ARM64_REG_V4 232 555 | #UC_ARM64_REG_V5 233 556 | #UC_ARM64_REG_V6 234 557 | #UC_ARM64_REG_V7 235 558 | #UC_ARM64_REG_V8 236 559 | #UC_ARM64_REG_V9 237 560 | #UC_ARM64_REG_V10 238 561 | #UC_ARM64_REG_V11 239 562 | #UC_ARM64_REG_V12 240 563 | #UC_ARM64_REG_V13 241 564 | #UC_ARM64_REG_V14 242 565 | #UC_ARM64_REG_V15 243 566 | #UC_ARM64_REG_V16 244 567 | #UC_ARM64_REG_V17 245 568 | #UC_ARM64_REG_V18 246 569 | #UC_ARM64_REG_V19 247 570 | #UC_ARM64_REG_V20 248 571 | #UC_ARM64_REG_V21 249 572 | #UC_ARM64_REG_V22 250 573 | #UC_ARM64_REG_V23 251 574 | #UC_ARM64_REG_V24 252 575 | #UC_ARM64_REG_V25 253 576 | #UC_ARM64_REG_V26 254 577 | #UC_ARM64_REG_V27 255 578 | #UC_ARM64_REG_V28 256 579 | #UC_ARM64_REG_V29 257 580 | #UC_ARM64_REG_V30 258 581 | #UC_ARM64_REG_V31 259 582 | #UC_ARM64_REG_PC 260 583 | #UC_ARM64_REG_CPACR_EL1 261 584 | #UC_ARM64_REG_TPIDR_EL0 262 585 | #UC_ARM64_REG_TPIDRRO_EL0 263 586 | #UC_ARM64_REG_TPIDR_EL1 264 587 | #UC_ARM64_REG_PSTATE 265 588 | #UC_ARM64_REG_ELR_EL0 266 589 | #UC_ARM64_REG_ELR_EL1 267 590 | #UC_ARM64_REG_ELR_EL2 268 591 | #UC_ARM64_REG_ELR_EL3 269 592 | #UC_ARM64_REG_SP_EL0 270 593 | #UC_ARM64_REG_SP_EL1 271 594 | #UC_ARM64_REG_SP_EL2 272 595 | #UC_ARM64_REG_SP_EL3 273 596 | #UC_ARM64_REG_TTBR0_EL1 274 597 | #UC_ARM64_REG_TTBR1_EL1 275 598 | #UC_ARM64_REG_ESR_EL0 276 599 | #UC_ARM64_REG_ESR_EL1 277 600 | #UC_ARM64_REG_ESR_EL2 278 601 | #UC_ARM64_REG_ESR_EL3 279 602 | #UC_ARM64_REG_FAR_EL0 280 603 | #UC_ARM64_REG_FAR_EL1 281 604 | #UC_ARM64_REG_FAR_EL2 282 605 | #UC_ARM64_REG_FAR_EL3 283 606 | #UC_ARM64_REG_PAR_EL1 284 607 | #UC_ARM64_REG_MAIR_EL1 285 608 | #UC_ARM64_REG_VBAR_EL0 286 609 | #UC_ARM64_REG_VBAR_EL1 287 610 | #UC_ARM64_REG_VBAR_EL2 288 611 | #UC_ARM64_REG_VBAR_EL3 289 612 | #UC_ARM64_REG_ENDING 290) 613 | ] 614 | 615 | { #category : #accessing } 616 | UcARM64Registers class >> fp [ 617 | "This is an alias to X29" 618 | ^ UC_ARM64_REG_X29 619 | ] 620 | 621 | { #category : #'enum declaration' } 622 | UcARM64Registers class >> initialize [ 623 | 624 | self initializeEnumeration 625 | ] 626 | 627 | { #category : #accessing } 628 | UcARM64Registers class >> lr [ 629 | "This is an alias to X30" 630 | ^ UC_ARM64_REG_X30 631 | ] 632 | 633 | { #category : #accessing } 634 | UcARM64Registers class >> nzcv [ 635 | 636 | ^ UC_ARM64_REG_NZCV 637 | ] 638 | 639 | { #category : #accessing } 640 | UcARM64Registers class >> pc [ 641 | 642 | ^ UC_ARM64_REG_PC 643 | ] 644 | 645 | { #category : #accessing } 646 | UcARM64Registers class >> sp [ 647 | ^ UC_ARM64_REG_SP 648 | ] 649 | 650 | { #category : #'as yet unclassified' } 651 | UcARM64Registers class >> w25 [ 652 | 653 | ^ UC_ARM64_REG_W25 654 | ] 655 | 656 | { #category : #'as yet unclassified' } 657 | UcARM64Registers class >> w6 [ 658 | 659 | ^ UC_ARM64_REG_W6 660 | ] 661 | 662 | { #category : #accessing } 663 | UcARM64Registers class >> x0 [ 664 | 665 | ^ UC_ARM64_REG_X0 666 | ] 667 | 668 | { #category : #accessing } 669 | UcARM64Registers class >> x1 [ 670 | 671 | ^ UC_ARM64_REG_X1 672 | ] 673 | 674 | { #category : #accessing } 675 | UcARM64Registers class >> x10 [ 676 | 677 | ^ UC_ARM64_REG_X10 678 | ] 679 | 680 | { #category : #accessing } 681 | UcARM64Registers class >> x11 [ 682 | 683 | ^ UC_ARM64_REG_X11 684 | ] 685 | 686 | { #category : #accessing } 687 | UcARM64Registers class >> x12 [ 688 | 689 | ^ UC_ARM64_REG_X12 690 | ] 691 | 692 | { #category : #'as yet unclassified' } 693 | UcARM64Registers class >> x13 [ 694 | ^ UC_ARM64_REG_X13 695 | ] 696 | 697 | { #category : #'as yet unclassified' } 698 | UcARM64Registers class >> x14 [ 699 | ^ UC_ARM64_REG_X14 700 | ] 701 | 702 | { #category : #'as yet unclassified' } 703 | UcARM64Registers class >> x15 [ 704 | ^ UC_ARM64_REG_X15 705 | ] 706 | 707 | { #category : #'as yet unclassified' } 708 | UcARM64Registers class >> x16 [ 709 | ^ UC_ARM64_REG_X16 710 | ] 711 | 712 | { #category : #'as yet unclassified' } 713 | UcARM64Registers class >> x17 [ 714 | ^ UC_ARM64_REG_X17 715 | ] 716 | 717 | { #category : #'as yet unclassified' } 718 | UcARM64Registers class >> x18 [ 719 | ^ UC_ARM64_REG_X18 720 | ] 721 | 722 | { #category : #'as yet unclassified' } 723 | UcARM64Registers class >> x19 [ 724 | ^ UC_ARM64_REG_X19 725 | ] 726 | 727 | { #category : #accessing } 728 | UcARM64Registers class >> x2 [ 729 | 730 | ^ UC_ARM64_REG_X2 731 | ] 732 | 733 | { #category : #accessing } 734 | UcARM64Registers class >> x20 [ 735 | 736 | ^ UC_ARM64_REG_X20 737 | ] 738 | 739 | { #category : #accessing } 740 | UcARM64Registers class >> x22 [ 741 | 742 | ^ UC_ARM64_REG_X22 743 | ] 744 | 745 | { #category : #accessing } 746 | UcARM64Registers class >> x23 [ 747 | 748 | ^ UC_ARM64_REG_X23 749 | ] 750 | 751 | { #category : #accessing } 752 | UcARM64Registers class >> x24 [ 753 | 754 | ^ UC_ARM64_REG_X24 755 | ] 756 | 757 | { #category : #accessing } 758 | UcARM64Registers class >> x25 [ 759 | 760 | ^ UC_ARM64_REG_X25 761 | ] 762 | 763 | { #category : #accessing } 764 | UcARM64Registers class >> x28 [ 765 | 766 | ^ UC_ARM64_REG_X28 767 | ] 768 | 769 | { #category : #accessing } 770 | UcARM64Registers class >> x29 [ 771 | 772 | ^ UC_ARM64_REG_X29 773 | ] 774 | 775 | { #category : #accessing } 776 | UcARM64Registers class >> x3 [ 777 | 778 | ^ UC_ARM64_REG_X3 779 | ] 780 | 781 | { #category : #accessing } 782 | UcARM64Registers class >> x30 [ 783 | 784 | ^ UC_ARM64_REG_X30 785 | ] 786 | 787 | { #category : #accessing } 788 | UcARM64Registers class >> x4 [ 789 | 790 | ^ UC_ARM64_REG_X4 791 | ] 792 | 793 | { #category : #accessing } 794 | UcARM64Registers class >> x5 [ 795 | 796 | ^ UC_ARM64_REG_X5 797 | ] 798 | 799 | { #category : #accessing } 800 | UcARM64Registers class >> x6 [ 801 | 802 | ^ UC_ARM64_REG_X6 803 | ] 804 | 805 | { #category : #accessing } 806 | UcARM64Registers class >> x7 [ 807 | 808 | ^ UC_ARM64_REG_X7 809 | ] 810 | 811 | { #category : #accessing } 812 | UcARM64Registers class >> x8 [ 813 | 814 | ^ UC_ARM64_REG_X8 815 | ] 816 | 817 | { #category : #accessing } 818 | UcARM64Registers class >> x9 [ 819 | 820 | ^ UC_ARM64_REG_X9 821 | ] 822 | 823 | { #category : #accessing } 824 | UcARM64Registers class >> xzr [ 825 | 826 | ^ UC_ARM64_REG_XZR 827 | ] 828 | --------------------------------------------------------------------------------