Function at 0x100a7430
Capabilities:
Check mutex on windows
Link many functions at runtime

Disassembly:
push ebx
mov ebx, esp
sub esp, 8
and esp, 0xfffffff8
add esp, 4
push ebp
mov ebp, dword [ebx + 4]
mov dword [esp + 4], ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x100eefc0
mov eax, dword fs:[0]
push eax
push ebx
sub esp, 0x260
mov eax, dword [0x10122094]
xor eax, ebp
mov dword [ebp - 0x14], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov ecx, dword [0x101252d4]
mov eax, 0x7fffffff
sub eax, ecx
cmp eax, 0xc
jb 0x100a7eec
cmp dword [0x101252d8], 0x10
mov eax, 0x101252c4
push 0xc
cmovae eax, dword [0x101252c4]
push str.StormLib.dll
push ecx
push eax
push ecx
push dword [ebp - 0x244]
lea ecx, [ebp - 0x240]
call fcn.1003f600
cmp dword [ebp - 0x22c], 0x10
lea eax, [ebp - 0x240]
cmovae eax, dword [ebp - 0x240]
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov edx, dword [ebp - 0x22c]
mov edi, eax
mov dword [ebp - 0x250], edi
cmp edx, 0x10
jb 0x100a7512
mov ecx, dword [ebp - 0x240]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x100a7508
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x100a7ef1
push edx
push ecx
call fcn.100b4eda
add esp, 8
mov dword [ebp - 0x230], 0
mov dword [ebp - 0x22c], 0xf
mov byte [ebp - 0x240], 0
test edi, edi
je 0x100a7e9c
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push str.SFileOpenArchive
push edi
call esi
push str.SFileCloseArchive
push edi
mov dword [0x1012f13c], eax
call esi
push str.SFileOpenFileEx
push edi
mov dword [0x1012f150], eax
call esi
push str.SFileGetFileSize
push edi
mov dword [0x1012f144], eax
call esi
push str.SFileReadFile
push edi
mov dword [0x1012f140], eax
call esi
push str.SFileCloseFile
push edi
mov dword [0x1012f148], eax
call esi
push str.GlobalBH_PATCH_D2_MPQ_MUTEX
push 1
push 0
mov dword [0x1012f14c], eax
call dword [sym.imp.KERNEL32.dll_CreateMutexA]
push 0xffffffffffffffff
push eax
mov dword [ebp - 0x244], eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp dword [0x1012f13c], 0
je 0x100a7e81
cmp dword [0x1012f150], 0
je 0x100a7e81
cmp dword [0x1012f144], 0
je 0x100a7e81
cmp dword [0x1012f14c], 0
je 0x100a7e81
cmp dword [0x1012f140], 0
je 0x100a7e81
cmp dword [0x1012f148], 0
je 0x100a7e81
cmp dword [ebx + 0x1c], 0x10
lea esi, [ebx + 8]
mov dword [ebp - 0x228], 0
cmovae esi, dword [ebx + 8]
mov ecx, esi
mov dword [ebp - 0x218], 0
mov dword [ebp - 0x214], 0xf
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x100a7623
sub ecx, edx
push ecx
push esi
lea ecx, [ebp - 0x228]
call fcn.1003f030
mov eax, dword [0x1012f13c]
lea ecx, [ebp - 0x20c]
push ecx
push pe_nt_image_headers32
push 0
push esi
mov dword [ebp - 0x210], 0
call eax
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
test al, al
jne 0x100a766b
call edi
mov dword [ebp - 0x210], eax
push 0xb
push str.UniqueItems
lea ecx, [ebp - 0x180]
mov dword [ebp - 0x180], 0
mov dword [ebp - 0x170], 0
mov dword [ebp - 0x16c], 0xf
call fcn.1003f030
push 5
push str.Armor
lea ecx, [ebp - 0x168]
mov dword [ebp - 0x168], 0
mov dword [ebp - 0x158], 0
mov dword [ebp - 0x154], 0xf
call fcn.1003f030
push 7
push str.Weapons
lea ecx, [ebp - 0x150]
mov dword [ebp - 0x150], 0
mov dword [ebp - 0x140], 0
mov dword [ebp - 0x13c], 0xf
call fcn.1003f030
push 4
push str.Misc
lea ecx, [ebp - 0x138]
mov dword [ebp - 0x138], 0
mov dword [ebp - 0x128], 0
mov dword [ebp - 0x124], 0xf
call fcn.1003f030
push 9
push str.ItemTypes
lea ecx, [ebp - 0x120]
mov dword [ebp - 0x120], 0
mov dword [ebp - 0x110], 0
mov dword [ebp - 0x10c], 0xf
call fcn.1003f030
push 0xc
push str.ItemStatCost
lea ecx, [ebp - 0x108]
mov dword [ebp - 0x108], 0
mov dword [ebp - 0xf8], 0
mov dword [ebp - 0xf4], 0xf
call fcn.1003f030
push 0xa
push str.Properties
lea ecx, [ebp - 0xf0]
mov dword [ebp - 0xf0], 0
mov dword [ebp - 0xe0], 0
mov dword [ebp - 0xdc], 0xf
call fcn.1003f030
push 5
push str.Runes
lea ecx, [ebp - 0xd8]
mov dword [ebp - 0xd8], 0
mov dword [ebp - 0xc8], 0
mov dword [ebp - 0xc4], 0xf
call fcn.1003f030
push 8
push str.SetItems
lea ecx, [ebp - 0xc0]
mov dword [ebp - 0xc0], 0
mov dword [ebp - 0xb0], 0
mov dword [ebp - 0xac], 0xf
call fcn.1003f030
push 6
push str.skills
lea ecx, [ebp - 0xa8]
mov dword [ebp - 0xa8], 0
mov dword [ebp - 0x98], 0
mov dword [ebp - 0x94], 0xf
call fcn.1003f030
push 0xb
push str.MagicPrefix
lea ecx, [ebp - 0x90]
mov dword [ebp - 0x90], 0
mov dword [ebp - 0x80], 0
mov dword [ebp - 0x7c], 0xf
call fcn.1003f030
mov dword [ebp - 0x78], 0
mov dword [ebp - 0x68], 0
mov dword [ebp - 0x64], 0xf
push 0xb
push str.MagicSuffix
lea ecx, [ebp - 0x78]
call fcn.1003f030
push 0xa
push str.RarePrefix
lea ecx, [ebp - 0x60]
mov dword [ebp - 0x60], 0
mov dword [ebp - 0x50], 0
mov dword [ebp - 0x4c], 0xf
call fcn.1003f030
push 0xa
push str.RareSuffix
lea ecx, [ebp - 0x48]
mov dword [ebp - 0x48], 0
mov dword [ebp - 0x38], 0
mov dword [ebp - 0x34], 0xf
call fcn.1003f030
push 9
push str.CharStats
lea ecx, [ebp - 0x30]
mov dword [ebp - 0x30], 0
mov dword [ebp - 0x20], 0
mov dword [ebp - 0x1c], 0xf
call fcn.1003f030
cmp dword [ebp - 0x210], 0
jne 0x100a7c42
lea esi, [ebp - 0x180]
mov dword [ebp - 0x248], 0
mov dword [ebp - 0x24c], esi
nop dword [eax + eax]
mov ecx, dword [esi + 0x10]
mov eax, 0x7fffffff
sub eax, ecx
cmp eax, 0x12
jb 0x100a7eec
cmp dword [esi + 0x14], 0x10
mov eax, esi
jb 0x100a794d
mov eax, dword [esi]
push ecx
push eax
push 0x12
push str.dataglobalexcel_
push ecx
push dword [ebp - 0x244]
lea ecx, [ebp - 0x198]
call fcn.1003f600
push str..txt
lea ecx, [ebp - 0x198]
call fcn.1003eb50
mov dword [ebp - 0x208], 0
mov dword [ebp - 0x1f8], 0
mov dword [ebp - 0x1f4], 0
movups xmm0, xmmword [eax]
movups xmmword [ebp - 0x208], xmm0
movq xmm0, qword [eax + 0x10]
movq qword [ebp - 0x1f8], xmm0
mov dword [eax + 0x10], 0
mov dword [eax + 0x14], 0xf
mov byte [eax], 0
mov edx, dword [ebp - 0x184]
cmp edx, 0x10
jb 0x100a79f8
mov ecx, dword [ebp - 0x198]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x100a79ee
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x100a7ef1
push edx
push ecx
call fcn.100b4eda
add esp, 8
cmp dword [ebp - 0x1f4], 0x10
lea edi, [ebp - 0x208]
mov dword [ebp - 0x1d0], 0
cmovae edi, dword [ebp - 0x208]
mov ecx, edi
mov dword [ebp - 0x1c0], 0
mov dword [ebp - 0x1bc], 0xf
lea edx, [ecx + 1]
nop
mov al, byte [ecx]
inc ecx
test al, al
jne 0x100a7a30
sub ecx, edx
push ecx
push edi
lea ecx, [ebp - 0x1d0]
call fcn.1003f030
mov eax, dword [0x1012f144]
lea ecx, [ebp - 0x1b4]
push ecx
push 0
push edi
push dword [ebp - 0x20c]
mov dword [ebp - 0x1b8], 0
call eax
test al, al
jne 0x100a7a79
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x1b8], eax
jmp 0x100a7a7f
mov eax, dword [ebp - 0x1b8]
test eax, eax
jne 0x100a7b6f
push esi
lea ecx, [ebp - 0x198]
call fcn.1003ecf0
cmp dword [ebp - 0x184], 0x10
lea ecx, [ebp - 0x198]
jb 0x100a7ab4
mov edi, dword [ebp - 0x198]
mov ecx, edi
mov esi, dword [ebp - 0x188]
add esi, edi
jmp 0x100a7ac6
lea esi, [ebp - 0x198]
add esi, dword [ebp - 0x188]
lea edi, [ebp - 0x198]
cmp edi, esi
je 0x100a7aec
sub ecx, edi
mov dword [ebp - 0x254], ecx
movsx eax, byte [edi]
push eax
call fcn.100c4148
mov ecx, dword [ebp - 0x254]
add esp, 4
mov byte [edi + ecx], al
inc edi
cmp edi, esi
jne 0x100a7ad2
push 0x1c
call fcn.100b4eaa
add esp, 4
lea ecx, [ebp - 0x1d0]
push ecx
mov ecx, eax
call fcn.100a6d60
mov esi, eax
lea eax, [ebp - 0x198]
push eax
call fcn.100a8620
mov dword [eax], esi
mov edx, dword [ebp - 0x184]
cmp edx, 0x10
jb 0x100a7b4e
mov ecx, dword [ebp - 0x198]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x100a7b44
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x100a7ef1
push edx
push ecx
call fcn.100b4eda
add esp, 8
mov esi, dword [ebp - 0x24c]
mov dword [ebp - 0x188], 0
mov dword [ebp - 0x184], 0xf
mov byte [ebp - 0x198], 0
mov dword [ebp - 4], 0
mov eax, dword [ebp - 0x1b4]
test eax, eax
je 0x100a7b87
push eax
call dword [0x1012f14c]
mov edx, dword [ebp - 0x1bc]
cmp edx, 0x10
jb 0x100a7bc1
mov ecx, dword [ebp - 0x1d0]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x100a7bb7
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x100a7ef1
push edx
push ecx
call fcn.100b4eda
add esp, 8
mov dword [ebp - 4], 0xffffffff
mov edx, dword [ebp - 0x1f4]
mov dword [ebp - 0x1c0], 0
mov dword [ebp - 0x1bc], 0xf
mov byte [ebp - 0x1d0], 0
cmp edx, 0x10
jb 0x100a7c1d
mov ecx, dword [ebp - 0x208]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x100a7c13
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x100a7ef1
push edx
push ecx
call fcn.100b4eda
add esp, 8
mov edx, dword [ebp - 0x248]
add esi, 0x18
inc edx
mov dword [ebp - 0x24c], esi
mov dword [ebp - 0x248], edx
cmp edx, 0xf
jl 0x100a7930
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
push 0x10
push str.data_version.txt
lea ecx, [ebp - 0x1b0]
mov dword [ebp - 0x1b0], 0
mov dword [ebp - 0x1a0], 0
mov dword [ebp - 0x19c], 0xf
call fcn.1003f030
cmp dword [ebp - 0x19c], 0x10
lea esi, [ebp - 0x1b0]
mov dword [ebp - 0x1f0], 0
cmovae esi, dword [ebp - 0x1b0]
mov ecx, esi
mov dword [ebp - 0x1e0], 0
mov dword [ebp - 0x1dc], 0xf
lea edx, [ecx + 1]
nop dword [eax]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x100a7cb0
sub ecx, edx
push ecx
push esi
lea ecx, [ebp - 0x1f0]
call fcn.1003f030
mov eax, dword [0x1012f144]
lea ecx, [ebp - 0x1d4]
push ecx
push 0
push esi
push dword [ebp - 0x20c]
mov dword [ebp - 0x1d8], 0
call eax
test al, al
jne 0x100a7cf5
call edi
mov dword [ebp - 0x1d8], eax
jmp 0x100a7cfb
mov eax, dword [ebp - 0x1d8]
test eax, eax
jne 0x100a7d4b
lea eax, [ebp - 0x1f0]
push eax
lea ecx, [ebp - 0x270]
call fcn.100a6d60
mov eax, dword [ebp - 0x26c]
cmp eax, 0x1012aa78
je 0x100a7d35
cmp dword [eax + 0x14], 0x10
mov ecx, dword [eax + 0x10]
jb 0x100a7d29
mov eax, dword [eax]
push ecx
push eax
mov ecx, 0x1012aa78
call fcn.1003f030
lea ecx, [ebp - 0x260]
call fcn.100a8720
lea ecx, [ebp - 0x26c]
call fcn.1003edd0
mov dword [ebp - 4], 1
mov eax, dword [ebp - 0x1d4]
test eax, eax
je 0x100a7d63
push eax
call dword [0x1012f14c]
mov edx, dword [ebp - 0x1dc]
cmp edx, 0x10
jb 0x100a7d9d
mov ecx, dword [ebp - 0x1f0]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x100a7d93
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x100a7ef6
push edx
push ecx
call fcn.100b4eda
add esp, 8
mov dword [ebp - 4], 0xffffffff
mov edx, dword [ebp - 0x19c]
mov dword [ebp - 0x1e0], 0
mov dword [ebp - 0x1dc], 0xf
mov byte [ebp - 0x1f0], 0
cmp edx, 0x10
jb 0x100a7df9
mov ecx, dword [ebp - 0x1b0]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x100a7def
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x100a7ef6
push edx
push ecx
call fcn.100b4eda
add esp, 8
push fcn.1003ec40
push 0xf
push 0x18
lea eax, [ebp - 0x180]
mov dword [ebp - 0x1a0], 0
push eax
mov dword [ebp - 0x19c], 0xf
mov byte [ebp - 0x1b0], 0
call fcn.100b5435
mov dword [ebp - 4], 2
mov eax, dword [ebp - 0x20c]
test eax, eax
je 0x100a7e41
push eax
call dword [0x1012f150]
mov edx, dword [ebp - 0x214]
cmp edx, 0x10
jb 0x100a7e7b
mov ecx, dword [ebp - 0x228]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x100a7e71
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x100a7ef6
push edx
push ecx
call fcn.100b4eda
add esp, 8
mov edi, dword [ebp - 0x250]
push edi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov esi, dword [ebp - 0x244]
push esi
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [ebx + 0x1c]
cmp edx, 0x10
jb 0x100a7ecc
mov ecx, dword [ebx + 8]
inc edx
mov eax, ecx
cmp edx, 0x1000
jb 0x100a7ec2
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x100a7efb
push edx
push ecx
call fcn.100b4eda
add esp, 8
mov al, 1
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.100b4e9c
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
ret
call fcn.10036790
call fcn.100ba49f
call fcn.100ba49f
call fcn.100ba49f
int3