http://pastebin.com/45UABbmW
https://github.com/kwsch/PKHeX/blob/master/SAV/SAV_SecretBase.cs#L219
https://github.com/kwsch/PKHeX/blob/master/Misc/PKX.cs#L679
open your save file in a hex editor, go to offset 0x23A00, then change the quantity.
the item quantity is at 0x23A00 + i * 4, where 'i' is the item you want to change (refer to pastebin)
In theory, that is how it can be modified.