#StackBounty: #windows #c++ Kite alternative for c++

Bounty: 50

Kite is a cloud-powered copilot that boosts your programming
environment.

It shows:

  1. Smart completions
  2. Popular patterns
  3. Code examples
  4. Documentation

But unfortunately, it is available only for python.

Is there any such extension for Visual Studio Code that supports C++ ?

I am mainly interested in seeing the Documentation of a function when I hover on it.

Thanks and regards.


Get this bounty!!!

#StackBounty: #c #ruby #windows #winapi #fiddle How to use Fiddle with Windows API (dll) to run a shellcode in Ruby

Bounty: 50

I’m trying to use ruby Fiddle standard library to Windows APIs to run a shellcode

The idea of the code is to

  1. having a hexdicemial shellcode raw that executes anything (eg. MessageBoxA)
  2. call kernel32.dll
  3. allocate a memory for this shellcode. VirtualAlloc
  4. create a buffer for this shellcode
  5. move the shellcode to that allocation. RtlMoveMemory
  6. create a new thread to execute that shellcode. CreateThread
  7. wait for the execution/thread to end. WaitForSingleObject

here is the code:

require 'fiddle'
require 'fiddle/import'
require 'fiddle/types'

shellcode = # MessageBoxA
"x31xd2xb2x30x64x8bx12x8bx52x0cx8bx52x1cx8bx42" +  
"x08x8bx72x20x8bx12x80x7ex0cx33x75xf2x89xc7x03" + 
"x78x3cx8bx57x78x01xc2x8bx7ax20x01xc7x31xedx8b" + 
"x34xafx01xc6x45x81x3ex46x61x74x61x75xf2x81x7e" + 
"x08x45x78x69x74x75xe9x8bx7ax24x01xc7x66x8bx2c" + 
"x6fx8bx7ax1cx01xc7x8bx7cxafxfcx01xc7x68x79x74" + 
"x65x01x68x6bx65x6ex42x68x20x42x72x6fx89xe1xfe" + 
"x49x0bx31xc0x51x50xffxd7"


kernel32 = Fiddle.dlopen('kernel32')

puts "[-] VirtualAlloc"
ptr = Function.new(kernel32['VirtualAlloc'], [4,4,4,4], 4).call(0, (shellcode.size), 0x3000, 0x40)
Function.new(kernel32['VirtualProtect'], [4,4,4,4], 4).call(ptr, shellcode.size, 0, 0)

puts "[-] Create buffer"
buf = Fiddle::Pointer[shellcode]

puts "[-] RtlMoveMemory"
Function.new(kernel32['RtlMoveMemory'], [4, 4, 4], 4).call(ptr], buf, shellcode.size)

puts "[-] CreateThread"
# thread = Function.new(kernel32['CreateThread'], [4, 4, 4, 4, 4, -4], 4).call(0, 0, ptr, 0, 0, 0)
thread = Function.new(kernel32['CreateThread'], [4,4,4,4,4,4], 4).call(Fiddle::NULL, 0, ptr, 0, 0, 0)

pp Function.new(kernel32['WaitForSingleObject'], [4,4], 4).call(thread, -1)

The problem is the MessageBoxA never get executed, when I try to something like a bind shell, the TCP connection starts successfully when I connect but I can’t execute commands and it ends once I send anything twice like pressing enter twice.

I checked the buffer buf size and contents buf.size, buf.to_str and it’s accurate.

I’ve executed a python version of this and it works. Am I missing something here?

Thanks!

Note: I don’t want to call the MessageBoxA API directly I need to execute it from the shellcode.

References


Get this bounty!!!

#StackBounty: #windows #graphs Draw simple 3D graphs and shapes in vector format

Bounty: 50

As an example, I want to produce the figure below. I drew this figure painfully in Powerpoint and want to find a better/more efficient way of doing this. Unfortunately, Powerpoint is the best solution I’ve found so far. (By the way this here is merely a rasterized screenshot of the vector image in PDF.)

This is for high-school 3D geometry and all I need to draw are simple and clear points, lines, planes, vectors.

enter image description here

Essential requirements:

  1. Vector format – PDF preferred, but any format that can be converted to PDF with full vector format preserved is good as well (SVG, AI, etc.)
  2. Easy to use. For example, Geogebra is easy to use — I can just quickly enter “Plane: x=1”, “Point: (1,0,0)”, “Point: (1,1,1)”, and “Point: (1,3,1)” and they’ll be plotted.
  3. Colors and size/thickness of points, lines, and planes are customizable, like in Powerpoint/Illustrator.

