Function at 0x401000
Capabilities:
Check for time delay via queryperformancecounter
Create process on windows
Set current directory

Disassembly:
sub esp, 0x230
push ebx
push ebp
push esi
mov esi, dword [esp + 0x240]
push edi
push 0x61264
mov dword [0x41217c], esi
call fcn.00408cc0
add eax, 0x58
xor ebp, ebp
add esp, 4
mov dword [0x4121dc], eax
mov dword [0x41f6ac], ebp
mov dword [0x411ba4], ebp
mov dword [0x412260], ebp
call fcn.00408760
mov ecx, dword [esp + 0x24c]
mov bl, byte [ecx]
test bl, bl
je 0x40111a
mov eax, dword [0x41f69c]
mov edi, 0x305
inc eax
mov dword [esp + 0x10], eax
cdq
idiv edi
test edx, edx
jne 0x40111a
cmp byte [esp + 0x10], 0xbd
jne 0x40111a
cmp byte [ecx + 3], 0x20
jne 0x4010e6
cmp bl, 0x30
jl 0x4010e6
cmp bl, 0x39
jg 0x4010e6
mov al, byte [ecx + 1]
cmp al, 0x30
jl 0x4010e6
cmp al, 0x39
jg 0x4010e6
mov al, byte [ecx + 2]
cmp al, 0x30
jl 0x4010e6
cmp al, 0x39
jg 0x4010e6
movsx eax, bl
sub eax, 0x30
lea eax, [eax + eax*4]
lea edx, [eax + eax*4]
shl edx, 2
mov dword [0x411b30], edx
movsx eax, byte [ecx + 1]
sub eax, 0x30
add ecx, 4
lea eax, [eax + eax*4]
lea edx, [edx + eax*2]
mov dword [0x411b30], edx
movsx eax, byte [ecx - 2]
mov dword [0x411bb0], 1
lea edx, [edx + eax - 0x30]
mov dword [0x411b30], edx
jmp 0x4010ec
mov dword [0x411bb0], ebp
push ecx
call fcn.00406010
add esp, 4
test eax, eax
jne 0x401129
push ebp
push str.Critical_error
push str.Invalid_Cave_block_
push ebp
call dword [sym.imp.USER32.dll_MessageBoxA]
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x230
ret 0x10
push ebp
call fcn.00406010
add esp, 4
mov dword [0x411bb0], ebp
mov ecx, dword [0x41f69c]
mov edi, 0x305
inc ecx
mov eax, ecx
cdq
idiv edi
test edx, edx
jne 0x401143
cmp cl, 0xbd
je 0x40114d
mov dword [0x4123a0], 0x14
push esi
call fcn.004015a0
add esp, 4
test eax, eax
jne 0x40117b
push ebp
push str.Critical_error
push str.Couldnt_create_main_window_
push ebp
call dword [sym.imp.USER32.dll_MessageBoxA]
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x230
ret 0x10
mov dword [0x4121cc], ebp
mov dword [0x412184], ebp
call fcn.00407dd0
test eax, eax
mov edi, 1
jne 0x4011b3
mov dword [0x4121b8], edi
mov dword [0x4121bc], ebp
mov dword [0x4121c0], ebp
mov dword [0x4121c4], ebp
mov dword [0x4121c8], ebp
mov eax, dword [0x4121b8]
mov esi, dword [sym.imp.USER32.dll_MessageBoxA]
cmp eax, edi
jne 0x401209
mov dword [0x412268], ebp
call fcn.00406240
test eax, eax
je 0x4011ee
call fcn.00406320
test eax, eax
je 0x4011ee
call fcn.00406690
cmp dword [0x411bb0], ebp
jne 0x40120f
call fcn.00408900
jmp 0x40120f
mov eax, dword [0x411ba0]
push ebp
push str.Warning_
push str.Unable_to_initialize_DirectSound
push eax
mov dword [0x412268], edi
call esi
jmp 0x40120f
mov dword [0x412268], edi
call fcn.00408aa0
push 0x10
push 0x1e0
push 0x280
push 0x11
call fcn.004067d0
add esp, 0x10
test eax, eax
je 0x401575
call fcn.00406960
test eax, eax
je 0x401575
push ebp
push ebp
push 0x411b6c
call fcn.00406dc0
add esp, 0xc
test eax, eax
je 0x401575
push ebp
push ebp
push 0x411b58
call fcn.00406dc0
add esp, 0xc
test eax, eax
je 0x401575
push ebp
push ebp
push 0x411b70
call fcn.00406dc0
add esp, 0xc
test eax, eax
je 0x401575
lea ecx, [esp + 0x20]
lea edx, [esp + 0x40]
push ecx
push edx
push 0x200
push ebp
push str.digjim.exe
push ebp
call dword [sym.imp.KERNEL32.dll_SearchPathA]
mov ecx, dword [str.caves_]
mov eax, dword [esp + 0x20]
mov dword [eax], ecx
mov dx, word [0x40f1d8]
mov word [eax + 4], dx
mov cl, byte [0x40f1da]
lea edx, [esp + 0x40]
push edx
mov byte [eax + 6], cl
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
push ebp
call fcn.00406df0
add esp, 4
call fcn.00407b90
cmp dword [0x411bb0], edi
jne 0x401352
mov eax, dword [0x411b30]
push edi
push eax
mov dword [0x41f6b8], 3
mov dword [0x41f6b0], edi
mov dword [0x41227c], ebp
mov dword [0x41218c], ebp
mov dword [0x411cbc], ebp
mov dword [0x412200], ebp
mov dword [0x4121d8], ebp
mov dword [0x411b88], ebp
mov dword [0x411b9c], ebp
mov dword [0x412198], ebp
mov dword [0x411b84], ebp
call fcn.00403ed0
mov ecx, dword [0x411c10]
mov edx, dword [0x411c0c]
mov eax, dword [0x411c08]
add esp, 8
push ecx
push edx
push eax
call fcn.00408110
add esp, 0xc
lea ecx, [esp + 0x18]
push ecx
call dword [sym.imp.KERNEL32.dll_QueryPerformanceFrequency]
test eax, eax
push ebp
jne 0x401384
mov edx, dword [0x411ba0]
push str.Fatal_error_
push str.Unable_to_get_system_timer_frequency
push edx
call esi
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x230
ret 0x10
mov eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x1c]
push 0x3c
push eax
push ecx
call fcn.00408d70
mov dword [esp + 0x14], edx
lea edx, [esp + 0x18]
push edx
mov dword [esp + 0x14], eax
call dword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
mov eax, dword [esp + 0x18]
push eax
call fcn.00408c80
add esp, 4
xor edi, edi
mov dword [0x412234], ebp
mov dword [0x411bb8], ebp
xor esi, esi
mov dword [0x412270], ebp
push 1
push ebp
push ebp
lea ecx, [esp + 0x30]
push ebp
push ecx
call dword [sym.imp.USER32.dll_PeekMessageA]
test eax, eax
jne 0x4014a4
lea edx, [esp + 0x18]
push edx
call dword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x18]
cmp eax, esi
mov ebp, ecx
mov ebx, eax
jl 0x401487
jg 0x401408
cmp ecx, edi
jb 0x401487
mov edx, dword [0x412234]
test edx, edx
jle 0x401419
dec edx
mov dword [0x412234], edx
cmp dword [0x411bb8], 0
jne 0x401477
test edx, edx
jne 0x401477
mov edx, edi
or edx, esi
jne 0x401430
mov edi, ecx
mov esi, eax
mov edx, dword [0x41f6b0]
test edx, edx
jne 0x401458
mov edx, dword [esp + 0x14]
sub ecx, edi
push edx
mov edx, dword [esp + 0x14]
sbb eax, esi
push edx
push eax
push ecx
call fcn.00408d70
inc eax
push eax
call fcn.00402510
jmp 0x401474
mov edx, dword [esp + 0x14]
sub ecx, edi
push edx
mov edx, dword [esp + 0x14]
sbb eax, esi
push edx
push eax
push ecx
call fcn.00408d70
inc eax
push eax
call fcn.00401de0
add esp, 4
mov ecx, dword [esp + 0x10]
mov eax, dword [esp + 0x14]
add ebp, ecx
adc ebx, eax
mov edi, ebp
mov esi, ebx
push 1
push 0
push 0
lea eax, [esp + 0x30]
push 0
push eax
call dword [sym.imp.USER32.dll_PeekMessageA]
test eax, eax
je 0x4013e3
xor ebp, ebp
mov eax, dword [esp + 0x28]
mov ebx, 0x12
cmp eax, ebx
je 0x4014d1
lea ecx, [esp + 0x24]
push ecx
call dword [sym.imp.USER32.dll_TranslateMessage]
lea edx, [esp + 0x24]
push edx
call dword [sym.imp.USER32.dll_DispatchMessageA]
cmp dword [esp + 0x28], ebx
jne 0x4013cb
mov eax, dword [0x41225c]
mov esi, dword [sym.imp.GDI32.dll_DeleteObject]
push eax
call esi
mov ecx, dword [0x412274]
push ecx
call esi
mov edx, dword [0x412174]
push edx
call esi
mov eax, dword [0x4121dc]
add eax, 0xffffffa8
push eax
call fcn.00408c30
mov ecx, dword [0x4121d0]
add esp, 4
push ecx
call fcn.00408c30
mov edx, dword [0x412278]
add esp, 4
push edx
call fcn.00408c30
mov eax, dword [0x412264]
add esp, 4
push eax
call fcn.00408c30
add esp, 4
push ebp
push ebp
call dword [sym.imp.USER32.dll_ChangeDisplaySettingsA]
mov ecx, dword [0x41f69c]
mov esi, 0x305
inc ecx
mov eax, ecx
cdq
idiv esi
test edx, edx
jne 0x401550
cmp cl, 0xbd
je 0x401564
push 1
push str.digreg.exe
call dword [sym.imp.KERNEL32.dll_WinExec]
cmp eax, 0x1f
ja 0x401564
jmp 0x401562
mov eax, dword [esp + 0x2c]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x230
ret 0x10
mov ecx, dword [0x411ba0]
push ebp
push str.Fatal_error_
push str.Unable_to_initialize_DirectDraw
push ecx
call esi
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x230
ret 0x10