I've encountered this function, which accepts a pointer to what I believe is a custom C struct. I came to this conclusion based on subsequent access to it.
arg_0= dword ptr 4 ;struct passed in
push ebx
push ebp
mov ebp, [esp+8+arg_0] ; store pointer of struct in ebp
push esi
push edi
xor ebx, ebx
and, not too far from above, I see it being populated:
mov [ebp+0D4h], bl
mov [ebp+0F4h], bl
mov [ebp+114h], bl
xor eax, eax
mov [ebp+0B8h], eax
mov [ebp+0BCh], eax
mov [ebp+0C0h], eax
I do not know the size of the structure, but I've seen [ebp+0f14h]. Therefore, I've defined a custom IDA sturct of size 0xF14. Now I'm having trouble with applying this custom structure to this pointer. I've tried Alt+Q then selecting my own custom struct, but it is not working. The output window says Command "DeclareStructVar" failed
My custom struct:
00000000 custom_sturct struc ; (sizeof=0xF14)
00000000 db ? ; undefined
00000001 db ? ; undefined
00000002 db ? ; undefined
[...same stuff...]
00000F11 db ? ; undefined
00000F12 db ? ; undefined
00000F13 field_F13 db ?
00000F14 custom_sturct ends
00000F14
I'm using IDA Pro 6.3



ebp. – vincentleest Jul 28 '15 at 22:08mov [ebp+...], ...instruction as described in https://www.hex-rays.com/products/ida/support/tutorials/structs.shtml? – Jason Geffner Jul 29 '15 at 00:39ebpuse the structure automatically. You'll have to right-click each of the offsets, select "Structure offset" from the context menu, then select yourcustom_structfield. (Or, as a shortcut, use theTkey). – Guntram Blohm Jul 29 '15 at 08:41ebpregister a custom name. Thecustom_structshowed up after I've removed the custom name for the register. – vincentleest Jul 29 '15 at 14:37Shift + Tto convert multiple offsets at once instead of doing it line be line. Docs are here, code is available here. I've not tested in on 6.3, but it should work and save some time. – tmr232 Aug 01 '15 at 22:05t. A different menu will appear which will allow you to select a register (chooseebp) and a structure (choosecustom_struct) and it will convert each offset fromebpwithin the selection to an offset ofcustom_struct. This works best in the linear view. – user1354557 Jan 11 '16 at 17:38