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

Disassembly:
sub esp, 0x3ec
push ebx
push edi
push 0x1000000
push 0x100000
xor ebx, ebx
push ebx
call dword [sym.imp.KERNEL32.dll_HeapCreate]
mov edi, eax
mov dword [esp + 0xc], edi
cmp edi, ebx
je 0x403b33
push ebp
push esi
mov esi, dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov eax, 0x481020
push 0x3c
mov dword [0x481024], eax
mov dword [0x481020], eax
mov eax, dword [esp + 0x408]
push 8
push edi
mov byte [esp + 0xbc], bl
mov dword [esp + 0xb4], eax
mov dword [esp + 0xb8], 0x401000
call esi
mov ebp, eax
mov dword [esp + 0x4c], ebp
cmp ebp, ebx
je 0x403b2a
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
push 0x4b000
push 8
push edi
mov dword [ebp + 0x2c], ebx
call esi
push ebx
push ebx
push ebx
push ebx
mov dword [ebp + 0x30], eax
call dword [sym.imp.KERNEL32.dll_CreateEventA]
mov dword [ebp], eax
cmp eax, ebx
je 0x403b2a
mov dword [esp + 0x28], ebx
mov dword [esp + 0x18], ebx
mov dword [esp + 0x20], ebx
call fcn.004010d0
test eax, eax
je 0x403aa8
mov eax, dword [ebp + 0x30]
cmp eax, ebx
je 0x403aa8
mov dword [esp + 0x264], 0x4207f0
mov dword [esp + 0x268], 0x423764
mov dword [esp + 0x26c], 0x426760
mov dword [esp + 0x270], 0x4297a8
mov dword [esp + 0x274], 0x42c624
mov dword [esp + 0x278], 0x42f77c
mov dword [esp + 0x27c], 0x432734
mov dword [esp + 0x280], 0x435740
mov dword [esp + 0x284], 0x438948
mov dword [esp + 0x288], 0x43b7c4
mov dword [esp + 0x28c], 0x43e744
mov dword [esp + 0x290], 0x441658
mov dword [esp + 0x294], 0x444544
mov dword [esp + 0x298], 0x4472d0
mov dword [esp + 0x29c], 0x44a080
mov dword [esp + 0x2a0], 0x44d088
mov dword [esp + 0x2a4], 0x450038
mov dword [esp + 0x2a8], 0x453148
mov dword [esp + 0x2ac], 0x455ec0
mov dword [esp + 0x2b0], 0x458fd8
mov dword [esp + 0x2b4], 0x45bf94
mov dword [esp + 0x2b8], 0x45eff8
mov dword [esp + 0x2bc], 0x461fc4
mov dword [esp + 0x2c0], 0x465118
mov dword [esp + 0x2c4], 0x467fb8
mov dword [esp + 0x2c8], 0x46b0e0
mov dword [esp + 0x2cc], 0x46df68
mov dword [esp + 0x2d0], 0x470db4
mov dword [esp + 0x2d4], 0x473e50
mov dword [esp + 0x2d8], 0x476e44
mov dword [esp + 0x2dc], 0x479d0c
mov dword [esp + 0x2e0], 0x47ccb0
mov dword [esp + 0xe4], 0x420924
mov dword [esp + 0xe8], 0x4237c8
mov dword [esp + 0xec], 0x4267b4
mov dword [esp + 0xf0], 0x4299ac
mov dword [esp + 0xf4], 0x42c638
mov dword [esp + 0xf8], 0x42f7f8
mov dword [esp + 0xfc], 0x432838
mov dword [esp + 0x100], 0x43575c
mov dword [esp + 0x104], 0x438ad8
mov dword [esp + 0x108], 0x43b914
mov dword [esp + 0x10c], 0x43e8a0
mov dword [esp + 0x110], 0x441724
mov dword [esp + 0x114], 0x444738
mov dword [esp + 0x118], 0x447498
mov dword [esp + 0x11c], 0x44a224
mov dword [esp + 0x120], 0x44d178
mov dword [esp + 0x124], 0x45010c
mov dword [esp + 0x128], 0x453338
mov dword [esp + 0x12c], 0x455fbc
mov dword [esp + 0x130], 0x459028
mov dword [esp + 0x134], 0x45c024
mov dword [esp + 0x138], 0x45f0f0
mov dword [esp + 0x13c], 0x462008
mov dword [esp + 0x140], 0x465314
mov dword [esp + 0x144], 0x468038
mov dword [esp + 0x148], 0x46b204
mov dword [esp + 0x14c], 0x46e0c0
mov dword [esp + 0x150], 0x470e60
mov dword [esp + 0x154], 0x473fcc
mov dword [esp + 0x158], 0x476fd0
mov dword [esp + 0x15c], 0x479d7c
mov dword [esp + 0x160], 0x47ce58
mov dword [esp + 0x164], 0x420a24
mov dword [esp + 0x168], 0x423a04
mov dword [esp + 0x16c], 0x426970
mov dword [esp + 0x170], 0x429acc
mov dword [esp + 0x174], 0x42c74c
mov dword [esp + 0x178], 0x42fa7c
mov dword [esp + 0x17c], 0x432930
mov dword [esp + 0x180], 0x4357dc
mov dword [esp + 0x184], 0x438ce8
mov dword [esp + 0x188], 0x43b9ec
mov dword [esp + 0x18c], 0x43ea68
mov dword [esp + 0x190], 0x4419b4
mov dword [esp + 0x194], 0x444970
mov dword [esp + 0x198], 0x447718
mov dword [esp + 0x19c], 0x44a258
mov dword [esp + 0x1a0], 0x44d310
mov dword [esp + 0x1a4], 0x450134
push 0x4b000
push eax
mov dword [esp + 0x1b0], 0x453598
mov dword [esp + 0x1b4], 0x455fd8
mov dword [esp + 0x1b8], 0x459290
mov dword [esp + 0x1bc], 0x45c1ac
mov dword [esp + 0x1c0], 0x45f274
mov dword [esp + 0x1c4], 0x462108
mov dword [esp + 0x1c8], 0x46545c
mov dword [esp + 0x1cc], 0x4680d8
mov dword [esp + 0x1d0], 0x46b478
mov dword [esp + 0x1d4], 0x46e314
mov dword [esp + 0x1d8], 0x470f60
mov dword [esp + 0x1dc], 0x47401c
mov dword [esp + 0x1e0], 0x47711c
mov dword [esp + 0x1e4], 0x479fe0
mov dword [esp + 0x1e8], 0x47d0f0
mov dword [esp + 0x1ec], 0x423188
mov dword [esp + 0x1f0], 0x426118
mov dword [esp + 0x1f4], 0x42919c
mov dword [esp + 0x1f8], 0x42c000
mov dword [esp + 0x1fc], 0x42f158
mov dword [esp + 0x200], 0x4320c8
mov dword [esp + 0x204], 0x435134
mov dword [esp + 0x208], 0x438300
mov dword [esp + 0x20c], 0x43b17c
mov dword [esp + 0x210], 0x43e150
mov dword [esp + 0x214], 0x440fec
mov dword [esp + 0x218], 0x443f38
mov dword [esp + 0x21c], 0x446cc4
mov dword [esp + 0x220], 0x449a44
mov dword [esp + 0x224], 0x44ca34
mov dword [esp + 0x228], 0x44f9fc
mov dword [esp + 0x22c], 0x452b18
mov dword [esp + 0x230], 0x45589c
mov dword [esp + 0x234], 0x45896c
mov dword [esp + 0x238], 0x45b97c
mov dword [esp + 0x23c], 0x45e9b0
mov dword [esp + 0x240], 0x461988
mov dword [esp + 0x244], 0x464ac4
mov dword [esp + 0x248], 0x467940
mov dword [esp + 0x24c], 0x46aabc
mov dword [esp + 0x250], 0x46d95c
mov dword [esp + 0x254], 0x4707a8
mov dword [esp + 0x258], 0x47382c
mov dword [esp + 0x25c], 0x476820
mov dword [esp + 0x260], 0x479718
mov dword [esp + 0x264], 0x47c6a4
mov dword [esp + 0x268], 0x47f444
call fcn.0040eff0
add esp, 8
mov dword [ebp + 0x2c], eax
xor esi, esi
jmp 0x4035a0
mov edi, dword [esp + esi + 0x264]
mov ecx, dword [edi]
mov eax, dword [ebp + 0x2c]
add eax, dword [ebp + 0x30]
push ecx
lea edx, [edi + 4]
push edx
push eax
call sub.MSVCRT.dll_memcpy
mov eax, dword [ebp + 0x2c]
add eax, dword [edi]
mov ecx, 0x4b000
sub ecx, eax
mov dword [esp + 0x1c], ecx
mov ecx, dword [esp + esi + 0xf0]
mov dword [ebp + 0x2c], eax
mov edx, dword [ecx]
push edx
mov edx, dword [ebp + 0x30]
add ecx, 4
push ecx
lea ecx, [esp + 0x24]
push ecx
add edx, eax
push edx
call fcn.00401420
mov eax, dword [esp + 0x2c]
add dword [ebp + 0x2c], eax
mov eax, dword [ebp + 0x2c]
mov ecx, dword [ebp + 0x30]
mov edi, dword [esp + esi + 0x180]
add ecx, eax
mov ebx, 0x4b000
sub ebx, eax
push ecx
call fcn.004013c0
add dword [ebp + 0x2c], eax
mov edx, dword [ebp + 0x30]
add edx, dword [ebp + 0x2c]
mov eax, dword [esp + esi + 0x204]
mov ecx, dword [esp + 0x34]
push edx
push eax
push ecx
call fcn.004011f0
add dword [ebp + 0x2c], eax
mov eax, dword [ebp + 0x2c]
add esi, 4
add esp, 0x2c
cmp esi, 0x80
jb 0x4035a0
test al, 0xf
jne 0x403aa2
mov edx, dword [esp + 0x14]
mov ecx, 0xe
mov esi, str.Roland_GS_Sound_Set_Microsoft__P__1996_Roland_Corporation
lea edi, [esp + 0x64]
rep movsd dword es:[edi], dword [esi]
push eax
push 8
movsw word es:[edi], word [esi]
mov edi, dword [sym.imp.KERNEL32.dll_HeapAlloc]
push edx
call edi
mov ebx, eax
mov dword [esp + 0x50], ebx
test ebx, ebx
je 0x403aa2
mov eax, dword [0x4207a0]
mov ecx, dword [0x4207a4]
mov edx, dword [0x4207a8]
mov dword [esp + 0x2c], eax
mov eax, dword [0x4207ac]
mov dword [esp + 0x30], ecx
mov ecx, dword [ebp + 0x2c]
mov dword [esp + 0x34], edx
mov dword [esp + 0x38], eax
mov eax, dword [ebp + 0x30]
push ebx
push ecx
lea edx, [esp + 0x34]
call fcn.00401540
mov edx, 0x5346
add esp, 8
cmp word [ebx], dx
jne 0x403a94
movzx eax, word [ebx + 2]
cmp eax, 0xa
jae 0x403a94
lea ecx, [eax + eax*2]
lea esi, [ebx + 4]
lea edx, [ebx + ecx*4 + 4]
mov dword [esp + 0x10], esi
mov dword [esp + 0x1c], edx
mov dword [esp + 0x24], 0
test eax, eax
je 0x403a94
jmp 0x4036f9
mov edi, dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov eax, dword [esi]
cmp eax, 0xbf0e967b
je 0x4037ac
cmp eax, 0xcc81fc5d
je 0x403761
cmp eax, 0xfa9d947f
jne 0x403a78
mov eax, dword [esi + 8]
add eax, 5
push eax
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call edi
mov dword [esp + 0x18], eax
test eax, eax
je 0x403a78
mov ecx, dword [esi + 8]
mov edi, eax
mov dword [edi], ecx
mov eax, dword [esi + 4]
mov edx, dword [esi + 8]
add eax, dword [esp + 0x1c]
push edx
push eax
lea ecx, [edi + 4]
push ecx
call sub.MSVCRT.dll_memcpy
add esp, 0xc
mov dword [esp + 0xa0], edi
jmp 0x403a78
mov edx, dword [esi + 8]
add edx, 5
push edx
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call edi
mov dword [esp + 0x20], eax
test eax, eax
je 0x403a78
mov eax, dword [esi + 8]
mov edi, dword [esp + 0x20]
mov dword [edi], eax
mov edx, dword [esi + 4]
mov ecx, dword [esi + 8]
add edx, dword [esp + 0x1c]
push ecx
push edx
lea eax, [edi + 4]
push eax
call sub.MSVCRT.dll_memcpy
add esp, 0xc
mov dword [esp + 0xa4], edi
jmp 0x403a78
cmp dword [esi + 8], 0x10000
jae 0x403a78
xor eax, eax
mov esi, eax
mov edi, eax
mov dword [esp + 0xd4], eax
mov dword [esp + 0xd8], eax
mov dword [esp + 0xdc], eax
mov dword [esp + 0xe0], eax
mov dword [esp + 0x34], eax
mov dword [esp + 0x38], eax
movzx eax, byte [esp + 0x64]
cdq
shld edx, eax, 8
shl eax, 8
mov ecx, eax
movzx eax, byte [esp + 0x65]
mov ebx, edx
cdq
or ecx, eax
movzx eax, byte [esp + 0x66]
or ebx, edx
shld ebx, ecx, 8
shl ecx, 8
cdq
or ecx, eax
movzx eax, byte [esp + 0x67]
or ebx, edx
shld ebx, ecx, 8
shl ecx, 8
cdq
or ecx, eax
movzx eax, byte [esp + 0x68]
or ebx, edx
shld ebx, ecx, 8
shl ecx, 8
cdq
or ecx, eax
movzx eax, byte [esp + 0x69]
or ebx, edx
shld ebx, ecx, 8
cdq
shl ecx, 8
or ecx, eax
movzx eax, byte [esp + 0x6a]
or ebx, edx
shld ebx, ecx, 8
cdq
shl ecx, 8
or ecx, eax
movzx eax, byte [esp + 0x6b]
or ebx, edx
mov edx, ecx
mov ecx, ebx
shld ecx, edx, 8
shl edx, 8
mov ebx, edx
cdq
or ebx, eax
movzx eax, byte [esp + 0x6c]
or ecx, edx
cdq
shld edx, eax, 8
mov dword [esp + 0x40], ecx
shl eax, 8
mov ecx, eax
movzx eax, byte [esp + 0x6d]
mov ebp, edx
cdq
or ecx, eax
movzx eax, byte [esp + 0x6e]
or ebp, edx
shld ebp, ecx, 8
shl ecx, 8
cdq
or ecx, eax
or ebp, edx
shld ebp, ecx, 8
mov dword [esp + 0x2c], esi
mov dword [esp + 0x30], edi
mov dword [esp + 0x3f4], 0x80
mov dword [esp + 0x3c], ebx
shl ecx, 8
movzx eax, byte [esp + 0x6f]
cdq
or ecx, eax
movzx eax, byte [esp + 0x70]
or ebp, edx
shld ebp, ecx, 8
shl ecx, 8
cdq
or ecx, eax
movzx eax, byte [esp + 0x71]
or ebp, edx
shld ebp, ecx, 8
shl ecx, 8
cdq
or ecx, eax
movzx eax, byte [esp + 0x72]
or ebp, edx
shld ebp, ecx, 8
cdq
shl ecx, 8
or ecx, eax
movzx eax, byte [esp + 0x73]
or ebp, edx
mov edx, ecx
mov ecx, ebp
shld ecx, edx, 8
shl edx, 8
mov ebp, edx
cdq
or ebp, eax
or ecx, edx
mov dword [esp + 0x44], ebp
mov dword [esp + 0x48], ecx
call fcn.00402640
xor edi, dword [esp + 0x40]
push 0xa09e667f
push 0x3bcc908b
xor esi, ebx
push edi
push esi
mov dword [esp + 0x6c], esi
mov dword [esp + 0x70], edi
call fcn.00401710
mov edi, edx
xor edi, dword [esp + 0x48]
mov esi, eax
xor esi, dword [esp + 0x44]
xor edi, dword [esp + 0x58]
push 0xb67ae858
push 0x4caa73b2
xor esi, ebp
push edi
push esi
call fcn.00401710
mov ebp, edx
xor ebp, dword [esp + 0x80]
mov ebx, eax
xor ebx, dword [esp + 0x7c]
xor ebp, dword [esp + 0x60]
xor ebx, dword [esp + 0x5c]
push 0xc6ef372f
push 0xe94f82be
push ebp
push ebx
call fcn.00401710
xor edx, edi
xor edx, dword [esp + 0x78]
push 0x54ff53a5
xor eax, esi
xor eax, dword [esp + 0x78]
push 0xf1d36f1c
push edx
push eax
mov dword [esp + 0x94], eax
mov dword [esp + 0x98], edx
call fcn.00401710
xor eax, ebx
add esp, 0x40
xor edx, ebp
mov dword [esp + 0xc4], eax
mov dword [esp + 0xc8], edx
mov eax, dword [esp + 0x54]
mov ecx, dword [esp + 0x58]
lea edx, [esp + 0xd4]
push edx
mov dword [esp + 0xd0], eax
lea eax, [esp + 0xc8]
mov dword [esp + 0xd4], ecx
push eax
lea ecx, [esp + 0x34]
push ecx
lea edx, [esp + 0x48]
push edx
lea esi, [esp + 0x2f4]
call fcn.00401800
mov eax, dword [esp + 0x84]
mov ecx, dword [esp + 0x88]
mov edx, dword [esp + 0x8c]
mov dword [esp + 0xc4], eax
mov eax, dword [esp + 0x90]
mov dword [esp + 0xd0], eax
mov eax, dword [esp + 0x20]
push 1
mov dword [esp + 0xcc], ecx
mov dword [esp + 0xd0], edx
mov edx, dword [eax + 8]
mov eax, dword [eax + 4]
add eax, dword [esp + 0x30]
lea ecx, [esp + 0xc8]
push ecx
shr edx, 4
push edx
push eax
mov ecx, esi
push section..textbss
push ecx
call fcn.00402e20
mov ebp, dword [esp + 0x74]
mov ebx, dword [esp + 0x78]
mov esi, dword [esp + 0x38]
add esp, 0x28
mov dword [esp + 0x28], 1
mov eax, dword [esp + 0x24]
movzx edx, word [ebx + 2]
inc eax
add esi, 0xc
mov dword [esp + 0x24], eax
mov dword [esp + 0x10], esi
cmp eax, edx
jb 0x4036f3
mov eax, dword [esp + 0x14]
push ebx
push 0
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov edi, dword [esp + 0x14]
xor ebx, ebx
mov ecx, dword [ebp]
push 0x3e8
push ecx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov edx, dword [ebp]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [esp + 0x28], ebx
je 0x403ae2
cmp dword [esp + 0x18], ebx
je 0x403ae2
cmp dword [esp + 0x20], ebx
je 0x403ae2
lea eax, [esp + 0xa0]
push eax
mov ecx, section..textbss
call ecx
mov eax, dword [0x481020]
cmp eax, 0x481020
je 0x403b2a
mov ebp, dword [sym.imp.KERNEL32.dll_HeapFree]
mov ecx, dword [eax]
mov esi, eax
mov eax, dword [eax + 4]
mov dword [eax], ecx
mov dword [ecx + 4], eax
mov eax, dword [esi + 8]
cmp eax, ebx
je 0x403b13
mov edx, dword [esi + 0x10]
push 0x8000
push ebx
push edx
call eax
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call ebp
mov eax, dword [0x481020]
cmp eax, 0x481020
jne 0x403af4
push edi
call dword [sym.imp.KERNEL32.dll_HeapDestroy]
pop esi
pop ebp
pop edi
pop ebx
add esp, 0x3ec
ret 8