Commit Graph

13 Commits

Author SHA1 Message Date
Mike Frysinger dcb1c10540 update capstone-engine.org URIs to https:// 2023-01-17 00:01:24 -05:00
Erik Hemming a8559cfb78 Fix a couple of corner-cases with rarely used m68k instructions. (#1344)
* Bump the "cs_insn.bytes[]" size to 24 (from 16) to support M680x0 instructions with full EA (maximum 11 words)
Added a test for this in test_m68k.s

* Bump the "cs_detail.regs_read[]" size to 16 (from 12) to support M680x0 instructions with full REG_BITS (Dn+An = 16)

* m68k: use immediate mode syntax (#$0) for movem/fmovem instructions with empty register list

* update bindings to match changes to cs_insn and cs_detail
2019-01-21 16:55:05 +08:00
beatcracker d70e2b286a Update PowerShell bindings (#1239)
* Remove trailing whitespace

* ~2x speedup by removing array appending

More info: https://powershell.org/2013/09/16/powershell-performance-the-operator-and-when-to-avoid-it/

* Import inline C# conditionally

Avoids errors when importing module using "-Force"

* Throw exception on missing DLL

+ use idiomatic PowerShell

* Throw exception on errors

+ use idiomatic PowerShell

* Throw exception on errors

+ use idiomatic PowerShell

* Use idiomatic PowerShell

* Fix DLL path escaping

* Add native PowerShell formatting

Instruction address will display as "0xdeadbeef" in console output, but the actual value will be stored as appropriate integer type.

This allows to use "Address" property directly in code that relies on Get-Capstone disasselbly w/o type conversion.

The original module author was using hex-strings, because when you add things in PowerShell like this:  $Integer + '0xFF' , PowerShell will cast everything to the type of the first operand. And it's smart enough to cast hex-string to integer.

Example: https://github.com/FuzzySecurity/PowerShell-Suite/blob/master/Trace-Execution.ps1#L195

But this is unreliable and moreover, PowerShell has peculiar quirks when casting hex-strings: https://github.com/PowerShell/PowerShell/issues/3313

* Move Capstone init to separate function

* Add Get-CaptoneVersion function

Which resturns "version" object. Also add back erroneously deleted "return" to Get-CapstoneDisassembly -Version and convert it to advanced function.

* Fix help text

* Replace double quotes with single quotes where appropriate

* No need to assign $null to switch params

* Make return usage more obvious

* No need for double quotes in version banner

* Add space after comma

* ~3x speedup by removing New-Object usage. Requires PS 3.0

* Cosmetic fixes

* Remove PS 2.0 compatibility code

* Fix PSScriptAnalyzer warnings

* Don't load module if inline C# doesn't compile

* Return actual instruction bytes

* Fix version function

* Use lowercase for accelerators

* Remove "Mandatory = $False" since it's default

* Add spaces around "=" and ";"

* Use lowercase for built-in variables

* Tabs -> Spaces

* Update help

* Use standard manifest

* UTF-8, no BOM

* Remove remaining New-Object invocations

* Bump module version (semver anyone?)

* Restore PSv2 compatibility

Use [pscustomobject]/New-Object based on reported PS version.

* Tabs -> Spaces

* Update authors
2018-09-11 12:50:55 +08:00
FuzzySecurity 2328253802 $Address -> UInt64 !Int32 2016-11-15 13:45:52 +01:00
FuzzySecurity b526229ee4 Fix: cs_close -> [ref]Ptr not Ptr 2016-11-12 16:01:33 +01:00
FuzzySecurity 2a668317b5 Revert constant generation + Quality of service change 2016-11-11 14:15:45 +01:00
FuzzySecurity a75752bb81 +Get-CapstoneDisassembly
Reworked according to the module in Keystone
2016-11-10 22:36:07 +01:00
FuzzySecurity b9f38edd21 PowerShell.Binding-Rework
A rework of the pull request based on feedback for the same pull
request in Keystone
2016-11-05 03:53:37 +01:00
FuzzySecurity 12ce2b31d7 Binding.PowerShell-Script
Added script to generate compressed DLL output & update for README
2016-11-04 10:56:47 +01:00
FuzzySecurity 8da385d9ad Binding.README.Ps1 2016-11-03 21:56:37 +01:00
FuzzySecurity db50d8415c Binding.README 2016-11-03 21:51:48 +01:00
FuzzySecurity af38ecc520 Binding.README 2016-11-03 21:49:01 +01:00
FuzzySecurity a7f8a4f4a0 Binding.README 2016-11-03 21:29:37 +01:00