Nice to have:

  1. The labels are customizable (but if not, no big deal because I can always edit them into the PDF).
  2. Free.
  3. Lightweight.

Some of the programs I’ve tried so far are GNU Octave, Mathmod, Geogebra, Mathematica, Matlab, Microsoft Math, but none have been any better/quicker than simply drawing figures “by hand” in Powerpoint (or Illustrator or Inkscape).

(Though it is very possible that I’ve just been stupid and couldn’t figure out how to use those. If someone could show me how I could, for example, produce the above figure easily in any of the aforementioned programs, I’d be very grateful too.)

If it matters, I use Windows 10.


Get this bounty!!!

#StackBounty: #windows #ocr #scanning ADF Scan, Upload to Web application

Bounty: 50

I search software to scan from ADF (Automatic Document Feeder) scanner and uploads to a web application.

Required features:

  • Scans from ADF and flatbed
  • Supports most ADF scanner hardware
  • Runs on MS-Windows
  • Creates PDF
  • Uploads PDF to web form. Further editing via web form
  • Optional: full text OCR, creating annotated PDFs
  • Yearly licence should not cost more than 200$
  • Daily usage should not need internet connection
  • Free demo version should be available.

The web application which receives the PDFs can be adapted easily.


Get this bounty!!!

#StackBounty: #windows #ocr #scanning ADF Scan, Upload to Web Form

Bounty: 50

I search software to scan from ADF scanner and uploads to a web application.

Required Features:

  • Scans from ADF and flatbed
  • Supports most ADF scanner hardware
  • runs on MS-Windows
  • Creates PDF
  • Uploads PDF to web form. Further editing via web form
  • optional: full text OCR, creating annotated PDFs
  • Yearly licence should not cost more than 200$
  • daily usage should not need internet connection
  • free demo version should be available.

The web application which receives the PDFs can be adapted easily.


Get this bounty!!!

#StackBounty: #windows #gdb #mingw #gdbinit Where to put .gdbini in Windows?

Bounty: 50

And should it be called .gdbini or gdb.ini?

I thought that I would try this file.

I am testing with Vectorcast, which uses MinGw. I copied the file with both names (.gdbini and gdb.ini) to both the Vectorcast directory and it’s MinGW bin directory, where gdb.exe is, as I was unsure which is the current working directory, but don’t see anything which I would expect from that file.

So, where should I put it, and what should I call it?


Get this bounty!!!

#StackBounty: #windows #networking #routing Windows Server 2012 – two NICs, wrong one selected

Bounty: 50

I have a server with two NICs, as follows.

  • One has IP address 192.168.0.47/24. This network has no router / gateway / etc.
  • One has IP address 172.16.92.45, and is bridged to a tap adapter for OpenVPN.

I’m trying to communicate with a device at 192.168.0.204, and failing. Wireshark confirms that attempts to ping 192.168.0.204 go via the interface 172.16.92.45, not 192.168.0.47, which surprises me. tracert confirms that the pings go to the default gateway, 172.16.92.12, never to be seen again.

ipconfig says:

Windows IP Configuration


Ethernet adapter Ethernet:

Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix  . : 

Ethernet adapter Embedded LOM 1 Port 2:

Connection-specific DNS Suffix  . : 
Link-local IPv6 Address . . . . . : fe80::b40f:8c41:a781:a89b%12
IPv4 Address. . . . . . . . . . . : 192.168.0.47
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 

Ethernet adapter Network Bridge:

Connection-specific DNS Suffix  . : 
Link-local IPv6 Address . . . . . : fe80::4d2:2673:7ff4:8676%18
IPv4 Address. . . . . . . . . . . : 172.16.92.45
Subnet Mask . . . . . . . . . . . : 255.255.0.0
Default Gateway . . . . . . . . . : 172.16.92.12

Tunnel adapter isatap.{B63DCFB1-4179-45E6-9268-299D4526831A}:

Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix  . : 

Tunnel adapter isatap.{78520E8A-472A-4BBD-9440-7BF50D172859}:

Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix  . : 

The routing table is:

===========================================================================
Interface List
 19...00 ff 4d 58 89 8e ......TAP-Windows Adapter V9 #2
 12...98 f2 b3 8f bb e5 ......HPE Ethernet 1Gb 2-port 332i Adapter #2
 18...00 ff f8 2b 19 b1 ......Microsoft Network Adapter Multiplexor Driver
  1...........................Software Loopback Interface 1
 14...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter #2
 15...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter #4
===========================================================================

