Function at 0x4031d0
Capabilities:
Create thread
Generate random numbers via rtlgenrandom

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xb0
mov eax, dword [0x5a1008]
xor eax, ebp
mov dword [ebp - 4], eax
push esi
push edi
xor eax, eax
xor esi, esi
push 0x5a1390
mov dword [ebp - 0x74], esi
mov dword [ebp - 0x70], esi
mov word [ebp - 0x6c], ax
mov dword [ebp - 0x78], eax
call dword [sym.imp.KERNEL32.dll_AcquireSRWLockExclusive]
cmp dword [0x5a138c], esi
jne 0x4033bd
push 0x10
lea ecx, [ebp - 0x68]
push ecx
call dword [sym.imp.ADVAPI32.dll_SystemFunction036]
test al, al
jne 0x40326f
cmp dword [0x5a140c], esi
jne 0x40322d
call dword [sym.imp.KERNEL32.dll_GetTickCount]
jmp 0x403232
mov eax, dword [0x5a1410]
mov dword [ebp - 0x68], eax
imul eax, eax, 0x19660d
add eax, 0x3c6ef35f
mov dword [ebp - 0x64], eax
imul eax, eax, 0x19660d
add eax, 0x3c6ef35f
mov dword [ebp - 0x60], eax
imul eax, eax, 0x19660d
add eax, 0x3c6ef35f
mov dword [ebp - 0x5c], eax
imul eax, eax, 0x19660d
add eax, 0x3c6ef35f
mov dword [0x5a1410], eax
push 0x27
lea edx, [ebp - 0x58]
push edx
lea eax, [ebp - 0x68]
push eax
call dword [sym.imp.ole32.dll_StringFromGUID2]
test eax, eax
jne 0x40328d
mov esi, 0x80004005
jmp 0x4033c8
push 0x30
lea ecx, [ebp - 0xac]
push 0
push ecx
call sub.msvcrt.dll_memset
add esp, 0xc
push 0
mov dword [ebp - 0xac], 0x30
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
mov dword [ebp - 0x98], eax
lea eax, [ebp - 0xac]
lea edx, [ebp - 0x58]
push eax
mov dword [ebp - 0x84], edx
mov dword [ebp - 0xa4], 0x403120
call dword [sym.imp.USER32.dll_RegisterClassExW]
xor ecx, ecx
mov word [ebp - 0x6c], ax
cmp cx, ax
jne 0x4032f8
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jg 0x4033af
mov esi, eax
jmp 0x4033c8
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
push 0
push 0
push 0
push 0
mov dword [0x5a139c], eax
call dword [sym.imp.KERNEL32.dll_CreateEventW]
mov dword [ebp - 0x74], eax
test eax, eax
je 0x4032e3
lea edx, [ebp - 0x7c]
push edx
push 0
lea eax, [ebp - 0x74]
push eax
push 0x402fe0
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateThread]
mov edi, eax
mov dword [ebp - 0x78], edi
test edi, edi
je 0x4032e3
mov ecx, dword [ebp - 0x74]
push 0xffffffffffffffff
push ecx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
jne 0x4032e3
mov eax, dword [ebp - 0x70]
test eax, eax
jns 0x403355
mov esi, eax
jmp 0x4033c8
push 0
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
movzx edx, word [ebp - 0x6c]
push eax
push 0
push 0xfffffffffffffffd
push 0
push 0
push 0
push 0
push 0
push 0
push edx
push 0
call dword [sym.imp.USER32.dll_CreateWindowExW]
test eax, eax
je 0x4032e3
mov ecx, dword [ebp - 0x7c]
mov dword [0x5a13a4], eax
mov ax, word [ebp - 0x6c]
mov word [0x5a13a8], ax
mov dword [0x5a13a0], 0x5a1020
mov dword [0x5a1394], edi
mov dword [0x5a1398], ecx
jmp 0x4033c2
and eax, 0xffff
or eax, 0x80070000
mov esi, eax
jmp 0x4033c8
mov esi, 1
inc dword [0x5a138c]
push 0x5a1390
call dword [sym.imp.KERNEL32.dll_ReleaseSRWLockExclusive]
mov eax, dword [ebp - 0x74]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
je 0x4033e3
push eax
call edi
test esi, esi
jns 0x403421
cmp dword [ebp - 0x78], 0
je 0x403406
mov edx, dword [ebp - 0x7c]
push 0
push 0
push 0x8000
push edx
call dword [sym.imp.USER32.dll_PostThreadMessageW]
mov eax, dword [ebp - 0x78]
push eax
call edi
cmp word [ebp - 0x6c], 0
je 0x403421
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
movzx ecx, word [ebp - 0x6c]
push eax
push ecx
call dword [sym.imp.USER32.dll_UnregisterClassW]
mov ecx, dword [ebp - 4]
pop edi
mov eax, esi
xor ecx, ebp
pop esi
call fcn.0059e3c7
mov esp, ebp
pop ebp
ret