Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
asn1-value-editor
Commits
15cac722
Commit
15cac722
authored
Aug 18, 2016
by
Maxime Perrotin
Browse files
Use new OG API to get/restore context
parent
0cb468d7
Changes
1
Hide whitespace changes
Inline
Side-by-side
asn1_value_editor/sdlHandler.py
View file @
15cac722
...
...
@@ -493,9 +493,6 @@ class sdlHandler(QObject):
# Read in the DLL the list of internal variables
for
var
,
(
sort
,
_
)
in
self
.
proc
.
variables
.
viewitems
():
typename
=
sort
.
ReferencedTypeName
.
replace
(
'-'
,
'_'
)
get_size
=
getattr
(
self
.
dll
,
"{}_size"
.
format
(
var
))
get_size
.
restype
=
ctypes
.
c_uint
size
=
get_size
()
# ctypes hint: don't use c_char_p except for text strings
get_value
=
getattr
(
self
.
dll
,
"{}_value"
.
format
(
var
))
get_value
.
restype
=
ctypes
.
c_void_p
...
...
@@ -604,8 +601,13 @@ class sdlHandler(QObject):
def
direct_tc
(
self
,
name
,
arg_ctypes_ptr
):
''' Send a TC by calling directly the function in the dll '''
# Save internal state, send tc, restore state
getattr
(
self
.
dll
,
"_save_context"
)()
getattr
(
self
.
dll
,
'{}_{}'
.
format
(
self
.
proc
.
processName
,
name
))(
arg_ctypes_ptr
)
new_hash
=
self
.
on_event
()
getattr
(
self
.
dll
,
"_restore_context"
)()
return
new_hash
def
click_tc
(
self
,
name
,
arg_gser
=
None
):
''' Send a TC by clicking on the Send button automatically
...
...
@@ -683,9 +685,9 @@ class sdlHandler(QObject):
for
arg_gser
in
compute_combinations
(
asn1_ty
,
self
.
proc
.
dataview
,
asn1_inst
):
self
.
direct_tc
(
name
,
ptr
)
new_hash
=
self
.
direct_tc
(
name
,
ptr
)
#self.click_tc(name, arg_gser)
new_hash
=
self
.
current_hash
#
new_hash = self.current_hash
#self.undo()
yield
new_hash
,
(
name
,
arg_gser
)
else
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment