Function at 0x40d4c0
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xffffffc0
sub esp, 0x874
mov eax, dword [0x4a99c8]
xor eax, esp
mov dword [esp + 0x870], eax
mov eax, dword [ebp + 8]
mov ecx, dword [ebp + 0x1c]
push ebx
mov ebx, dword [ebp + 0x20]
push esi
mov esi, dword [ebp + 0x14]
mov dword [esp + 0x44], eax
mov eax, dword [ebp + 0xc]
push edi
mov edi, dword [ebp + 0x10]
mov dword [esp + 0x44], eax
mov eax, dword [ebp + 0x18]
mov dword [esp + 0x4c], eax
mov eax, dword [ebp + 0x24]
push 0x35f00
mov dword [esp + 0x40], eax
mov eax, dword [ecx + 4]
push 0
push ebx
mov dword [esp + 0x64], ecx
mov dword [esp + 0x44], ebx
mov dword [esp + 0x6c], 0
mov dword [esp + 0x4c], 0
mov dword [esp + 0x40], eax
call fcn.0041db20
push 0x24
call fcn.004039a0
push 0x410ab0
mov dword [ebx], eax
call fcn.00414df0
mov dword [ebx + 4], eax
add esp, 0x14
mov ebx, dword [esi + 0x98]
mov dword [esp + 0x54], ebx
test ebx, ebx
je 0x40dc28
mov esi, dword [esi + 0x9c]
test esi, esi
je 0x40dc28
mov eax, dword [esp + 0x48]
cmp dword [eax + 0x180], 0
je 0x40dc5a
test esi, esi
js 0x40dc5a
push dword [esp + 0x44]
lea eax, [esi + ebx]
mov dword [esp + 0x60], eax
call fcn.00403670
add esp, 4
cmp eax, dword [esp + 0x5c]
jl 0x40dc5a
push dword [esp + 0x4c]
push edi
call fcn.00408390
mov edi, eax
add esp, 8
cmp ebx, edi
jl 0x40d5be
mov eax, dword [esp + 0x38]
mov dword [eax + 0x14], 1
push dword [esp + 0x44]
call fcn.00403670
add esp, 4
cmp eax, edi
jle 0x40d5e0
push dword [esp + 0x44]
call fcn.00403670
add esp, 4
sub eax, edi
mov dword [esp + 0x40], eax
mov eax, dword [esp + 0x38]
push ebx
push dword [esp + 0x48]
mov dword [eax + 8], esi
call fcn.004037b0
add esp, 8
test eax, eax
js 0x40dc5a
mov eax, dword [esp + 0x34]
test eax, eax
je 0x40d6d5
push str.CertificateInfo
push eax
call fcn.0041a180
mov eax, dword [esp + 0x60]
push dword [eax]
push str.CertFile____:__s
push dword [esp + 0x44]
call fcn.0041a710
push dword [esp + 0x58]
call fcn.00403670
push eax
push str.FileSize____:__d
push dword [esp + 0x54]
call fcn.0041a710
push edi
push str.SectionSize_:__d
push dword [esp + 0x60]
call fcn.0041a710
mov eax, dword [esp + 0x68]
push dword [eax + 0x14]
push str.Overlay_____:__d
push dword [esp + 0x6c]
call fcn.0041a710
push dword [esp + 0x7c]
push str.Overlay_size:__d
push dword [esp + 0x78]
call fcn.0041a710
add esp, 0x48
push ebx
push str.CertOffset__:__d
push dword [esp + 0x3c]
call fcn.0041a710
push esi
push str.CertSize____:__d
push dword [esp + 0x48]
call fcn.0041a710
add esp, 0x18
push esi
push dword [esp + 0x48]
call fcn.00403550
add esp, 4
push eax
call fcn.004182a0
mov eax, dword [esp + 0x40]
fstp qword [esp + 0x70]
movsd xmm0, qword [esp + 0x70]
movsd qword [esp], xmm0
push str.Entropy_____:__g
push dword [esp + 0x40]
movsd qword [eax + 0x18], xmm0
call fcn.0041a710
add esp, 0x10
cmp esi, dword [esp + 0x40]
jge 0x40d6f4
mov eax, dword [esp + 0x38]
push 0x39
push dword [esp + 0x40]
mov dword [eax + 0x28], 1
call fcn.00408650
add esp, 8
cmp esi, 0x4e20
mov esi, dword [esp + 0x3c]
jle 0x40d70b
push 0x37
push esi
call fcn.00408650
add esp, 8
lea eax, [edi + 1]
cmp ebx, eax
jle 0x40d728
mov eax, dword [esp + 0x38]
push 0x38
push esi
mov dword [eax + 0x2c], 1
call fcn.00408650
add esp, 8
cmp ebx, dword [esp + 0x5c]
jge 0x40dc5a
xor eax, eax
mov edi, dword [esp + 0x44]
push ebx
push edi
mov dword [esp + 0x70], eax
call fcn.004037b0
add esp, 8
test eax, eax
js 0x40dc1b
push edi
call fcn.00403620
add esp, 4
cmp eax, 8
jl 0x40dc1b
push edi
call fcn.00403590
mov esi, eax
add esp, 4
mov dword [esp + 0x64], esi
test esi, esi
js 0x40dc1b
cmp esi, 0xfa00
jg 0x40dc1b
push edi
call fcn.00403700
push edi
mov dword [esp + 0x48], eax
call fcn.00403700
add esp, 8
mov edi, eax
sub esi, 8
mov dword [esp + 0x50], esi
js 0x40dbe8
cmp edi, 1
je 0x40d7b3
cmp edi, 2
jne 0x40db70
mov ecx, dword [esp + 0x38]
mov eax, dword [esp + 0x40]
push dword [esp + 0x44]
mov dword [ecx + 0xc], edi
mov dword [ecx + 0x10], eax
call fcn.00403620
add esp, 4
cmp eax, esi
jl 0x40dbe1
push dword [esp + 0x44]
call fcn.00403550
add esp, 4
mov dword [esp + 0x4c], eax
test eax, eax
je 0x40dbda
mov edx, dword [esp + 0x48]
cmp dword [edx + 0x190], 0
je 0x40d886
mov eax, dword [esp + 0x58]
push 0x5c
mov esi, dword [eax]
push esi
call fcn.0041dc80
add esp, 8
test eax, eax
je 0x40d816
inc eax
jmp 0x40d818
mov eax, esi
mov ecx, dword [esp + 0x48]
push eax
lea eax, [esp + 0x7c]
mov ecx, dword [ecx + 0x18c]
test ecx, ecx
je 0x40d841
push ecx
push str._s_s.cert
push 0x800
push eax
call fcn.00401010
add esp, 0x14
jmp 0x40d854
push str._s.cert
push 0x800
push eax
call fcn.00401010
add esp, 0x10
lea eax, [esp + 0x78]
push 0x4555c8
push eax
call fcn.004248c6
mov esi, eax
push esi
push 1
push dword [esp + 0x60]
push dword [esp + 0x60]
call fcn.0042b7e5
push esi
call fcn.004247a0
mov esi, dword [esp + 0x6c]
add esp, 0x1c
mov eax, dword [esp + 0x4c]
push esi
push eax
call fcn.004182a0
mov eax, dword [esp + 0x40]
push 0
push esi
push dword [esp + 0x5c]
fstp qword [eax + 0x18]
call fcn.00411800
add esp, 0x14
test eax, eax
js 0x40dba7
mov eax, dword [esp + 0x34]
test eax, eax
je 0x40d956
push str.Certificate
push eax
call fcn.0041a220
push esi
push str.Length___:__d
push dword [esp + 0x44]
call fcn.0041a710
mov eax, dword [esp + 0x54]
sar eax, 8
push eax
push str.Revision_:__d
push dword [esp + 0x50]
call fcn.0041a710
add esp, 0x20
cmp edi, 1
jne 0x40d903
mov edi, dword [esp + 0x34]
push str.Type_____:_x509
push edi
call fcn.0041a710
add esp, 8
jmp 0x40d92f
cmp edi, 2
jne 0x40d91c
mov edi, dword [esp + 0x34]
push str.Type_____:_PKS7
push edi
call fcn.0041a710
add esp, 8
jmp 0x40d92f
push edi
mov edi, dword [esp + 0x38]
push str.Type_____:__d___invalid_cert_
push edi
call fcn.0041a710
add esp, 0xc
mov eax, dword [esp + 0x38]
sub esp, 8
movsd xmm0, qword [eax + 0x18]
movsd qword [esp], xmm0
push str.Entropy__:__g
push edi
call fcn.0041a710
push edi
call fcn.0041a5c0
add esp, 0x14
jmp 0x40d958
mov edi, eax
mov eax, dword [esp + 0x48]
cmp dword [eax + 0x198], 0
jne 0x40d96b
cmp dword [eax + 0x78], 0
je 0x40d9aa
xor esi, esi
cmp dword [0x4ab1a4], esi
jle 0x40d9a6
mov ebx, dword [esp + 0x50]
mov edi, dword [esp + 0x4c]
nop dword [eax]
push ebx
push edi
push dword [esi*4 + 0x4aada0]
call fcn.00414f40
add esp, 0xc
test eax, eax
jne 0x40d99e
inc esi
cmp esi, dword [0x4ab1a4]
jl 0x40d980
mov ebx, dword [esp + 0x54]
mov edi, dword [esp + 0x34]
mov esi, dword [esp + 0x50]
mov ecx, dword [esp + 0x48]
mov eax, dword [esp + 0x38]
add eax, 0x30
mov dword [esp + 0x40], eax
push dword [ecx + 0x74]
push eax
push esi
push dword [esp + 0x58]
call fcn.00411900
add esp, 0x10
test eax, eax
js 0x40db77
lea eax, [esp + 0x70]
push eax
call fcn.00424ac8
mov eax, dword [esp + 0x44]
xor edi, edi
add esp, 4
cmp dword [eax], edi
jle 0x40da39
mov esi, dword [esp + 0x38]
mov ebx, eax
add esi, 0x1118
mov eax, dword [esi + 8]
cmp eax, dword [esp + 0x70]
jae 0x40da0c
push 0x3a
push dword [esp + 0x40]
call fcn.00408650
add esp, 8
mov eax, dword [esi]
cmp eax, dword [esp + 0x70]
jbe 0x40da22
push 0x3a
push dword [esp + 0x40]
call fcn.00408650
add esp, 8
inc edi
add esi, 0x6bd8
cmp edi, dword [ebx]
jl 0x40d9f5
mov ebx, dword [esp + 0x54]
mov esi, dword [esp + 0x50]
mov eax, dword [esp + 0x40]
mov ecx, dword [esp + 0x34]
test ecx, ecx
je 0x40da52
mov edx, dword [esp + 0x48]
push dword [edx + 0x74]
push eax
push ecx
call fcn.00411aa0
add esp, 0xc
mov eax, dword [esp + 0x48]
cmp dword [eax + 0x188], 0
je 0x40dadd
push dword [eax + 0x74]
push dword [eax + 0x184]
mov eax, dword [esp + 0x60]
push dword [esp + 0x48]
add eax, 0x5fffb8
push eax
push str.FileMD5
push str.PKCS7
push 0
call fcn.00411590
mov edi, eax
push edi
push 0
call fcn.00416c90
mov edx, eax
add esp, 0x24
mov eax, dword [esp + 0x38]
mov dword [eax + 0x35ef8], edx
test edx, edx
je 0x40dace
mov ecx, edx
lea eax, [ecx + 1]
mov dword [esp + 0x54], eax
nop dword [eax]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x40dab0
sub ecx, dword [esp + 0x54]
mov eax, dword [esp + 0x38]
mov byte [edx + ecx], 0xa
mov eax, dword [eax + 0x35ef8]
mov byte [eax + ecx + 1], 0
push edi
push 0
call fcn.004169d0
mov eax, dword [esp + 0x50]
add esp, 8
cmp dword [eax + 0x194], 0
je 0x40db24
push dword [eax + 0x74]
mov edi, dword [esp + 0x3c]
push 0
push dword [edi]
push esi
push dword [esp + 0x5c]
call fcn.00410ad0
push dword [edi + 4]
push 1
push dword [edi]
push 0
call fcn.00411170
mov eax, dword [esp + 0x6c]
add esp, 0x24
cmp dword [eax + 0x198], 0
je 0x40db24
push dword [edi + 4]
call fcn.00410d80
add esp, 4
add ebx, dword [esp + 0x64]
mov dword [esp + 0x54], ebx
test bl, 7
je 0x40db3b
inc ebx
test bl, 7
jne 0x40db31
mov dword [esp + 0x54], ebx
mov eax, dword [esp + 0x60]
inc eax
cmp dword [esp + 0x68], 0
mov dword [esp + 0x60], eax
jge 0x40dc5a
cmp ebx, dword [esp + 0x5c]
jl 0x40d734
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x870]
xor ecx, esp
call fcn.0041c143
mov esp, ebp
pop ebp
ret
push str.Warning__:_invalid_cert_type
jmp 0x40dbed
push 0x37
push dword [esp + 0x40]
call fcn.00408650
push str.Warning__:_Invalid_x509
push edi
call fcn.0041a710
add esp, 0x10
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x870]
xor ecx, esp
call fcn.0041c143
mov esp, ebp
pop ebp
ret
push 0x37
push dword [esp + 0x40]
call fcn.00408650
push str.Warning__:_Invalid_PKCS7
push dword [esp + 0x40]
call fcn.0041a710
add esp, 0x10
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x870]
xor ecx, esp
call fcn.0041c143
mov esp, ebp
pop ebp
ret
push str.Warning__:_cert_not_found
jmp 0x40dbed
push str.Warning__:_invalid_cert_size
jmp 0x40dbed
push str.Warning__:_invalid_cert_len
push dword [esp + 0x38]
call fcn.0041a710
push 0x37
push dword [esp + 0x48]
call fcn.00408650
add esp, 0x10
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x870]
xor ecx, esp
call fcn.0041c143
mov esp, ebp
pop ebp
ret
push 0x37
push dword [esp + 0x40]
call fcn.00408650
jmp 0x40dc57
push dword [esp + 0x4c]
push edi
call fcn.00408390
mov ebx, dword [esp + 0x4c]
mov esi, eax
push ebx
call fcn.00403670
add esp, 0xc
cmp eax, esi
jle 0x40dc5a
mov eax, dword [esp + 0x38]
push esi
push ebx
mov dword [eax + 0x14], 1
call fcn.004037b0
add esp, 8
mov ecx, dword [esp + 0x87c]
xor eax, eax
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.0041c143
mov esp, ebp
pop ebp
ret