Created
August 15, 2017 05:06
-
-
Save neikeq/2cf9981c2e019093be987eeadc88e19f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def qedit__String(d, value, data): | |
| val = d.fromNativeValue(value) | |
| d.call('Error', val, 'resize', str(len(data) + 1)) | |
| d.setValues(val['_ptr'].extractPointer(), 'wchar_t', [ord(c) for c in data] + [ 0 ]) | |
| def qform__String(): | |
| return [SimpleFormat, SeparateFormat] | |
| def qdump__String(d, value): | |
| charType = d.lookupType('wchar_t') | |
| charSize = charType.size() | |
| data = value['_ptr'] | |
| size_raw = d.readRawMemory(data.dereference().address() - 4, 4) | |
| size = int.from_bytes(size_raw[0:4], byteorder='little') | |
| d.putCharArrayHelper(data.extractPointer(), size - 1, charType, d.currentItemFormat()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment