Function at 0x10040240
Capabilities:
Generate random numbers via rtlgenrandom
Get common file path
Link many functions at runtime

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x101cae6c
mov eax, dword fs:[0]
push eax
sub esp, 0xe4
mov eax, dword [0x1022c068]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov ebx, ecx
mov dword [ebp - 0x4c], ebx
mov dword [ebp - 0x34], ebx
mov esi, dword [ebp + 8]
xor eax, eax
mov dword [ebp - 0x50], ebx
mov dword [ebx], 0
mov dword [ebp - 0x40], esi
mov dword [ebx + 0x14], 0
mov dword [ebx + 0x18], 7
mov word [ebx + 4], ax
mov dword [ebp - 4], eax
mov dword [ebx + 0x2c], eax
mov dword [ebx + 0x30], 7
mov word [ebx + 0x1c], ax
mov dword [ebx + 0x34], eax
mov dword [ebx + 0x38], eax
mov dword [ebx + 0x3c], eax
mov byte [ebp - 4], 2
test esi, esi
je 0x10040a10
mov eax, dword [ebp + 0xc]
test eax, eax
je 0x10040a10
cmp eax, 0x7fffffff
ja 0x10040a2b
sub esp, 8
call fcn.1011e89f
mov edi, eax
add esp, 8
mov dword [ebp - 0x54], edi
mov byte [ebp - 4], 5
test edi, edi
je 0x100409ce
mov eax, dword [edi + 4]
cmp eax, dword [edi]
mov dword [edi], ebx
jne 0x100402fd
mov dword [edi + 4], ebx
mov ebx, dword [ebp + 0xc]
mov dword [edi + 0x8c], 0x10040d00
mov dword [edi + 0x34], 0x10040ae0
mov dword [edi + 0x38], 0x10040d70
mov dword [edi + 0x3c], 0x10040d90
test ebx, ebx
js 0x100409c4
mov eax, dword [edi + 0x1dc]
sub eax, 0
je 0x1004035e
sub eax, 2
je 0x1004034f
sub eax, 1
jne 0x100405fa
mov dword [edi + 0x118], 0x21
jmp 0x100409ce
mov dword [edi + 0x118], 0x24
jmp 0x100409ce
cmp dword [edi + 0x1d8], 0
jne 0x100405fa
cmp dword [edi + 0x1ec], 0
jne 0x100405d7
push str.kernel32
mov dword [ebp - 0x30], 0
xor esi, esi
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
mov dword [ebp - 0x34], eax
test eax, eax
je 0x10040549
push 0x10206fc4
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
push 0x10206fe4
push str.ADVAPI32.DLL
mov ebx, eax
call fcn.101b2a3e
add esp, 8
test eax, eax
je 0x100403d5
test ebx, ebx
je 0x100403c3
push 8
jmp 0x100403f0
push str.ADVAPI32.DLL
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov esi, eax
jmp 0x100404a9
test ebx, ebx
je 0x10040408
push str.AddDllDirectory
push dword [ebp - 0x34]
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
je 0x10040408
push 0x800
push 0
push str.ADVAPI32.DLL
mov ecx, ebx
call dword [0x101d3368]
call ebx
mov esi, eax
jmp 0x100404a9
push 0
push 0
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
mov dword [ebp - 0x34], eax
test eax, eax
je 0x10040549
add eax, 0xd
push eax
call fcn.10198880
add esp, 4
mov dword [ebp - 0x2c], eax
test eax, eax
je 0x100404a0
push dword [ebp - 0x34]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
test eax, eax
je 0x1004049d
mov esi, dword [ebp - 0x2c]
mov ecx, esi
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x10040446
sub ecx, edx
mov eax, 0x5c
mov edx, esi
mov word [ecx + esi], ax
lea ecx, [edx + 1]
nop dword [eax]
mov al, byte [edx]
inc edx
test al, al
jne 0x10040460
sub edx, ecx
mov ecx, str.ADVAPI32.DLL
sub edx, ecx
add edx, esi
mov al, byte [ecx]
lea ecx, [ecx + 1]
mov byte [ecx + edx - 1], al
test al, al
jne 0x10040472
test ebx, ebx
je 0x10040494
push 8
push 0
push esi
mov ecx, ebx
call dword [0x101d3368]
call ebx
jmp 0x1004049b
push esi
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov esi, eax
mov eax, dword [ebp - 0x2c]
push eax
call fcn.1018f160
add esp, 4
test esi, esi
je 0x10040549
push str.SystemFunction036
push esi
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov ebx, eax
test ebx, ebx
je 0x100404e2
push 4
lea eax, [ebp - 0x3c]
mov ecx, ebx
push eax
call dword [0x101d3368]
call ebx
xor ecx, ecx
cmp al, 1
mov eax, 1
cmove ecx, eax
mov dword [ebp - 0x30], ecx
push esi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
cmp dword [ebp - 0x30], 0
je 0x10040549
mov esi, dword [ebp - 0x3c]
push str.EXPAT_ENTROPY_DEBUG
call fcn.101adfe1
add esp, 4
test eax, eax
je 0x100405cb
mov ecx, 0x101fb254
nop dword [eax]
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x10040530
test dl, dl
je 0x1004052c
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x10040530
add eax, 2
add ecx, 2
test dl, dl
jne 0x10040510
xor eax, eax
jmp 0x10040535
sbb eax, eax
or eax, 1
test eax, eax
jne 0x100405cb
push 4
push esi
push 8
push str.RtlGenRandom
jmp 0x100405b3
lea eax, [ebp - 0x38]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemTimeAsFileTime]
mov esi, dword [ebp - 0x38]
xor esi, dword [ebp - 0x34]
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
xor eax, esi
push str.EXPAT_ENTROPY_DEBUG
mov dword [ebp - 0x3c], eax
imul esi, eax, 0x7fffffff
call fcn.101adfe1
add esp, 4
test eax, eax
je 0x100405cb
mov ecx, 0x101fb254
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x100405a0
test dl, dl
je 0x1004059c
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x100405a0
add eax, 2
add ecx, 2
test dl, dl
jne 0x10040580
xor eax, eax
jmp 0x100405a5
sbb eax, eax
or eax, 1
test eax, eax
jne 0x100405cb
push 4
push esi
push 8
push str.fallback_4_
push str.Entropy:__s_____0x_0lx___lu_bytes__n
push 2
call fcn.101983b8
add esp, 4
push eax
call fcn.1000fa08
add esp, 0x18
mov ebx, dword [ebp + 0xc]
mov dword [edi + 0x1ec], esi
mov esi, dword [ebp - 0x40]
cmp byte [edi + 0xe8], 0
je 0x100405fa
mov ecx, edi
call fcn.10124129
test al, al
jne 0x100405fa
mov dword [edi + 0x118], 1
jmp 0x100409ce
mov dword [edi + 0x1dc], 1
mov edx, ebx
mov ecx, edi
lfence
call fcn.1011ed68
test eax, eax
je 0x100409ce
push ebx
push esi
push eax
call fcn.10187960
mov eax, dword [edi + 0x1dc]
add esp, 0xc
mov ebx, 1
sub eax, 0
je 0x10040653
sub eax, 2
je 0x1004034f
sub eax, ebx
jne 0x10040910
mov dword [edi + 0x118], 0x21
jmp 0x100409ce
cmp dword [edi + 0x1d8], 0
jne 0x10040910
cmp dword [edi + 0x1ec], 0
jne 0x100408f1
push str.kernel32
mov dword [ebp - 0x3c], 0
xor esi, esi
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
mov dword [ebp - 0x40], eax
test eax, eax
je 0x10040869
push 0x10206fc4
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
push 0x10206fe4
push str.ADVAPI32.DLL
mov dword [ebp - 0x30], eax
call fcn.101b2a3e
add esp, 8
test eax, eax
je 0x100406e4
mov esi, dword [ebp - 0x30]
test esi, esi
je 0x100406d2
push 8
push 0
push str.ADVAPI32.DLL
mov ecx, esi
call dword [0x101d3368]
call esi
mov esi, eax
jmp 0x100407ce
push str.ADVAPI32.DLL
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov esi, eax
jmp 0x100407ce
cmp dword [ebp - 0x30], esi
je 0x1004071b
push str.AddDllDirectory
push dword [ebp - 0x40]
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
je 0x1004071b
mov esi, dword [ebp - 0x30]
mov ecx, esi
push 0x800
push 0
push str.ADVAPI32.DLL
call dword [0x101d3368]
call esi
mov esi, eax
jmp 0x100407ce
push 0
push 0
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
mov dword [ebp - 0x40], eax
test eax, eax
je 0x10040869
add eax, 0xd
push eax
call fcn.10198880
add esp, 4
mov dword [ebp - 0x2c], eax
test eax, eax
je 0x100407c5
push dword [ebp - 0x40]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
test eax, eax
je 0x100407c2
mov esi, dword [ebp - 0x2c]
mov ecx, esi
lea edx, [ecx + 1]
nop dword [eax]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x10040760
sub ecx, edx
mov eax, 0x5c
mov edx, esi
mov word [ecx + esi], ax
lea ecx, [edx + 1]
mov al, byte [edx]
inc edx
test al, al
jne 0x10040777
sub edx, ecx
mov ecx, str.ADVAPI32.DLL
sub edx, ecx
add edx, esi
nop dword [eax]
mov al, byte [ecx]
lea ecx, [ecx + 1]
mov byte [ecx + edx - 1], al
test al, al
jne 0x10040790
mov esi, dword [ebp - 0x30]
test esi, esi
je 0x100407b7
push 8
push 0
push dword [ebp - 0x2c]
mov ecx, esi
call dword [0x101d3368]
call esi
jmp 0x100407c0
push dword [ebp - 0x2c]
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov esi, eax
mov eax, dword [ebp - 0x2c]
push eax
call fcn.1018f160
add esp, 4
test esi, esi
je 0x10040869
push str.SystemFunction036
push esi
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [ebp - 0x40], eax
test eax, eax
je 0x10040806
push 4
lea ecx, [ebp - 0x34]
push ecx
mov ecx, eax
call dword [0x101d3368]
call dword [ebp - 0x40]
xor ecx, ecx
cmp al, 1
mov eax, ebx
cmove ecx, eax
mov dword [ebp - 0x3c], ecx
push esi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
cmp dword [ebp - 0x3c], 0
je 0x10040869
mov esi, dword [ebp - 0x34]
push str.EXPAT_ENTROPY_DEBUG
call fcn.101adfe1
add esp, 4
test eax, eax
je 0x100408eb
mov ecx, 0x101fb254
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x10040850
test dl, dl
je 0x1004084c
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x10040850
add eax, 2
add ecx, 2
test dl, dl
jne 0x10040830
xor eax, eax
jmp 0x10040855
sbb eax, eax
or eax, 1
test eax, eax
jne 0x100408eb
push 4
push esi
push 8
push str.RtlGenRandom
jmp 0x100408d3
lea eax, [ebp - 0x44]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemTimeAsFileTime]
mov esi, dword [ebp - 0x44]
xor esi, dword [ebp - 0x40]
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
xor eax, esi
push str.EXPAT_ENTROPY_DEBUG
mov dword [ebp - 0x34], eax
imul esi, eax, 0x7fffffff
call fcn.101adfe1
add esp, 4
test eax, eax
je 0x100408eb
mov ecx, 0x101fb254
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x100408c0
test dl, dl
je 0x100408bc
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x100408c0
add eax, 2
add ecx, 2
test dl, dl
jne 0x100408a0
xor eax, eax
jmp 0x100408c5
sbb eax, eax
or eax, 1
test eax, eax
jne 0x100408eb
push 4
push esi
push 8
push str.fallback_4_
push str.Entropy:__s_____0x_0lx___lu_bytes__n
push 2
call fcn.101983b8
add esp, 4
push eax
call fcn.1000fa08
add esp, 0x18
mov dword [edi + 0x1ec], esi
cmp byte [edi + 0xe8], 0
je 0x10040910
mov ecx, edi
call fcn.10124129
test al, al
jne 0x10040910
mov dword [edi + 0x118], ebx
jmp 0x100409ce
mov esi, dword [ebp + 0xc]
lea edx, [edi + 0x18]
add dword [edi + 0x1c], esi
mov eax, dword [edi + 0x1c]
mov ecx, dword [edx]
add dword [edi + 0x24], esi
mov esi, dword [edi + 0x114]
push edx
push eax
push ecx
mov dword [edi + 0x124], ecx
mov ecx, esi
push edi
mov dword [edi + 0x1dc], ebx
mov dword [edi + 0x28], eax
mov byte [edi + 0x1e0], bl
call dword [0x101d3368]
call esi
add esp, 0x10
mov dword [edi + 0x118], eax
test eax, eax
je 0x1004096f
mov eax, dword [edi + 0x11c]
mov dword [edi + 0x120], eax
mov dword [edi + 0x114], 0x101230c0
jmp 0x100409ce
mov eax, dword [edi + 0x1dc]
test eax, eax
js 0x10040986
cmp eax, 1
jle 0x100409b8
cmp eax, 3
jne 0x10040986
lea ebx, [eax - 1]
mov esi, dword [edi + 0x90]
lea eax, [edi + 0x194]
push eax
push dword [edi + 0x18]
push dword [edi + 0x124]
push esi
mov esi, dword [esi + 0x30]
mov ecx, esi
call dword [0x101d3368]
call esi
mov eax, dword [edi + 0x18]
add esp, 0x10
mov dword [edi + 0x124], eax
jmp 0x100409d0
mov dword [edi + 0x1dc], 2
jmp 0x100409d0
mov dword [edi + 0x118], 0x29
xor ebx, ebx
mov esi, dword [ebp - 0x4c]
mov eax, dword [esi + 0x34]
mov dword [esi + 0x38], eax
test ebx, ebx
je 0x10040ab5
mov byte [ebp - 4], 6
test edi, edi
je 0x100409f0
mov ecx, edi
call fcn.1011ebcb
mov eax, esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.10186332
mov esp, ebp
pop ebp
ret 8
push str.Data_to_parse_required
lea ecx, [ebp - 0x48]
call fcn.1001cc52
push 0x10229dbc
lea eax, [ebp - 0x48]
push eax
call fcn.101878e5
lea ecx, [ebp - 0xf0]
call fcn.100039d0
push ecx
mov ecx, eax
mov byte [ebp - 4], 3
call fcn.10041100
push 0x10002580
mov ecx, eax
call fcn.10006200
push ecx
mov ecx, eax
call fcn.10006230
push str.C:dvsp4_build_swgcomp_rel_srcApplicationOntologycommon_srcxml_parse.cpp
mov ecx, eax
call fcn.100061e0
push 0x101e86cc
mov ecx, eax
call fcn.100061e0
lea ecx, [ebp - 0x34]
mov dword [ebp - 0x34], 0x3b
push ecx
mov ecx, eax
call fcn.10006250
push 0x101e86d0
mov ecx, eax
call fcn.100061e0
lea ecx, [ebp - 0x28]
push ecx
mov ecx, eax
call fcn.100039b0
lea eax, [ebp - 0x28]
mov byte [ebp - 4], 4
push eax
lea ecx, [ebp - 0x48]
call fcn.10001430
push 0x10229d38
lea eax, [ebp - 0x48]
push eax
call fcn.101878e5
mov ecx, edi
call fcn.1011efc9
mov ecx, edi
mov esi, eax
call fcn.1011ef72
push esi
push eax
lea ecx, [ebp - 0x48]
call fcn.100400a0
push 0x10229fa8
lea eax, [ebp - 0x48]
push eax
call fcn.101878e5
int3