{"action":"created","issue":{"url":"https://api.github.com/repos/sensepost/USaBUSe/issues/15","repository_url":"https://api.github.com/repos/sensepost/USaBUSe","labels_url":"https://api.github.com/repos/sensepost/USaBUSe/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/sensepost/USaBUSe/issues/15/comments","events_url":"https://api.github.com/repos/sensepost/USaBUSe/issues/15/events","html_url":"https://github.com/sensepost/USaBUSe/issues/15","id":218268599,"number":15,"title":"Discussion - full duplex by splitting HID in / out into separate composite functions (no issue)","user":{"login":"mame82","id":13119970,"avatar_url":"https://avatars0.githubusercontent.com/u/13119970?v=3","gravatar_id":"","url":"https://api.github.com/users/mame82","html_url":"https://github.com/mame82","followers_url":"https://api.github.com/users/mame82/followers","following_url":"https://api.github.com/users/mame82/following{/other_user}","gists_url":"https://api.github.com/users/mame82/gists{/gist_id}","starred_url":"https://api.github.com/users/mame82/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mame82/subscriptions","organizations_url":"https://api.github.com/users/mame82/orgs","repos_url":"https://api.github.com/users/mame82/repos","events_url":"https://api.github.com/users/mame82/events{/privacy}","received_events_url":"https://api.github.com/users/mame82/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2017-03-30T17:22:08Z","updated_at":"2017-04-01T09:27:47Z","closed_at":null,"body":"Continue of ongoing discussion from [here](https://github.com/sensepost/USaBUSe/issues/7)"},"comment":{"url":"https://api.github.com/repos/sensepost/USaBUSe/issues/comments/290908545","html_url":"https://github.com/sensepost/USaBUSe/issues/15#issuecomment-290908545","issue_url":"https://api.github.com/repos/sensepost/USaBUSe/issues/15","id":290908545,"user":{"login":"mame82","id":13119970,"avatar_url":"https://avatars0.githubusercontent.com/u/13119970?v=3","gravatar_id":"","url":"https://api.github.com/users/mame82","html_url":"https://github.com/mame82","followers_url":"https://api.github.com/users/mame82/followers","following_url":"https://api.github.com/users/mame82/following{/other_user}","gists_url":"https://api.github.com/users/mame82/gists{/gist_id}","starred_url":"https://api.github.com/users/mame82/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mame82/subscriptions","organizations_url":"https://api.github.com/users/mame82/orgs","repos_url":"https://api.github.com/users/mame82/repos","events_url":"https://api.github.com/users/mame82/events{/privacy}","received_events_url":"https://api.github.com/users/mame82/received_events","type":"User","site_admin":false},"created_at":"2017-04-01T09:27:47Z","updated_at":"2017-04-01T09:27:47Z","body":"Although I should do other things right now, I couldn't stop thinking about your examples. So I tested the following code (only changed PID/VID and added early out to WMI device enumeration):\r\n\r\n```\r\n$M = 64\r\n$cs = '\r\nusing System;\r\nusing System.IO;\r\nusing Microsoft.Win32.SafeHandles;\r\nusing System.Runtime.InteropServices;\r\nnamespace n {\r\n\tpublic class w {\r\n\t\t[DllImport(%kernel32.dll%, CharSet = CharSet.Auto, SetLastError = true)]\r\n\t\tpublic static extern SafeFileHandle CreateFile(String fn, UInt32 da, Int32 sm, IntPtr sa, Int32 cd, uint fa, IntPtr tf);\r\n\r\n\t\tpublic static FileStream o(string fn) {\r\n\t\t\treturn new FileStream(CreateFile(fn, 0XC0000000U, 3, IntPtr.Zero, 3, 0x40000000, IntPtr.Zero), FileAccess.ReadWrite, 9, true);\r\n\t\t}\r\n\t}\r\n}\r\n'.Replace('%',[char]34)\r\nAdd-Type -TypeDefinition $cs\r\n\r\n& {\r\n\t$devs = gwmi Win32_USBControllerDevice\r\n\tforeach ($dev in $devs) {\r\n\t\t$wmidev = [wmi]$dev.Dependent\r\n\t\tif ($wmidev.GetPropertyValue('DeviceID') -match ('1D6B&PID_0137') -and ($wmidev.GetPropertyValue('Service') -eq $null)) {\r\n\t\t\t$fn = ([char]92+[char]92+'?'+[char]92 + $wmidev.GetPropertyValue('DeviceID').ToString().Replace([char]92,[char]35) + [char]35+'{4d1e55b2-f16f-11cf-88cb-001111000030}')\r\n            break # second dev string invalid handle\r\n\t\t}\r\n\t}\r\n\ttry {\r\n\t\t$f = [n.w]::o($fn)\r\n\t\t$d = New-Object IO.MemoryStream\r\n\t\t$c = 0\r\n\t\t$b = New-Object Byte[]($M+1)\r\n\t\t$sw = $null\r\n\t\twhile($c -lt 1024 * 1024) {\r\n            #[Console]::WriteLine(\"$c\")\r\n\t\t\t$r = $f.Read($b, 0, $M+1)\r\n\t\t\tif ($sw -eq $null) { $sw = [Diagnostics.Stopwatch]::StartNew() }\r\n\t\t\t$d.Write($b,1, $M)\r\n\t\t\t$c += $M\r\n\t\t}\r\n\t\t$sw.Stop()\r\n\t\t$sw.Elapsed\r\n\t\t$d.Length\r\n\t\t([Text.Encoding]::ASCII).GetString($d.ToArray())\r\n\t} catch {\r\n\t\techo $_.Exception|format-list -force\r\n\t}\r\n\texit\r\n}\r\n```\r\n\r\nOn my first attempt I thought it wasn't working (thats why I added in the printout of $c). Leaving the Code running for more than a minute, I recognized that my issue isn't PowerShell:\r\n\r\n```\r\nPS D:\\P4wnP1> D:\\P4wnP1\\powershell\\tests\\fastread_usabuse.ps1\r\n\r\n\r\nDays              : 0\r\nHours             : 0\r\nMinutes           : 2\r\nSeconds           : 11\r\nMilliseconds      : 64\r\nTicks             : 1310641048\r\nTotalDays         : 0,00151694565740741\r\nTotalHours        : 0,0364066957777778\r\nTotalMinutes      : 2,18440174666667\r\nTotalSeconds      : 131,0641048\r\nTotalMilliseconds : 131064,1048\r\n\r\n1048576\r\n000000000000000000000000000000000000000000000000000000000000001\r\n000000000000000000000000000000000000000000000000000000000000002\r\n... snip ...\r\n000000000000000000000000000000000000000000000000000000000016381\r\n000000000000000000000000000000000000000000000000000000000016382\r\n000000000000000000000000000000000000000000000000000000000016383\r\n```\r\n\r\nI'm still **stuck at ~7,8 KBytes/s**\r\n\r\nI'm using `usb_f_hid.ko` with `libcomposite.ko` which is needed for the P4wnP1 Features, could it be that you're using `g_hid.ko` ?\r\n\r\n\r\nI don't get it - why is my USB communication too slow :-("}}
{"actor":{"display_login":"mame82"}}