Function at 0x407a7e
Capabilities:
Check http status code
Get session user name
Impersonate user
Initialize winhttp library
Prepare http request
Read file on windows
Read http header
Receive http response
Resolve function by parsing pe exports
Terminate process

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
mov eax, 0x3c4c
call fcn.004225c8
mov eax, dword [0x42e058]
xor eax, esp
mov dword [esp + 0x3c48], eax
mov eax, dword [ebp + 0x18]
xorps xmm0, xmm0
or dword [esp], 0xffffffff
push ebx
mov ebx, dword [ebp + 0x20]
push esi
push edi
mov dword [esp + 0x38], ecx
lea edi, [esp + 0xa4]
mov dword [esp + 0x20], eax
xor eax, eax
push 8
pop ecx
rep stosd dword es:[edi], eax
mov dword [esp + 0x1c], eax
mov byte [esp + 0x17], al
mov byte [esp + 0x44], al
mov dword [esp + 0x28], eax
mov dword [esp + 0x40], eax
mov dword [esp + 0x10], eax
mov dword [esp + 0x24], eax
mov dword [esp + 0x30], eax
inc eax
mov dword [esp + 0x34], edx
movlpd qword [esp + 0x48], xmm0
mov dword [esp + 0x80], 0x100
mov dword [esp + 0xa4], 0x20
mov dword [esp + 0xa8], eax
call fcn.004053d2
mov eax, dword [0x42f218]
lea edx, [esp + 0x1c]
push edx
push str.system:write
push eax
mov ecx, dword [eax]
call dword [ecx + 0x20]
mov esi, eax
test esi, esi
js 0x407b82
mov esi, 0x25f8
lea eax, [esp + 0x100]
push esi
push 0
push eax
call fcn.00412c31
mov edi, dword [esp + 0x40]
lea ecx, [esp + 0x10c]
add esp, 0xc
mov dword [esp + 0x100], esi
mov dword [esp + 0x104], 0x4000000
mov eax, dword [edi]
push ecx
push ebx
push 0
push edi
call dword [eax + 0x1c]
mov esi, eax
test esi, esi
js 0x407b82
mov eax, dword [edi]
push edi
call dword [eax + 0x18]
test eax, eax
je 0x407c26
mov esi, 0x80004004
mov edi, dword [esp + 0x10]
mov ebx, dword [esp + 0xc]
mov ecx, dword [esp + 0x34]
push ecx
mov eax, dword [ecx]
call dword [eax + 0x64]
mov eax, dword [esp + 0x24]
test eax, eax
je 0x407baa
push 0x8000
push 0
push eax
call dword [sym.imp.KERNEL32.dll_VirtualFree]
test edi, edi
je 0x407bb5
push edi
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov eax, dword [esp + 0x40]
test eax, eax
je 0x407bc4
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov eax, dword [esp + 0x28]
test eax, eax
je 0x407bd3
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
cmp ebx, 0xffffffff
je 0x407bdf
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp byte [esp + 0x17], 0
je 0x4086e0
xor ebx, ebx
push ebx
push ebx
call dword [sym.imp.ADVAPI32.dll_SetThreadToken]
test eax, eax
jne 0x4086e0
call dword [sym.imp.KERNEL32.dll_GetLastError]
movzx esi, ax
mov edx, 0xc0000015
or esi, 0x80070000
test eax, eax
push ecx
cmovle esi, eax
push ebx
push ebx
mov ecx, esi
call fcn.00402267
push esi
call dword [sym.imp.KERNEL32.dll_ExitProcess]
push dword [esp + 0x38]
mov eax, dword [ebx]
push ebx
call dword [eax + 8]
mov ebx, eax
lea eax, [esp + 0x80]
push eax
lea eax, [esp + 0x26fc]
mov dword [esp + 0x80], ebx
push eax
call dword [sym.imp.ADVAPI32.dll_GetUserNameA]
lea eax, [esp + 0x26f8]
mov dword [esp + 0xac], eax
lea eax, [esp + 0xa4]
push eax
push dword [esp + 0x3c]
call dword [sym.imp.USERENV.dll_LoadUserProfileA]
mov ecx, dword [esp + 0x44]
test eax, eax
push 1
pop eax
push dword [esp + 0x38]
movzx ecx, cl
cmovne ecx, eax
push 0
mov dword [esp + 0x4c], ecx
call dword [sym.imp.ADVAPI32.dll_SetThreadToken]
test eax, eax
jne 0x407cae
call dword [sym.imp.KERNEL32.dll_GetLastError]
movzx esi, ax
or esi, 0x80070000
test eax, eax
cmovle esi, eax
test esi, esi
js 0x407b82
xor ecx, ecx
inc ecx
mov byte [esp + 0x17], cl
cmp ebx, 2
je 0x408347
cmp ebx, 3
je 0x408347
cmp ebx, 4
jne 0x40833d
xor bl, bl
mov dword [esp + 0x2c], 0x824
mov byte [esp + 0x16], bl
lea eax, [esp + 0xc8]
push 0x38
xor ebx, ebx
push ebx
push eax
call fcn.00412c31
add esp, 0xc
mov dword [esp + 0xc4], 0x3c
lea eax, [esp + 0x27f8]
mov ecx, 0x104
mov dword [esp + 0xd4], eax
lea eax, [esp + 0x2a00]
mov dword [esp + 0xf0], eax
lea eax, [esp + 0xc4]
push eax
push 0x80000000
push ebx
lea eax, [esp + 0x16bc]
mov dword [esp + 0xe4], ecx
push eax
mov dword [esp + 0x104], ecx
call dword [sym.imp.WINHTTP.dll_WinHttpCrackUrl]
test eax, eax
jne 0x407d6d
call dword [sym.imp.KERNEL32.dll_GetLastError]
movzx esi, ax
mov edi, 0x80070000
or esi, edi
test eax, eax
cmovle esi, eax
test esi, esi
jns 0x407d72
mov edi, ebx
jmp 0x407b86
mov edi, 0x80070000
lea eax, [esp + 0x2c]
push eax
lea eax, [esp + 0x2c0c]
push eax
push 0x80000000
lea eax, [esp + 0xd0]
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpCreateUrl]
test eax, eax
jne 0x407daa
call dword [sym.imp.KERNEL32.dll_GetLastError]
movzx esi, ax
or esi, edi
test eax, eax
cmovle esi, eax
test esi, esi
js 0x407d66
push ebx
push ebx
push ebx
push ebx
push 0x42a80c
call dword [sym.imp.WINHTTP.dll_WinHttpOpen]
mov ebx, eax
mov dword [esp + 0x28], ebx
test ebx, ebx
jne 0x407ddb
call dword [sym.imp.KERNEL32.dll_GetLastError]
movzx esi, ax
or esi, edi
test eax, eax
cmovle esi, eax
test esi, esi
js 0x407b82
mov edi, dword [esp + 0x10]
xor al, al
mov byte [esp + 0x15], al
and dword [esp + 0x78], 0
and dword [esp + 0x3c], 0
mov dword [esp + 0x84], 4
test edi, edi
je 0x407e05
push edi
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
mov eax, dword [esp + 0x40]
test eax, eax
je 0x407e14
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpCloseHandle]
push 0
push 0
lea eax, [esp + 0x2800]
push eax
push ebx
call dword [sym.imp.WINHTTP.dll_WinHttpConnect]
mov ebx, eax
mov dword [esp + 0x40], ebx
test ebx, ebx
jne 0x407e4d
call dword [sym.imp.KERNEL32.dll_GetLastError]
movzx esi, ax
or esi, 0x80070000
test eax, eax
cmovle esi, eax
test esi, esi
js 0x407b86
xor eax, eax
push eax
push eax
push eax
push eax
lea eax, [esp + 0x2a10]
push eax
push 0x42aadc
push ebx
call dword [sym.imp.WINHTTP.dll_WinHttpOpenRequest]
mov edi, eax
mov dword [esp + 0x10], edi
test edi, edi
jne 0x407e8d
call dword [sym.imp.KERNEL32.dll_GetLastError]
movzx esi, ax
or esi, 0x80070000
test eax, eax
cmovle esi, eax
test esi, esi
js 0x407b86
xor ecx, ecx
mov ebx, ecx
xor eax, eax
mov dword [esp + 0x90], 3
lea edi, [esp + 0x54]
mov dword [esp + 0x94], ecx
stosd dword es:[edi], eax
xor edx, edx
inc edx
mov dword [esp + 0x98], ecx
mov dword [esp + 0x8c], edx
mov dword [esp + 0x9c], ecx
stosd dword es:[edi], eax
mov dword [esp + 0xa0], edx
stosd dword es:[edi], eax
xor eax, eax
lea edi, [esp + 0x60]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
mov eax, ebx
mov edi, ecx
sub eax, ecx
je 0x407f6f
sub eax, edx
je 0x407ef8
sub eax, edx
jne 0x407fde
mov dword [esp + 0x54], edx
mov edi, edx
jmp 0x407fcb
lea eax, [esp + 0x60]
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpGetIEProxyConfigForCurrentUser]
test eax, eax
je 0x407fde
cmp dword [esp + 0x68], 0
je 0x407fde
push 0x208
push 0
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
push 0x208
push 0
mov dword [esp + 0x60], eax
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov ecx, dword [esp + 0x58]
mov dword [esp + 0x5c], eax
test ecx, ecx
je 0x407fde
test eax, eax
je 0x407fde
push 0xffffffffffffffff
push dword [esp + 0x6c]
mov dword [esp + 0x5c], 3
push 0x104
push ecx
call fcn.00414347
add esp, 0x10
xor eax, eax
lea edi, [eax + 1]
jmp 0x407fcb
lea eax, [esp + 0x60]
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpGetIEProxyConfigForCurrentUser]
test eax, eax
je 0x407fde
cmp dword [esp + 0x60], 0
je 0x407fde
mov eax, dword [esp + 0x64]
test eax, eax
je 0x407f9c
or dword [esp + 0x8c], 2
mov dword [esp + 0x94], eax
xor eax, eax
inc eax
mov dword [esp + 0xa0], eax
lea eax, [esp + 0x54]
push eax
lea eax, [esp + 0x90]
push eax
lea eax, [esp + 0x2c10]
push eax
push dword [esp + 0x34]
call dword [sym.imp.WINHTTP.dll_WinHttpGetProxyForUrl]
mov edi, eax
test edi, edi
je 0x407fde
push 0xc
lea eax, [esp + 0x58]
push eax
push 0x26
push dword [esp + 0x34]
call dword [sym.imp.WINHTTP.dll_WinHttpSetOption]
cmp dword [esp + 0x64], 0
je 0x407ff4
push dword [esp + 0x64]
call dword [sym.imp.KERNEL32.dll_GlobalFree]
and dword [esp + 0x64], 0
cmp dword [esp + 0x68], 0
je 0x40800a
push dword [esp + 0x68]
call dword [sym.imp.KERNEL32.dll_GlobalFree]
and dword [esp + 0x68], 0
cmp dword [esp + 0x6c], 0
je 0x408020
push dword [esp + 0x6c]
call dword [sym.imp.KERNEL32.dll_GlobalFree]
and dword [esp + 0x6c], 0
mov ecx, dword [esp + 0x58]
test ecx, ecx
je 0x408037
push ecx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
xor ecx, ecx
mov dword [esp + 0x58], ecx
jmp 0x408039
xor ecx, ecx
mov eax, dword [esp + 0x5c]
test eax, eax
je 0x40804e
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
xor ecx, ecx
mov dword [esp + 0x5c], ecx
test edi, edi
mov edi, dword [esp + 0x10]
je 0x40806d
push ecx
push ecx
push ecx
push ecx
push ecx
push ecx
push edi
call dword [sym.imp.WINHTTP.dll_WinHttpSendRequest]
test eax, eax
jne 0x4081da
xor ecx, ecx
inc ebx
cmp ebx, 3
jb 0x407e91
mov bl, byte [esp + 0x16]
test bl, bl
jne 0x408087
test esi, esi
js 0x407b86
xor ebx, ebx
push ebx
push edi
call dword [sym.imp.WINHTTP.dll_WinHttpReceiveResponse]
test eax, eax
jne 0x40809d
test esi, esi
js 0x407b86
lea eax, [esp + 0x3c]
push eax
lea eax, [esp + 0x88]
push eax
lea eax, [esp + 0x80]
push eax
push ebx
push 0x20000013
push edi
call dword [sym.imp.WINHTTP.dll_WinHttpQueryHeaders]
test eax, eax
jne 0x4080df
call dword [sym.imp.KERNEL32.dll_GetLastError]
movzx esi, ax
or esi, 0x80070000
test eax, eax
cmovle esi, eax
test esi, esi
js 0x407b86
mov eax, dword [esp + 0x78]
cmp eax, 0x194
ja 0x4081f0
je 0x40824f
cmp eax, 0xc8
je 0x4081e8
cmp eax, 0x12c
jbe 0x408245
cmp eax, 0x12f
ja 0x40822d
lea eax, [esp + 0x3c]
mov dword [esp + 0x2c], 0x824
push eax
lea eax, [esp + 0x30]
mov dword [esp + 0x40], ebx
push eax
lea eax, [esp + 0x2c10]
push eax
push ebx
push 0x33
push edi
call dword [sym.imp.WINHTTP.dll_WinHttpQueryHeaders]
test eax, eax
jne 0x40815d
call dword [sym.imp.KERNEL32.dll_GetLastError]
movzx esi, ax
or esi, 0x80070000
test eax, eax
cmovle esi, eax
test esi, esi
js 0x407b86
lea eax, [esp + 0xc4]
push eax
push ebx
push ebx
lea eax, [esp + 0x2c14]
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpCrackUrl]
test eax, eax
jne 0x408195
call dword [sym.imp.KERNEL32.dll_GetLastError]
movzx esi, ax
or esi, 0x80070000
test eax, eax
cmovle esi, eax
test esi, esi
js 0x407b86
lea eax, [esp + 0x2c]
push eax
lea eax, [esp + 0x2c0c]
push eax
push 0x80000000
lea eax, [esp + 0xd0]
push eax
call dword [sym.imp.WINHTTP.dll_WinHttpCreateUrl]
test eax, eax
jne 0x4081d5
call dword [sym.imp.KERNEL32.dll_GetLastError]
movzx esi, ax
or esi, 0x80070000
test eax, eax
cmovle esi, eax
test esi, esi
js 0x407b86
xor eax, eax
inc eax
jmp 0x4081ea
xor eax, eax
lea ebx, [eax + 1]
mov byte [esp + 0x16], bl
jmp 0x40807b
mov al, bl
mov byte [esp + 0x15], al
jmp 0x40821c
cmp eax, 0x198
je 0x408213
cmp eax, 0x1f4
je 0x40824f
cmp eax, 0x1f5
jbe 0x408245
cmp eax, 0x1f7
jbe 0x40824f
cmp eax, 0x1f8
jne 0x408245
mov al, byte [esp + 0x15]
mov esi, 0x80070102
test esi, esi
jne 0x408259
test al, al
je 0x40825f
mov ebx, dword [esp + 0x28]
jmp 0x407de5
cmp eax, 0x191
je 0x40823b
cmp eax, 0x193
jne 0x408245
mov esi, 0x80070005
jmp 0x407b86
mov esi, 0x8000ffff
jmp 0x407b86
mov esi, 0x80070002
jmp 0x407b86
js 0x407b86
lea edx, [esp + 0x70]
mov ecx, edi
call fcn.00410437
mov esi, eax
test esi, esi
js 0x407b86
mov ecx, dword [ebp + 0x10]
test ecx, ecx
je 0x4082a8
mov eax, dword [esp + 0x74]
cmp eax, dword [ecx + 4]
jb 0x408309
jne 0x408292
mov eax, dword [esp + 0x70]
cmp eax, dword [ecx]
jbe 0x408309
mov ecx, dword [esp + 0x34]
push ebx
push ebx
push ebx
mov eax, dword [ecx]
push ebx
push ecx
call dword [eax + 0x50]
xorps xmm0, xmm0
movlpd qword [ebp + 8], xmm0
push ebx
lea eax, [esp + 0x1c]
mov dword [esp + 0x1c], 4
push eax
lea eax, [esp + 0x90]
mov esi, ebx
push eax
push ebx
push 0x20000005
push edi
call dword [sym.imp.WINHTTP.dll_WinHttpQueryHeaders]
test eax, eax
jne 0x4082ed
call dword [sym.imp.KERNEL32.dll_GetLastError]
movzx esi, ax
or esi, 0x80070000
test eax, eax
cmovle esi, eax
test esi, esi
js 0x407b86
mov eax, dword [esp + 0x88]
mov dword [esp + 0x48], eax
mov dword [esp + 0x4c], ebx
test esi, esi
js 0x407b86
jmp 0x408482
mov edi, ebx
cmp dword [ebp + 0x1c], ebx
jbe 0x408336
mov eax, dword [esp + 0x20]
push ebx
push ebx
push ecx
mov edx, dword [eax + edi*4]
push ecx
mov ecx, dword [esp + 0x2c]
push 3
call fcn.0040d975
mov esi, eax
test esi, esi
js 0x407b82
inc edi
cmp edi, dword [ebp + 0x1c]
jb 0x408310
mov esi, ebx
jmp 0x407b82
mov esi, 0x8007000f
jmp 0x407b82
mov eax, 0x8000080
cmp ebx, 2
jne 0x40835a
cmp dword [0x42f22c], 0
je 0x408368
cmp ebx, 3
jne 0x40836d
cmp dword [0x42f234], 0
jne 0x40836d
mov eax, 0x28000080
push 0
push eax
push 3
push 0
push ecx
push 0x80000000
lea eax, [esp + 0x16c8]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
mov dword [esp + 0xc], ebx
cmp ebx, 0xffffffff
jne 0x4083af
call dword [sym.imp.KERNEL32.dll_GetLastError]
movzx esi, ax
or esi, 0x80070000
test eax, eax
cmovle esi, eax
test esi, esi
js 0x4086d7
lea edx, [esp + 0x70]
mov ecx, ebx
call fcn.0040f3f4
mov esi, eax
test esi, esi
js 0x4086d7
mov ecx, dword [ebp + 0x10]
test ecx, ecx
je 0x4083f2
mov eax, dword [esp + 0x74]
cmp eax, dword [ecx + 4]
jb 0x408448
jne 0x4083de
mov eax, dword [esp + 0x70]
cmp eax, dword [ecx]
jbe 0x408448
mov eax, dword [edi]
xor ecx, ecx
push ecx
push ecx
push ecx
push ecx
push edi
call dword [eax + 0x50]
xorps xmm0, xmm0
movlpd qword [ebp + 8], xmm0
lea edx, [esp + 0x48]
mov ecx, ebx
call fcn.0040e32b
mov esi, eax
test esi, esi
js 0x4086d7
mov eax, dword [ebp + 0xc]
test eax, eax
jl 0x408480
mov edi, dword [ebp + 8]
jg 0x408417
test edi, edi
je 0x408444
push 0
push 0
push eax
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
jne 0x408444
call dword [sym.imp.KERNEL32.dll_GetLastError]
movzx esi, ax
or esi, 0x80070000
test eax, eax
cmovle esi, eax
test esi, esi
js 0x4086d7
xor ebx, ebx
jmp 0x408485
xor edi, edi
cmp dword [ebp + 0x1c], edi
jbe 0x408477
mov eax, dword [esp + 0x20]
push 0
push 0
push ecx
mov edx, dword [eax + edi*4]
push ecx
mov ecx, dword [esp + 0x2c]
push 3
call fcn.0040d975
mov esi, eax
test esi, esi
js 0x4086d7
inc edi
cmp edi, dword [ebp + 0x1c]
jb 0x40844f
xor esi, esi
mov edi, esi
jmp 0x407b8a
xor ebx, ebx
mov edi, dword [ebp + 8]
mov eax, ebx
mov ebx, dword [ebp + 0x1c]
mov dword [esp + 0x18], eax
test ebx, ebx
je 0x4084c7
mov ecx, dword [esp + 0x20]
lea edx, [esp + 0x70]
push edx
push dword [ebp + 0xc]
mov eax, dword [ecx + eax*4]
push edi
push dword [esp + 0x58]
push dword [esp + 0x58]
mov ecx, dword [eax]
push eax
call dword [ecx + 0x24]
mov esi, eax
test esi, esi
js 0x407b82
mov eax, dword [esp + 0x18]
inc eax
mov dword [esp + 0x18], eax
cmp eax, ebx
jb 0x408492
cmp dword [esp + 0x48], 0
jne 0x40852f
cmp dword [esp + 0x4c], 0
jne 0x40852f
xor edi, edi
test ebx, ebx
je 0x4086d0
push 0
push 0
push ecx
xor eax, eax
push ecx
mov ecx, dword [esp + 0x2c]
inc eax
push eax
mov eax, dword [esp + 0x34]
mov edx, dword [eax + edi*4]
call fcn.0040d975
mov esi, eax
test esi, esi
js 0x407b82
mov eax, dword [esp + 0x20]
push 0
push 0
push ecx
mov edx, dword [eax + edi*4]
push ecx
mov ecx, dword [esp + 0x2c]
push 2
call fcn.0040d975
mov esi, eax
test esi, esi
js 0x407b82
inc edi
cmp edi, ebx
jb 0x4084df
jmp 0x4086d0
mov eax, dword [esp + 0x7c]
dec eax
sub eax, 1
je 0x40855a
sub eax, 1
je 0x408552
sub eax, 1
je 0x40854a
mov edi, 0x10000
jmp 0x408570
mov edi, dword [0x42f240]
jmp 0x408560
mov edi, dword [0x42f238]
jmp 0x408560
mov edi, dword [0x42f230]
mov ecx, dword [0x42f224]
dec edi
add edi, ecx
lea eax, [ecx - 1]
not eax
and edi, eax
push 4
push 0x3000
push edi
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov dword [esp + 0x24], eax
test eax, eax
jne 0x408699
call dword [sym.imp.KERNEL32.dll_GetLastError]
movzx esi, ax
or esi, 0x80070000
test eax, eax
cmovle esi, eax
test esi, esi
js 0x407b82
jmp 0x408699
mov ecx, dword [esp + 0x34]
push ecx
mov eax, dword [ecx]
call dword [eax + 0x18]
test eax, eax
jne 0x4086a3
mov eax, dword [esp + 0x7c]
cmp eax, 2
je 0x4085e3
cmp eax, 3
je 0x4085e3
lea eax, [esp + 0x30]
push eax
push edi
push dword [esp + 0x2c]
push dword [esp + 0x1c]
call dword [sym.imp.WINHTTP.dll_WinHttpReadData]
jmp 0x4085f9
push 0
lea eax, [esp + 0x34]
push eax
push edi
push dword [esp + 0x30]
push dword [esp + 0x1c]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x408619
call dword [sym.imp.KERNEL32.dll_GetLastError]
movzx esi, ax
or esi, 0x80070000
test eax, eax
cmovle esi, eax
test esi, esi
js 0x407b82
mov ecx, dword [esp + 0x30]
xor eax, eax
mov dword [esp + 0x18], eax
test ecx, ecx
je 0x408661
test ebx, ebx
je 0x408699
push ecx
push dword [esp + 0x28]
push ecx
push ecx
mov ecx, dword [esp + 0x30]
push 1
mov edx, dword [ecx + eax*4]
mov ecx, dword [esp + 0x30]
call fcn.0040d975
mov esi, eax
test esi, esi
js 0x407b82
mov eax, dword [esp + 0x18]
inc eax
mov dword [esp + 0x18], eax
cmp eax, ebx
jae 0x408699
mov ecx, dword [esp + 0x30]
jmp 0x40862b
test ebx, ebx
je 0x408694
push 0
push 0
push ecx
push ecx
mov ecx, dword [esp + 0x30]
push 2
mov edx, dword [ecx + eax*4]
mov ecx, dword [esp + 0x30]
call fcn.0040d975
mov esi, eax
test esi, esi
js 0x407b82
mov eax, dword [esp + 0x18]
inc eax
mov dword [esp + 0x18], eax
cmp eax, ebx
jb 0x408665
xor eax, eax
lea esi, [eax + 1]
test esi, esi
je 0x4085ad
jmp 0x4086d0
xor edi, edi
test ebx, ebx
je 0x4086d0
mov eax, dword [esp + 0x20]
push 0
push 0
push ecx
mov edx, dword [eax + edi*4]
push ecx
mov ecx, dword [esp + 0x2c]
push 4
call fcn.0040d975
mov esi, eax
test esi, esi
js 0x407b82
inc edi
cmp edi, ebx
jb 0x4086a9
xor esi, esi
jmp 0x407b82
mov edi, dword [esp + 0x10]
jmp 0x407b8a
cmp byte [esp + 0x44], 0
je 0x4086f8
push dword [esp + 0xc0]
push dword [esp + 0x3c]
call dword [sym.imp.USERENV.dll_UnloadUserProfile]
mov ecx, dword [esp + 0x1c]
test ecx, ecx
je 0x408706
mov eax, dword [ecx]
push ecx
call dword [eax + 8]
mov ecx, dword [esp + 0x3c54]
mov eax, esi
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.004114dd
mov esp, ebp
pop ebp
ret 0x1c