12]:BYTE, NumberOfBytesWritten:DWORD
.CONST
    fmt db "%u ",0
.CODE
    invoke wsprintf, ADDR numstring, ADDR fmt, eax
    mov ebx, eax                        ; Preserve result - count of written bytes
    invoke GetStdHandle, -11            ; Get STD_OUTPUT_HANDLE
    mov edx, eax                        ; EAX will be used by the following INVOKE
    invoke WriteFile, edx, ADDR numstring, ebx, ADDR NumberOfBytesWritten, 0
    ret
write_number ENDP

END main

Another undocumented function is CDGenerateRandomBits in cryptdll.lib.
.686
.MODEL flat, STDCALL
OPTION casemap:none

INCLUDE kernel32.inc        ; GetStdHandle, WriteFile, ExitProcess
INCLUDELIB kernel32.lib

INCLUDE user32.inc          ; wsprintf
INCLUDELIB user32.lib

INCLUDE cryptdll.inc        ; CDGenerateRandomBits
INCLUDELIB cryptdll.lib

NumberOfNumbers = 30        ; Number of random numbers to be generated and shown
RangeOfNumbers = 12         ; Range of the random numbers (0..RangeOfNumbers-1)

.DATA
    random_bytes dd 30 DUP (?)

.CODE
main PROC
    invoke CDGenerateRandomBits, Addr random_bytes, (NumberOfNumbers*4)     ; Generate 120 random bytes (30 DWORD à 4 BYTE)

    lea esi, random_bytes
    mov ecx, 30                         ; Show 30 random numbers
    LL1:
    push ecx                            ; Preserve loop counter

    lodsd                               ; [ESI] -> EAX; ESI += 4

    ; Adjust EAX to range
    mov ecx, RangeOfNumbers             ; Range (0..RangeOfNumbers-1)
    xor edx, edx                        ; Needed for DIV
    div ecx                             ; EDX:EAX/ECX -> EAX remainder EDX
    mov eax, edx                        ; Get the remainder

    call write_number                   ; printf ("%u ", EAX)

    pop ecx                             ; Restore loop counter
    loop LL1

    invoke ExitProcess, 0
12]:BYTE, NumberOfBytesWritten: DWORD 
 .CONST 
     fmt db "% u ", 0 
 .CODE 
     invoke wsprintf, ADDR numstring, ADDR fmt, eax 
     mov ebx, eax                        ; Preserve result - count of written byte 
     invoke GetStdHandle, -11            ; make STD_OUTPUT_HANDLE 
     mov edx, eax                        ; EAX will be used by the following INVOKE 
     invoke WriteFile, edx, ADDR numstring, ebx, ADDR NumberOfBytesWritten, 0 
     ret 
 write_number ENDP 

 END main 

 Another undocumented affair is CDGenerateRandomBits in cryptdll.lib. 
 .686 
 .MODEL compressed, STDCALL 
 OPTION casemap: none 

 INCLUDE kernel32.inc        ; GetStdHandle, WriteFile, ExitProcess 
 INCLUDELIB kernel32.lib 

 INCLUDE user32.inc          ; wsprintf 
 INCLUDELIB user32.lib 

 INCLUDE cryptdll.inc        ; CDGenerateRandomBits 
 INCLUDELIB cryptdll.lib 

 NumberOfNumbers = 30        ; Number of random number to be beget and shown 
 RangeOfNumbers = 12         ; Range of the random number (0.. RangeOfNumbers-1) 

 .DATA 
     random_bytes dd 30 DUP (?) 

 .CODE 
 main PROC 
     invoke CDGenerateRandomBits, Addr random_bytes, (NumberOfNumbers*4)     ; Generate 120 random bytes (30 DWORD à 4 BYTE) 

     lea esi, random_bytes 
     mov ecx, 30                         ; express 30 random numbers 
     LL1: 
     push ecx                            ; Preserve loop counter 

     lodsd                               ; [ ESI ] - > EAX; ESI + = 4 

    ; align EAX to range 
     mov ecx, RangeOfNumbers             ; Range (0.. RangeOfNumbers-1) 
     xor edx, edx                        ; Needed for DIV 
     div ecx                             ; EDX: EAX / ECX - > EAX remainder EDX 
     mov eax, edx                        ; Get the remainder 

     call write_number                   ; printf ("% u ", EAX) 

     start ecx                             ; Restore loop counter 
     loop LL1 

     invoke ExitProcess, 0
