whiskers 0.4.0
RP2350 BadUSB Tool
Loading...
Searching...
No Matches
lua_functions.h
Go to the documentation of this file.
1/* Copyright (c) 2026 Zane A. Maples
2 Licensed under the MIT license. See LICENSE in the main repository for more information. */
3
4/* This is just dummy C-like functions used to describe the higher level C functions. DO NOT include this in anything! */
5
18/* Standard */
19void wlua_sleep(uint32_t ms);
20
29
30/* fops */
54int wlua_ffopen(char *filename, char *access_mods);
61int wlua_ffclose(int fd);
73char * wlua_ffread(int fd, uint32_t len);
87char * wlua_ffgets(int fd, uint32_t len);
101int wlua_ffwrites(int fd, char *in);
109int wlua_ffseek(int fd, long pos);
115int wlua_fftell(int fd);
125int wlua_ffunlink(char *filename);
131int wlua_ffstat(char *filename);
150int wlua_ffmkdir(char *dirname);
163int wlua_ffopendir(char *dirname);
169int wlua_ffclosedir(int dd);
180char * wlua_ffreaddir(int dd);
181
182/* usb */
243int wlua_usb_send_key(char *key, char *mods);
270void wlua_usb_start_custom(char lang_0, char lang_1, char manufacturer_string[32], char product_string[32], char serial_string[32], uint16_t vid, uint16_t pid);
284int wlua_usb_start_pubdisk(uint32_t sector_size, uint32_t sector_count, bool is_writable);
291void wlua_usb_enable_sd_passthrough(bool is_writable);
int wlua_usb_send_key(char *key, char *mods)
Sends a key and modifiers.
int wlua_ffclosedir(int dd)
Closes a directory.
char * wlua_ffread(int fd, uint32_t len)
Reads an arbitrary amount of text upto len bytes from the file.
uint32_t wlua_get_random_seed()
Gets a random 32 bit number to seed lua's random functions.
int wlua_usb_send_ascii_string(char *in)
Send a full ascii string over usb.
void wlua_usb_send_reset_report()
Sends a full NULL keyboard report.
char * wlua_ffreaddir(int dd)
Reads through all files in a directory.
int wlua_ffmkdir(char *dirname)
Creates a new blank directory.
int wlua_ffseek(int fd, long pos)
Sets the file read/write pointer.
int wlua_fftell(int fd)
Gets the current file read/write pointer.
int wlua_ffwrites(int fd, char *in)
Writes a string to a file.
int wlua_ffstat(char *filename)
Checks file size and/or existence.
int wlua_ffunlink(char *filename)
Deletes a file or directory.
void wlua_usb_enable_sd_passthrough(bool is_writable)
Enables direct SD passthrough over USB. Note that this will expose ALL contents, including the payloa...
int wlua_ffopen(char *filename, char *access_mods)
Opens a file from the pathname.
void wlua_usb_start_defaults()
Starts the USB using default values.
int wlua_ffclose(int fd)
Closes a file from a file descriptor.
int wlua_send_file_raw(int fd)
Sends a file's raw ascii contents over USB.
void wlua_usb_start_custom(char lang_0, char lang_1, char manufacturer_string[32], char product_string[32], char serial_string[32], uint16_t vid, uint16_t pid)
Starts the USB using custom values.
int wlua_ffopendir(char *dirname)
Opens a directory for reading it's files.
int wlua_usb_start_pubdisk(uint32_t sector_size, uint32_t sector_count, bool is_writable)
Enables the fake disk to exposed via USB.
char * wlua_ffgets(int fd, uint32_t len)
Reads a string upto len bytes from the file.
void wlua_sleep(uint32_t ms)
Puts the core to sleep for X amount of milliseconds.