IPv4 Route Table
===========================================================================
Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0          0.0.0.0     172.16.92.12     172.16.92.45    266
        127.0.0.0        255.0.0.0         On-link         127.0.0.1    306
        127.0.0.1  255.255.255.255         On-link         127.0.0.1    306
  127.255.255.255  255.255.255.255         On-link         127.0.0.1    306
       172.16.0.0      255.255.0.0         On-link      172.16.92.45    266
     172.16.92.45  255.255.255.255         On-link      172.16.92.45    266
   172.16.255.255  255.255.255.255         On-link      172.16.92.45    266
      192.168.0.0    255.255.255.0         On-link      192.168.0.47    276
     192.168.0.47  255.255.255.255         On-link      192.168.0.47    276
    192.168.0.255  255.255.255.255         On-link      192.168.0.47    276
        224.0.0.0        240.0.0.0         On-link         127.0.0.1    306
        224.0.0.0        240.0.0.0         On-link      172.16.92.45    266
        224.0.0.0        240.0.0.0         On-link      192.168.0.47    276
  255.255.255.255  255.255.255.255         On-link         127.0.0.1    306
  255.255.255.255  255.255.255.255         On-link      172.16.92.45    266
  255.255.255.255  255.255.255.255         On-link      192.168.0.47    276
===========================================================================
Persistent Routes:
  Network Address          Netmask  Gateway Address  Metric
          0.0.0.0          0.0.0.0     172.16.92.12  Default 
          0.0.0.0          0.0.0.0     172.16.92.12  Default 
===========================================================================

IPv6 Route Table
===========================================================================
Active Routes:
 If Metric Network Destination      Gateway
  1    306 ::1/128                  On-link
 18    266 fe80::/64                On-link
 12    276 fe80::/64                On-link
 18    266 fe80::4d2:2673:7ff4:8676/128
                                    On-link
 12    276 fe80::b40f:8c41:a781:a89b/128
                                    On-link
  1    306 ff00::/8                 On-link
 18    266 ff00::/8                 On-link
 12    276 ff00::/8                 On-link
===========================================================================
Persistent Routes:
  None

I would’ve thought the route to 192.168.0.0 / 255.255.255.0 having interface 192.168.0.47 would’ve meant 192.168.0.47 got used to ping 192.168.0.204, but apparently not.

If it makes any difference, the two NICs actually connect to the same physical LAN (different switches, but connected). I’m using the two IP address ranges because I’m working remotely, and trying to communicate with a device on the LAN that has its factory default IP (192.168.0.200). The plan was to change the IP address of the secondary port to 192.168.0.47 (done), access and configure the device at 192.168.0.200 (failing), including change its IP address to something in the 172.16.0.0 network. The approach has worked a treat with other devices in the past on this same LAN. But not today.

Can anyone shed some light on this?


Get this bounty!!!

#StackBounty: #windows Make modal windows/dialog boxes open over parent application

Bounty: 50

I am using a 40″ 4K TV as a computer monitor. So I frequently have multiple applications open on different parts of the screen. I often move windows around, but it seems that Windows or Windows apps is/are designed to remember the absolute location on a screen where a modal window last was. The result is that dialog boxes and other sub-windows of applications are frequently popping up on the other side of the screen from where the application window actually is.

If things were better designed I would expect modal windows to remember their position relative to their parent window. That would make things less disorienting. I forget how it works on multiple monitors. Do modals at least pop-up on the same monitor as the app that spawns them?

Anyway, I am wondering if there is any possible way to force the behaviour I am looking for. Even a hotkey solution would be better than nothing. I was thinking of making an Autohotkey script to send Alt, Space, M, Any Arrow Key, which would then at least attach the window to the mouse so it could quickly be repositioned. But that only works for certain windows like Open and Save dialogs.


Get this bounty!!!

#StackBounty: #windows #ubuntu #subst #fstab How to mount a substed drive in windows Ubuntu subsystem

Bounty: 100

My development environment on Windows includes substed folders, i.e. the folder c:MyBuild may be substed to a drive letter, say t:

In a Ubuntu subsystem terminal, I can bind the folder to a mount, as this

sudo mount --bind  /mnt/c/MyBuild /mnt/t

This works fine in the current shell, but its not persistent, and if a bash script is invoked externally, this mount is not present, and so the script may fail saying, folder/mnt/t/someFolder don’t exist..

I did add the following to /etc/fstab, but its not working as expected

 /mnt/t /mnt/c/MyBuild none defaults,bind 0 0

How can I make this mount persistent in Windows Ubuntu subsystem?


Get this bounty!!!