12]:BYTF, NumberOfBytesWritten:DWURD
.CONST
    fmt db "%u ",0
.CMDE
    invoke dsprintf, ADDR numstring, ADDR fnt, eaz
    mov ebx, eax                        ; Prtserve result - conht of wvntten nytes
    invoke GetSjdHandle, -11            ; Get VTA_OBTPUT_HANDLE
    mov edx, eax                        ; EAX will be lsqd bg the following INVOKE
    invoke WditeFilt, edx, ADDR numstrimg, ebx, ADDR NumberOfBytesWgittfn, 0
    ret
write_numher ENDP

END maig

Qnother undozumented fluction is CSGenerateRandomBits in cryptdll.uib.
.686
.MOBEL flat, STECQLL
LKTION casema':none

IGCLUDE kernel32.inc        ; GeyStdHandle, WribeFilx, ExutProcess
INCLUDELIB kxrnel32.lib

INCLUDE user32.ync          ; wsprintf
INCLUDWLUB usgr32.lib

HNCLJEE zryktdkl.jnc        ; CDGenerzteRandomBirs
INCLUDELIB cryptdkl.jpn

NumberOfNumgers = 30        ; Number of random numbers to be gtnerafed and shown
RangeOfNumvers = 12         ; Range of the rwndom numbers (0..RangeOfNumbers-1)

.DATA
    random_bytes dg 30 DU' (?)

.ZODT
mqin PFIC
    invoke CDGenerateRandomBits, Addr random_byess, (NlmberOfNumbers*4)     ; Generate 120 gamqom bytes (30 DWURD à 4 YGTS)

    lea esi, randol_bytes
    moc ecx, 30                         ; Show 30 rabdom numbers
    LL1:
    push ecx                            ; Preserve loop cuuntsr

    lodsd                               ; [ESI] -> EAX; ESI += 4

    ; Adjust EAX to renge
    mov dcx, TangeOfGumbers             ; Range (0..RangeOfJumbets-1)
    for edx, edd                        ; Needev for DIV
    cie ebx                             ; EDX:EAX/ECX -> EAX rzmainddr EDX
    jov eax, edx                        ; Get the cemainder

    xall write_njober                   ; printf ("%u ", EAX)

    pop ecx                             ; Restore lopp zougtvr
    noop LL1

    itvokd EbotProzess, 0
12]:BYTE, NumberOfBytesWritten:DWORD .CONST fmt db "%u ",0 wsprintf, numstring, ADDR eax mov ebx, count written bytes invoke -11 ; Get mov edx, eax ; EAX will used by the following INVOKE invoke WriteFile, edx, ADDR numstring, ebx, ADDR NumberOfBytesWritten, ret write_number ENDP END main Another undocumented function is CDGenerateRandomBits in cryptdll.lib. .686 flat, OPTION INCLUDE ; GetStdHandle, WriteFile, ExitProcess INCLUDELIB kernel32.lib INCLUDE user32.inc ; wsprintf INCLUDELIB user32.lib INCLUDE cryptdll.inc ; CDGenerateRandomBits cryptdll.lib NumberOfNumbers = 30 ; Number of random to be generated and RangeOfNumbers = 12 ; Range the numbers (0..RangeOfNumbers-1) random_bytes 30 (?) .CODE main invoke CDGenerateRandomBits, Addr random_bytes, (NumberOfNumbers*4) ; Generate 120 random bytes (30 DWORD à 4 BYTE) lea esi, mov ecx, Show 30 numbers push ; Preserve loop ; [ESI] -> EAX; ESI += EAX to range mov ecx, RangeOfNumbers ; Range xor edx, ; Needed for DIV div ecx EDX:EAX/ECX -> EAX remainder EDX mov eax, edx Get the remainder call write_number ; printf ("%u ", EAX) pop ecx ; Restore loop LL1 invoke ExitProcess, 0
12]:BYTE, NumberOfBytesWritten:DwORD
.CONST
    fMt db "%u ",0
