Function at 0x401080
Capabilities:
Resolve function by parsing pe exports

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x50
push ebx
push esi
push str.test_1:_opening_beep_n
call fcn.00401010
add esp, 4
lea eax, [esp + 0x30]
push str.DeviceBeep
push eax
call dword [sym.imp.ntdll.dll_RtlInitString]
push 1
lea eax, [esp + 0x34]
push eax
lea eax, [esp + 0x30]
push eax
call dword [sym.imp.ntdll.dll_RtlAnsiStringToUnicodeString]
test eax, eax
je 0x4010d4
push eax
push str.test_1:_Wrong_return_value__X___RtlAnsiStringToUnicodeString_n
call fcn.00401010
add esp, 8
xor al, al
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push 0
push 0
push 0x10
push 3
push 0
push 0
lea eax, [esp + 0x40]
mov dword [esp + 0x58], 0x18
mov dword [esp + 0x60], eax
lea eax, [esp + 0x30]
push 0
push eax
lea eax, [esp + 0x60]
mov dword [esp + 0x64], 0
push eax
push 0x100003
lea eax, [esp + 0x34]
mov dword [esp + 0x74], 0
push eax
mov dword [esp + 0x7c], 0
mov dword [esp + 0x80], 0
call dword [sym.imp.ntdll.dll_NtCreateFile]
mov esi, eax
lea eax, [esp + 0x28]
push eax
call dword [sym.imp.ntdll.dll_RtlFreeUnicodeString]
test esi, esi
je 0x401156
push esi
push str.test_1:_Wrong_return_value__X___beep_open__n
call fcn.00401010
add esp, 8
xor al, al
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [esp + 0x18]
test eax, eax
je 0x401174
push eax
push str.test_2:_Wrong_I_O_Status_value__X___beep_open__n
call fcn.00401010
add esp, 8
xor al, al
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x401192
push eax
push str.test_1:_Wrong_I_O_Status_information_value__ld___beep_open__n
call fcn.00401010
add esp, 8
xor al, al
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push str.test_1:_opened_beep_device_successfully_n
call fcn.00401010
add esp, 4
push str.test_1:_calling_beep_device_with_varying_frequencies_n
call fcn.00401010
mov esi, dword [sym.imp.ntdll.dll_NtDeviceIoControlFile]
mov eax, 0x12
mov ebx, dword [sym.imp.ntdll.dll_NtDelayExecution]
add esp, 4
mov dword [esp + 0x14], 0x3e8
mov dword [esp + 0x10], eax
nop dword [eax]
push eax
push str.test_1:_Set_beep_frequency__ld_n
call fcn.00401010
add esp, 8
lea eax, [esp + 0x10]
push 0
push 0
push 8
push eax
push 0x10000
lea eax, [esp + 0x2c]
push eax
push 0
push 0
push 0
push dword [esp + 0x30]
call esi
test eax, eax
je 0x40120b
push eax
push str.test_1:_Wrong_return_value__lX___beep_set_n
jmp 0x401219
mov eax, dword [esp + 0x18]
test eax, eax
je 0x401221
push eax
push str.test_1:_Wrong_I_O_Status_value__lX___beep_set_n
call fcn.00401010
add esp, 8
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x401237
push eax
push str.test_1:_Wrong_I_O_Status_information_value__ld___beep_set_n
call fcn.00401010
add esp, 8
mov eax, dword [esp + 0x14]
test eax, eax
je 0x40124b
imul eax, eax, 0xffffd8f0
mov dword [esp + 0x20], eax
jmp 0x401253
mov dword [esp + 0x20], 0xfffe7960
lea eax, [esp + 0x20]
mov dword [esp + 0x24], 0xffffffff
push eax
push 0
call ebx
mov eax, dword [esp + 0x10]
add eax, 0x64
mov dword [esp + 0x10], eax
cmp eax, 0x2710
jbe 0x4011d0
push 0x419ae0
call fcn.00401010
add esp, 4
push str.test_1:_calling_beep_device_with_varying_durations_n
call fcn.00401010
add esp, 4
mov dword [esp + 0x10], 0x258
xor eax, eax
mov dword [esp + 0x14], eax
push eax
push str.test_1:_Set_beep_duration__ld_n
call fcn.00401010
add esp, 8
lea eax, [esp + 0x10]
push 0
push 0
push 8
push eax
push 0x10000
lea eax, [esp + 0x2c]
push eax
push 0
push 0
push 0
push dword [esp + 0x30]
call esi
test eax, eax
je 0x4012dd
push eax
push str.test_1:_Wrong_return_value__lX___beep_set_n
jmp 0x4012eb
mov eax, dword [esp + 0x18]
test eax, eax
je 0x4012f3
push eax
push str.test_1:_Wrong_I_O_Status_value__lX___beep_set_n
call fcn.00401010
add esp, 8
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x401309
push eax
push str.test_1:_Wrong_I_O_Status_information_value__ld___beep_set_n
call fcn.00401010
add esp, 8
mov eax, dword [esp + 0x14]
test eax, eax
je 0x40131d
imul eax, eax, 0xffffd8f0
mov dword [esp + 0x20], eax
jmp 0x401325
mov dword [esp + 0x20], 0xfffe7960
lea eax, [esp + 0x20]
mov dword [esp + 0x24], 0xffffffff
push eax
push 0
call ebx
mov eax, dword [esp + 0x14]
add eax, 0x64
mov dword [esp + 0x14], eax
cmp eax, 0xfa0
jbe 0x4012a2
push 0x419ae0
call fcn.00401010
add esp, 4
push str.__________________testing_cancellation._n
call fcn.00401010
add esp, 4
push dword [esp + 0xc]
call dword [sym.imp.ntdll.dll_NtClose]
test eax, eax
je 0x40138a
push eax
push str.test_1:_Wrong_return_value__lX___beep_close__n
call fcn.00401010
add esp, 8
xor al, al
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push str.DeviceBeep
lea eax, [esp + 0x34]
push eax
call dword [sym.imp.ntdll.dll_RtlInitString]
push 1
lea eax, [esp + 0x34]
push eax
lea eax, [esp + 0x30]
push eax
call dword [sym.imp.ntdll.dll_RtlAnsiStringToUnicodeString]
test eax, eax
jne 0x4010be
push 0
push 0
push 0
push 3
push 0
mov dword [esp + 0x58], eax
mov dword [esp + 0x60], eax
lea eax, [esp + 0x3c]
push 0
mov dword [esp + 0x60], eax
lea eax, [esp + 0x30]
push 0
push eax
lea eax, [esp + 0x60]
mov dword [esp + 0x60], 0x18
push eax
push 3
lea eax, [esp + 0x34]
mov dword [esp + 0x78], 0
push eax
mov dword [esp + 0x80], 0
call dword [sym.imp.ntdll.dll_NtCreateFile]
mov esi, eax
lea eax, [esp + 0x28]
push eax
call dword [sym.imp.ntdll.dll_RtlFreeUnicodeString]
test esi, esi
je 0x40142b
push esi
push str.test_1:_Wrong_return_value__X___beep_asynch_reopen_n
call fcn.00401010
add esp, 8
xor al, al
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push str.test_1:_successfully_reopened_beep_device_for_asynch_access_n
call fcn.00401010
add esp, 4
mov dword [esp + 0x10], 0x258
lea eax, [esp + 0x10]
mov dword [esp + 0x14], 0xea60
push 0
push 0
push 8
push eax
push 0x10000
lea eax, [esp + 0x2c]
push eax
push 0
push 0x401520
push 0
push dword [esp + 0x30]
call dword [sym.imp.ntdll.dll_NtDeviceIoControlFile]
cmp eax, 0x103
je 0x401485
push eax
push str.test_1:_Wrong_return_value__lX___beep_set_asynch_n
call fcn.00401010
add esp, 8
lea eax, [esp + 0x38]
push eax
push dword [esp + 0x10]
call dword [sym.imp.ntdll.dll_NtCancelIoFile]
test eax, eax
je 0x4014ae
push eax
push str.test_1:_Wrong_return_value__lX___beep_cancel_n
call fcn.00401010
add esp, 8
xor al, al
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [esp + 0x38]
test eax, eax
je 0x4014c4
push eax
push str.test_1:_Wrong_I_O_Status_value__lX___beep_cancel__n
call fcn.00401010
add esp, 8
push str.Successfully_cancelled_a_request._n
call fcn.00401010
add esp, 4
mov dword [esp + 0x24], 0xffffffff
lea eax, [esp + 0x20]
mov dword [esp + 0x20], 0xfffe7960
push eax
push 1
call ebx
push str.test_1:__closing_beep_device_n
call fcn.00401010
add esp, 4
push dword [esp + 0xc]
call dword [sym.imp.ntdll.dll_NtClose]
test eax, eax
jne 0x401374
pop esi
mov al, 1
pop ebx
mov esp, ebp
pop ebp
ret