Lines Matching refs:ctypes
35 import ctypes
86 self.size = ctypes.sizeof(self.ctype)
109 class Raw(ctypes.Structure):
145 byte = ctypes.c_uint8.from_buffer(reader.minidump, slot + i).value
185 ("signature", ctypes.c_uint32),
186 ("version", ctypes.c_uint32),
187 ("stream_count", ctypes.c_uint32),
188 ("stream_directories_rva", ctypes.c_uint32),
189 ("checksum", ctypes.c_uint32),
190 ("time_date_stampt", ctypes.c_uint32),
191 ("flags", ctypes.c_uint64)
195 ("data_size", ctypes.c_uint32),
196 ("rva", ctypes.c_uint32)
200 ("length", ctypes.c_uint32),
201 ("buffer", lambda t: ctypes.c_uint8 * (t.length + 2))
205 ("stream_type", ctypes.c_uint32),
212 ("code", ctypes.c_uint32),
213 ("flags", ctypes.c_uint32),
214 ("record", ctypes.c_uint64),
215 ("address", ctypes.c_uint64),
216 ("parameter_count", ctypes.c_uint32),
217 ("unused_alignment", ctypes.c_uint32),
218 ("information", ctypes.c_uint64 * MD_EXCEPTION_MAXIMUM_PARAMETERS)
222 ("thread_id", ctypes.c_uint32),
223 ("unused_alignment", ctypes.c_uint32),
252 ("control_word", ctypes.c_uint32),
253 ("status_word", ctypes.c_uint32),
254 ("tag_word", ctypes.c_uint32),
255 ("error_offset", ctypes.c_uint32),
256 ("error_selector", ctypes.c_uint32),
257 ("data_offset", ctypes.c_uint32),
258 ("data_selector", ctypes.c_uint32),
259 ("register_area", ctypes.c_uint8 * MD_FLOATINGSAVEAREA_X86_REGISTERAREA_SIZE),
260 ("cr0_npx_state", ctypes.c_uint32)
278 ("context_flags", ctypes.c_uint32),
280 ("dr0", EnableOnFlag(ctypes.c_uint32, MD_CONTEXT_X86_DEBUG_REGISTERS)),
281 ("dr1", EnableOnFlag(ctypes.c_uint32, MD_CONTEXT_X86_DEBUG_REGISTERS)),
282 ("dr2", EnableOnFlag(ctypes.c_uint32, MD_CONTEXT_X86_DEBUG_REGISTERS)),
283 ("dr3", EnableOnFlag(ctypes.c_uint32, MD_CONTEXT_X86_DEBUG_REGISTERS)),
284 ("dr6", EnableOnFlag(ctypes.c_uint32, MD_CONTEXT_X86_DEBUG_REGISTERS)),
285 ("dr7", EnableOnFlag(ctypes.c_uint32, MD_CONTEXT_X86_DEBUG_REGISTERS)),
290 ("gs", EnableOnFlag(ctypes.c_uint32, MD_CONTEXT_X86_SEGMENTS)),
291 ("fs", EnableOnFlag(ctypes.c_uint32, MD_CONTEXT_X86_SEGMENTS)),
292 ("es", EnableOnFlag(ctypes.c_uint32, MD_CONTEXT_X86_SEGMENTS)),
293 ("ds", EnableOnFlag(ctypes.c_uint32, MD_CONTEXT_X86_SEGMENTS)),
295 ("edi", EnableOnFlag(ctypes.c_uint32, MD_CONTEXT_X86_INTEGER)),
296 ("esi", EnableOnFlag(ctypes.c_uint32, MD_CONTEXT_X86_INTEGER)),
297 ("ebx", EnableOnFlag(ctypes.c_uint32, MD_CONTEXT_X86_INTEGER)),
298 ("edx", EnableOnFlag(ctypes.c_uint32, MD_CONTEXT_X86_INTEGER)),
299 ("ecx", EnableOnFlag(ctypes.c_uint32, MD_CONTEXT_X86_INTEGER)),
300 ("eax", EnableOnFlag(ctypes.c_uint32, MD_CONTEXT_X86_INTEGER)),
302 ("ebp", EnableOnFlag(ctypes.c_uint32, MD_CONTEXT_X86_CONTROL)),
303 ("eip", EnableOnFlag(ctypes.c_uint32, MD_CONTEXT_X86_CONTROL)),
304 ("cs", EnableOnFlag(ctypes.c_uint32, MD_CONTEXT_X86_CONTROL)),
305 ("eflags", EnableOnFlag(ctypes.c_uint32, MD_CONTEXT_X86_CONTROL)),
306 ("esp", EnableOnFlag(ctypes.c_uint32, MD_CONTEXT_X86_CONTROL)),
307 ("ss", EnableOnFlag(ctypes.c_uint32, MD_CONTEXT_X86_CONTROL)),
310 EnableOnFlag(ctypes.c_uint8 * MD_CONTEXT_X86_EXTENDED_REGISTERS_SIZE,
321 ("fpscr", ctypes.c_uint64),
322 ("regs", ctypes.c_uint64 * MD_FLOATINGSAVEAREA_ARM_FPR_COUNT),
323 ("extra", ctypes.c_uint64 * MD_FLOATINGSAVEAREA_ARM_FPEXTRA_COUNT)
327 ("context_flags", ctypes.c_uint32),
329 ("r0", EnableOnFlag(ctypes.c_uint32, MD_CONTEXT_ARM_INTEGER)),
330 ("r1", EnableOnFlag(ctypes.c_uint32, MD_CONTEXT_ARM_INTEGER)),
331 ("r2", EnableOnFlag(ctypes.c_uint32, MD_CONTEXT_ARM_INTEGER)),
332 ("r3", EnableOnFlag(ctypes.c_uint32, MD_CONTEXT_ARM_INTEGER)),
333 ("r4", EnableOnFlag(ctypes.c_uint32, MD_CONTEXT_ARM_INTEGER)),
334 ("r5", EnableOnFlag(ctypes.c_uint32, MD_CONTEXT_ARM_INTEGER)),
335 ("r6", EnableOnFlag(ctypes.c_uint32, MD_CONTEXT_ARM_INTEGER)),
336 ("r7", EnableOnFlag(ctypes.c_uint32, MD_CONTEXT_ARM_INTEGER)),
337 ("r8", EnableOnFlag(ctypes.c_uint32, MD_CONTEXT_ARM_INTEGER)),
338 ("r9", EnableOnFlag(ctypes.c_uint32, MD_CONTEXT_ARM_INTEGER)),
339 ("r10", EnableOnFlag(ctypes.c_uint32, MD_CONTEXT_ARM_INTEGER)),
340 ("r11", EnableOnFlag(ctypes.c_uint32, MD_CONTEXT_ARM_INTEGER)),
341 ("r12", EnableOnFlag(ctypes.c_uint32, MD_CONTEXT_ARM_INTEGER)),
342 ("sp", EnableOnFlag(ctypes.c_uint32, MD_CONTEXT_ARM_INTEGER)),
343 ("lr", EnableOnFlag(ctypes.c_uint32, MD_CONTEXT_ARM_INTEGER)),
344 ("pc", EnableOnFlag(ctypes.c_uint32, MD_CONTEXT_ARM_INTEGER)),
345 ("cpsr", ctypes.c_uint32),
357 ("fpscr", ctypes.c_uint64),
358 ("regs", ctypes.c_uint64 * MD_FLOATINGSAVEAREA_ARM64_FPR_COUNT),
362 ("context_flags", ctypes.c_uint64),
364 ("r0", EnableOnFlag(ctypes.c_uint64, MD_CONTEXT_ARM64_INTEGER)),
365 ("r1", EnableOnFlag(ctypes.c_uint64, MD_CONTEXT_ARM64_INTEGER)),
366 ("r2", EnableOnFlag(ctypes.c_uint64, MD_CONTEXT_ARM64_INTEGER)),
367 ("r3", EnableOnFlag(ctypes.c_uint64, MD_CONTEXT_ARM64_INTEGER)),
368 ("r4", EnableOnFlag(ctypes.c_uint64, MD_CONTEXT_ARM64_INTEGER)),
369 ("r5", EnableOnFlag(ctypes.c_uint64, MD_CONTEXT_ARM64_INTEGER)),
370 ("r6", EnableOnFlag(ctypes.c_uint64, MD_CONTEXT_ARM64_INTEGER)),
371 ("r7", EnableOnFlag(ctypes.c_uint64, MD_CONTEXT_ARM64_INTEGER)),
372 ("r8", EnableOnFlag(ctypes.c_uint64, MD_CONTEXT_ARM64_INTEGER)),
373 ("r9", EnableOnFlag(ctypes.c_uint64, MD_CONTEXT_ARM64_INTEGER)),
374 ("r10", EnableOnFlag(ctypes.c_uint64, MD_CONTEXT_ARM64_INTEGER)),
375 ("r11", EnableOnFlag(ctypes.c_uint64, MD_CONTEXT_ARM64_INTEGER)),
376 ("r12", EnableOnFlag(ctypes.c_uint64, MD_CONTEXT_ARM64_INTEGER)),
377 ("r13", EnableOnFlag(ctypes.c_uint64, MD_CONTEXT_ARM64_INTEGER)),
378 ("r14", EnableOnFlag(ctypes.c_uint64, MD_CONTEXT_ARM64_INTEGER)),
379 ("r15", EnableOnFlag(ctypes.c_uint64, MD_CONTEXT_ARM64_INTEGER)),
380 ("r16", EnableOnFlag(ctypes.c_uint64, MD_CONTEXT_ARM64_INTEGER)),
381 ("r17", EnableOnFlag(ctypes.c_uint64, MD_CONTEXT_ARM64_INTEGER)),
382 ("r18", EnableOnFlag(ctypes.c_uint64, MD_CONTEXT_ARM64_INTEGER)),
383 ("r19", EnableOnFlag(ctypes.c_uint64, MD_CONTEXT_ARM64_INTEGER)),
384 ("r20", EnableOnFlag(ctypes.c_uint64, MD_CONTEXT_ARM64_INTEGER)),
385 ("r21", EnableOnFlag(ctypes.c_uint64, MD_CONTEXT_ARM64_INTEGER)),
386 ("r22", EnableOnFlag(ctypes.c_uint64, MD_CONTEXT_ARM64_INTEGER)),
387 ("r23", EnableOnFlag(ctypes.c_uint64, MD_CONTEXT_ARM64_INTEGER)),
388 ("r24", EnableOnFlag(ctypes.c_uint64, MD_CONTEXT_ARM64_INTEGER)),
389 ("r25", EnableOnFlag(ctypes.c_uint64, MD_CONTEXT_ARM64_INTEGER)),
390 ("r26", EnableOnFlag(ctypes.c_uint64, MD_CONTEXT_ARM64_INTEGER)),
391 ("r27", EnableOnFlag(ctypes.c_uint64, MD_CONTEXT_ARM64_INTEGER)),
392 ("r28", EnableOnFlag(ctypes.c_uint64, MD_CONTEXT_ARM64_INTEGER)),
393 ("fp", EnableOnFlag(ctypes.c_uint64, MD_CONTEXT_ARM64_INTEGER)),
394 ("lr", EnableOnFlag(ctypes.c_uint64, MD_CONTEXT_ARM64_INTEGER)),
395 ("sp", EnableOnFlag(ctypes.c_uint64, MD_CONTEXT_ARM64_INTEGER)),
396 ("pc", EnableOnFlag(ctypes.c_uint64, MD_CONTEXT_ARM64_INTEGER)),
397 ("cpsr", ctypes.c_uint32),
411 ("p1_home", ctypes.c_uint64),
412 ("p2_home", ctypes.c_uint64),
413 ("p3_home", ctypes.c_uint64),
414 ("p4_home", ctypes.c_uint64),
415 ("p5_home", ctypes.c_uint64),
416 ("p6_home", ctypes.c_uint64),
417 ("context_flags", ctypes.c_uint32),
418 ("mx_csr", ctypes.c_uint32),
420 ("cs", EnableOnFlag(ctypes.c_uint16, MD_CONTEXT_AMD64_CONTROL)),
422 ("ds", EnableOnFlag(ctypes.c_uint16, MD_CONTEXT_AMD64_SEGMENTS)),
423 ("es", EnableOnFlag(ctypes.c_uint16, MD_CONTEXT_AMD64_SEGMENTS)),
424 ("fs", EnableOnFlag(ctypes
425 ("gs", EnableOnFlag(ctypes.c_uint16, MD_CONTEXT_AMD64_SEGMENTS)),
427 ("ss", EnableOnFlag(ctypes.c_uint16, MD_CONTEXT_AMD64_CONTROL)),
428 ("eflags", EnableOnFlag(ctypes.c_uint32, MD_CONTEXT_AMD64_CONTROL)),
430 ("dr0", EnableOnFlag(ctypes.c_uint64, MD_CONTEXT_AMD64_DEBUG_REGISTERS)),
431 ("dr1", EnableOnFlag(ctypes.c_uint64, MD_CONTEXT_AMD64_DEBUG_REGISTERS)),
432 ("dr2", EnableOnFlag(ctypes.c_uint64, MD_CONTEXT_AMD64_DEBUG_REGISTERS)),
433 ("dr3", EnableOnFlag(ctypes.c_uint64, MD_CONTEXT_AMD64_DEBUG_REGISTERS)),
434 ("dr6", EnableOnFlag(ctypes.c_uint64, MD_CONTEXT_AMD64_DEBUG_REGISTERS)),
435 ("dr7", EnableOnFlag(ctypes.c_uint64, MD_CONTEXT_AMD64_DEBUG_REGISTERS)),
437 ("rax", EnableOnFlag(ctypes.c_uint64, MD_CONTEXT_AMD64_INTEGER)),
438 ("rcx", EnableOnFlag(ctypes.c_uint64, MD_CONTEXT_AMD64_INTEGER)),
439 ("rdx", EnableOnFlag(ctypes.c_uint64, MD_CONTEXT_AMD64_INTEGER)),
440 ("rbx", EnableOnFlag(ctypes.c_uint64, MD_CONTEXT_AMD64_INTEGER)),
442 ("rsp", EnableOnFlag(ctypes.c_uint64, MD_CONTEXT_AMD64_CONTROL)),
444 ("rbp", EnableOnFlag(ctypes.c_uint64, MD_CONTEXT_AMD64_INTEGER)),
445 ("rsi", EnableOnFlag(ctypes.c_uint64, MD_CONTEXT_AMD64_INTEGER)),
446 ("rdi", EnableOnFlag(ctypes.c_uint64, MD_CONTEXT_AMD64_INTEGER)),
447 ("r8", EnableOnFlag(ctypes.c_uint64, MD_CONTEXT_AMD64_INTEGER)),
448 ("r9", EnableOnFlag(ctypes.c_uint64, MD_CONTEXT_AMD64_INTEGER)),
449 ("r10", EnableOnFlag(ctypes.c_uint64, MD_CONTEXT_AMD64_INTEGER)),
450 ("r11", EnableOnFlag(ctypes.c_uint64, MD_CONTEXT_AMD64_INTEGER)),
451 ("r12", EnableOnFlag(ctypes.c_uint64, MD_CONTEXT_AMD64_INTEGER)),
452 ("r13", EnableOnFlag(ctypes.c_uint64, MD_CONTEXT_AMD64_INTEGER)),
453 ("r14", EnableOnFlag(ctypes.c_uint64, MD_CONTEXT_AMD64_INTEGER)),
454 ("r15", EnableOnFlag(ctypes.c_uint64, MD_CONTEXT_AMD64_INTEGER)),
456 ("rip", EnableOnFlag(ctypes.c_uint64, MD_CONTEXT_AMD64_CONTROL)),
458 ("sse_registers", EnableOnFlag(ctypes.c_uint8 * (16 * 26),
460 ("vector_registers", EnableOnFlag(ctypes.c_uint8 * (16 * 26),
462 ("vector_control", EnableOnFlag(ctypes.c_uint64,
465 ("debug_control", EnableOnFlag(ctypes.c_uint64,
467 ("last_branch_to_rip", EnableOnFlag(ctypes.c_uint64,
469 ("last_branch_from_rip", EnableOnFlag(ctypes.c_uint64,
471 ("last_exception_to_rip", EnableOnFlag(ctypes.c_uint64,
473 ("last_exception_from_rip", EnableOnFlag(ctypes.c_uint64,
478 ("start", ctypes.c_uint64),
483 ("start", ctypes.c_uint64),
484 ("size", ctypes.c_uint64)
488 ("range_count", ctypes.c_uint32),
493 ("range_count", ctypes.c_uint32),
494 ("junk", ctypes.c_uint32),
499 ("range_count", ctypes.c_uint64),
500 ("base_rva", ctypes.c_uint64),
505 ("id", ctypes.c_uint32),
506 ("suspend_count", ctypes.c_uint32),
507 ("priority_class", ctypes.c_uint32),
508 ("priority", ctypes.c_uint32),
509 ("ted", ctypes.c_uint64),
515 ("thread_count", ctypes.c_uint32),
520 ("thread_count", ctypes.c_uint32),
521 ("junk", ctypes.c_uint32),
526 ("dwSignature", ctypes.c_uint32),
527 ("dwStrucVersion", ctypes.c_uint32),
528 ("dwFileVersionMS", ctypes.c_uint32),
529 ("dwFileVersionLS", ctypes.c_uint32),
530 ("dwProductVersionMS", ctypes.c_uint32),
531 ("dwProductVersionLS", ctypes.c_uint32),
532 ("dwFileFlagsMask", ctypes.c_uint32),
533 ("dwFileFlags", ctypes.c_uint32),
534 ("dwFileOS", ctypes.c_uint32),
535 ("dwFileType", ctypes.c_uint32),
536 ("dwFileSubtype", ctypes.c_uint32),
537 ("dwFileDateMS", ctypes.c_uint32),
538 ("dwFileDateLS", ctypes.c_uint32)
542 ("base_of_image", ctypes.c_uint64),
543 ("size_of_image", ctypes.c_uint32),
544 ("checksum", ctypes.c_uint32),
545 ("time_date_stamp", ctypes.c_uint32),
546 ("module_name_rva", ctypes.c_uint32),
550 ("reserved0", ctypes.c_uint32 * 2),
551 ("reserved1", ctypes.c_uint32 * 2)
555 ("number_of_modules", ctypes.c_uint32),
560 ("number_of_modules", ctypes.c_uint32),
561 ("junk", ctypes.c_uint32),
566 ("processor_architecture", ctypes.c_uint16)
651 if ctypes.sizeof(thread_list) + 4 == d.location.data_size:
654 assert ctypes.sizeof(thread_list) == d.location.data_size
663 if ctypes.sizeof(self.module_list) + 4 == d.location.data_size:
666 assert ctypes.sizeof(self.module_list) == d.location.data_size
673 if ctypes.sizeof(self.memory_list) + 4 == d.location.data_size:
676 assert ctypes.sizeof(self.memory_list) == d.location.data_size
682 assert ctypes.sizeof(self.memory_list64) == d.location.data_size
690 return ctypes.c_uint8.from_buffer(self.minidump, location).value
694 return ctypes.c_uint32.from_buffer(self.minidump, location).value
698 return ctypes.c_uint64.from_buffer(self.minidump, location).value
716 return ctypes.c_uint64.from_buffer(self.minidump, location).value
718 return ctypes.c_uint32.from_buffer(self.minidump, location).value
720 return ctypes.c_uint64.from_buffer(self.minidump, location).value
722 return ctypes.c_uint32.from_buffer(self.minidump, location).value
729 byte = ctypes.c_uint8.from_buffer(self.minidump, loc).value
751 byte = ctypes.c_uint8.from_buffer(self.minidump, loc).value