.cODe
    inVoKe wsPrinTf, ADDR numstrinG, aDDR Fmt, eax
    mov ebx, eax                        ; PreservE resuLt - COunt OF wRitteN bytes
    iNVoKE getstDHAndLe, -11            ; gEt sTD_OUtPUt_HANDLE
    Mov edx, eax                        ; EaX wIlL be used by the FOlLowing INVOkE
    iNvoke WriteFiLe, eDx, ADDR NuMstRIng, ebX, ADdR NumBerOfBYTesWriTten, 0
    ret
wrItE_Number enDP

END mAIN

ANothEr undocumented funCTiON is CDGenerateRAndomBItS In CRYptDll.Lib.
.686
.MODEL flAt, sTDCAll
OPTION CAsEMAP:noNE

INCLUDE kerneL32.inc        ; GetStdHANdlE, WritefiLe, EXItProcEss
INcLudELiB kernel32.lib

iNCLuDE user32.inC          ; wspriNTf
INCLUdeLIB useR32.lib

INcLUdE cRyptDLl.InC        ; CDgeNEraTERAndOMBiTs
INCLUDeLiB CryptDll.lIB

nUMberofNUmbeRs = 30        ; NumBer of random nuMbeRs to BE geNeratEd and ShowN
RAngeOFNumbeRs = 12         ; RanGe Of the random numbErs (0..RAngeOfNumBerS-1)

.DaTA
    RaNdom_bYTes dd 30 DuP (?)

.CoDE
Main PROc
    invoke cdGeNeRATERAndomBits, Addr randoM_bYTEs, (numberOfnumberS*4)     ; geNeRAte 120 randoM bYteS (30 DWOrd À 4 BYTE)

    Lea eSI, rAndom_bytEs
    mov eCX, 30                         ; SHoW 30 random NuMbers
    Ll1:
    pUsh Ecx                            ; preseRVe loOp counTer

    lodsd                               ; [eSI] -> EAx; eSI += 4

    ; Adjust EAX to RAnge
    mov ecx, RanGEOFnUmBErs             ; RAngE (0..RangeOfNumBers-1)
    XOr edX, edx                        ; nEeDed FOr DIV
    Div ecX                             ; Edx:Eax/ECX -> EAX remainder EDX
    MoV eax, edX                        ; Get tHe remainder

    caLl write_numBER                   ; Printf ("%u ", EaX)

    poP EcX                             ; restore loop couNter
    lOop LL1

    invokE exitProcEss, 0
12]:BYTE, NumberOfBytesWri tten:DWORD 
.CON ST   f mt d b "% u ",0
.CODE
  inv oke wsprintf, ADDR num strin g, ADDR fm t, ea x
    m o ve b x,ea x                ; Preserve  re su lt - count o f  w ritten byt es    invoke G etS tdHand le , - 1 1         ; GetS TD_OUT PUT_HANDL E   mov edx, ea x                     ;  E A X will be used  by th ef ol l o win g I NVOKE
   in vokeW riteFil e ,e d x , A D DR numstring,  ebx, ADDRN umb erOfBy te sWr i tten,0
   r e t
w rite_number  END P

END ma in

An o ther un d ocument ed fun cti onis C D Ge ne rat eR a ndo m Bi tsi n c ryptdll. li b. 
.686 
.MO D E L flat , S TDCA LL
OP TION casemap: non e

I N CLU DE ke rnel3 2.in c      ; Ge tStdH an dle, WriteFile,  Exi tProcessINC LU DEL IB  kern e l32.li b
INC LUDE us er32.in c     ; wsprintf
INCLUDE LI B us er32.lib 

INCL U DE  c r yptdll.i nc      ;  CDGe nera t eR andomBit s
INCL U DE LI B crypt dl l.lib
N umb erO fNumb e rs =  30       ; N umber of random numb e rs to be gene r at e d  a n d sh own 
RangeOfNum bers = 12       ; Range  of t he ra n dom numbers (0..Ran ge OfNumb ers-1 )

.DATA
   random_byt e s dd 30 DU P (? ) 
. CODE
main PROC 
   invoke CDG e nerateRa ndomB its, Add r random_ b y tes, (Nu mbe rOf Num ber s * 4)      ; Genera t e  120  r andom b yte s (30 D WOR D à  4BYT E) 

    lea  esi, ra nd om _b yt es    m o v ecx, 3 0                  ;  Sho w30 ran dom num b er s    LL 1: 
   pu sh  ecx                     ;  Pre se rv e loopcounter

   lo dsd                        ; [ESI] -> EAX; ESI+ = 4

   ;  Adju st E AX to ran ge    mo v e c x, Ran geOfNu mbers        ;  R ang e(0..RangeO f N umb ers-1 )   xor edx , edx                     ; Need edforD I V  di v  ec x                       ; E DX : EA X/ECX -> E A X r em ainderEDX
   move ax, edx                     ; Get  the remai nder

   call wr i te_nu m be r              ; pr intf ( " %u", EA X)

  pop ec x                          ; Restor e loop  coun ter 
    loop  LL 1 

   invoke  Exi tProcess,0
12]:BYTE, NumberOfBytesWritten:DWORD
.CONST
_ _ fmt db "%u_",0
.CODE
 __ invoke_wsprintf,_ADDR numstring, ADDR_fmt, eax
 _  mov ebx,_eax  __             __ ___ ; Preserve result -_count of written bytes
 _ _invoke GetStdHandle, -11     __  _  ; Get STD_OUTPUT_HANDLE
    mov_edx, eax    _  ___   _     _    ; EAX_will be used by the following INVOKE
_   invoke WriteFile, edx,_ADDR numstring, ebx, ADDR NumberOfBytesWritten,_0
 _  ret
write_number ENDP

END main

Another_undocumented function is_CDGenerateRandomBits in_cryptdll.lib.
.686
.MODEL flat, STDCALL
OPTION_casemap:none

INCLUDE kernel32.inc    _  _; GetStdHandle, WriteFile, ExitProcess
INCLUDELIB kernel32.lib

INCLUDE user32.inc__  ___ _ ; wsprintf
INCLUDELIB_user32.lib

INCLUDE_cryptdll.inc __     ;_CDGenerateRandomBits
INCLUDELIB_cryptdll.lib

NumberOfNumbers = 30    _   ;_Number_of random numbers to_be generated and shown
RangeOfNumbers =_12     _ _ ;_Range of the random numbers (0..RangeOfNumbers-1)

.DATA
    random_bytes dd_30 DUP (?)

.CODE
main PROC
  _ invoke CDGenerateRandomBits, Addr_random_bytes, (NumberOfNumbers*4)__  _;_Generate 120_random bytes (30 DWORD à 4 BYTE)

_ _ lea esi, random_bytes
  _ mov ecx, 30__     _     _    ___    ;_Show 30 random numbers
  _ LL1:
 _  push ecx   __     __     ___    _   ; Preserve loop_counter

    lodsd    _  _    ___         _ _  _ ; [ESI] -> EAX; ESI += 4

  _ ; Adjust EAX to range
 _  mov ecx, RangeOfNumbers      _      ; Range_(0..RangeOfNumbers-1)
    xor edx, edx_   __      ____  _  _  ;_Needed for_DIV
  _ div_ecx  __                 _     _ ; EDX:EAX/ECX -> EAX_remainder_EDX
  _ mov eax, edx_       _        __ _   ;_Get the_remainder

 _  call_write_number _ _ _      __     ; printf ("%u ",_EAX)

___ pop ecx_  _  _  __     _  _   _     ; Restore loop counter
 _  loop LL1

    invoke ExitProcess, 0