Function at 0x1013c180
Capabilities:
Create thread

Disassembly:
push 0xffffffffffffffff
push 0x10199738
mov eax, dword fs:[0]
push eax
sub esp, 0x30
push ebx
push ebp
push edi
mov eax, dword [0x10279264]
xor eax, esp
push eax
lea eax, [esp + 0x40]
mov dword fs:[0], eax
cmp dword [esi], 0
jne 0x1013c588
cmp byte [esi + 0x7c], 0
mov eax, str.true
jne 0x1013c1bf
mov eax, str.false
push eax
mov ebp, str.FlashToolLib_source_common_generic_src_StreamIoMgr.cpp
mov ebx, str.CStreamIoMgr::Start
push str.remote_file__s_
lea edi, [esp + 0x34]
mov dword [esp + 0x34], ebp
mov dword [esp + 0x38], 0x77
mov byte [esp + 0x3c], 0
mov dword [esp + 0x40], str._DEBUG:
mov dword [esp + 0x44], ebx
call fcn.10017c90
mov ecx, dword [esi + 0x74]
xor edi, edi
add esp, 8
cmp ecx, edi
jne 0x1013c244
push str.sp_file_mgr_is_NULL
lea edi, [esp + 0x30]
mov dword [esp + 0x30], ebp
mov dword [esp + 0x34], 0x7a
mov byte [esp + 0x38], 0xff
mov dword [esp + 0x3c], str._ERROR:
mov dword [esp + 0x40], ebx
call fcn.10017c90
add esp, 4
xor eax, eax
mov ecx, dword [esp + 0x40]
mov dword fs:[0], ecx
pop ecx
pop edi
pop ebp
pop ebx
add esp, 0x3c
ret
mov dword [esp + 0x1c], edi
mov dword [esp + 0x20], edi
mov eax, dword [ecx]
mov eax, dword [eax + 8]
lea edx, [esp + 0x1c]
push edx
call eax
mov ecx, dword [esi + 0x18]
mov eax, dword [esp + 0x1c]
cmp ecx, eax
mov ecx, dword [esp + 0x20]
jne 0x1013c26e
mov edx, dword [esi + 0x1c]
cmp edx, ecx
je 0x1013c274
mov dword [esi + 0x18], eax
mov dword [esi + 0x1c], ecx
push 8
call fcn.1016d7a5
add esp, 4
cmp eax, edi
je 0x1013c288
mov dword [eax], edi
mov ecx, eax
jmp 0x1013c28a
xor ecx, ecx
lea eax, [esp + 0x24]
push eax
call fcn.1013c910
lea ebx, [esi + 0x30]
mov dword [esp + 0x48], edi
mov edi, ebx
mov dword [esp + 0x18], ebx
call fcn.1013b890
or ebp, 0xffffffff
mov dword [esp + 0x48], ebp
mov eax, dword [esp + 0x28]
test eax, eax
je 0x1013c2df
mov edi, eax
add eax, 4
mov ecx, ebp
lock xadd dword [eax], ecx
jne 0x1013c2df
mov edx, dword [edi]
mov eax, dword [edx + 4]
mov ecx, edi
call eax
lea ecx, [edi + 8]
mov edx, ebp
lock xadd dword [ecx], edx
jne 0x1013c2df
mov eax, dword [edi]
mov edx, dword [eax + 8]
mov ecx, edi
call edx
mov edi, dword [ebx]
mov ebx, dword [sym.imp.KERNEL32.dll_CreateSemaphoreA]
push 0
push 0x40
push 0
push 0
call ebx
xor ecx, ecx
test eax, eax
setne cl
push 8
mov dword [edi + 4], eax
mov dword [edi], ecx
call fcn.1016d7a5
add esp, 4
test eax, eax
je 0x1013c313
mov dword [eax], 0
jmp 0x1013c315
xor eax, eax
lea edx, [esp + 0x24]
push edx
mov ecx, eax
call fcn.1013c910
lea edi, [esi + 0xc]
mov dword [esp + 0x48], 1
call fcn.1013b890
mov dword [esp + 0x48], ebp
mov eax, dword [esp + 0x28]
test eax, eax
je 0x1013c36b
mov ebp, eax
add eax, 4
or ecx, 0xffffffff
lock xadd dword [eax], ecx
jne 0x1013c36b
mov edx, dword [ebp]
mov eax, dword [edx + 4]
mov ecx, ebp
call eax
lea ecx, [ebp + 8]
or edx, 0xffffffff
lock xadd dword [ecx], edx
jne 0x1013c36b
mov eax, dword [ebp]
mov edx, dword [eax + 8]
mov ecx, ebp
call edx
mov edi, dword [edi]
push 0
push 0x40
push 0
push 0
call ebx
xor ecx, ecx
test eax, eax
setne cl
push 8
mov dword [edi + 4], eax
mov dword [edi], ecx
call fcn.1016d7a5
add esp, 4
test eax, eax
je 0x1013c399
mov dword [eax], 0
jmp 0x1013c39b
xor eax, eax
lea edx, [esp + 0x24]
push edx
mov ecx, eax
call fcn.1013c910
lea edi, [esi + 0x60]
mov dword [esp + 0x48], 2
call fcn.1013b890
mov dword [esp + 0x48], 0xffffffff
mov eax, dword [esp + 0x28]
test eax, eax
je 0x1013c3f5
mov ebp, eax
add eax, 4
or ecx, 0xffffffff
lock xadd dword [eax], ecx
jne 0x1013c3f5
mov edx, dword [ebp]
mov eax, dword [edx + 4]
mov ecx, ebp
call eax
lea ecx, [ebp + 8]
or edx, 0xffffffff
lock xadd dword [ecx], edx
jne 0x1013c3f5
mov eax, dword [ebp]
mov edx, dword [eax + 8]
mov ecx, ebp
call edx
mov edi, dword [edi]
push 0
push 0x40
push 0
push 0
call ebx
xor ecx, ecx
test eax, eax
setne cl
push 8
mov dword [edi + 4], eax
mov dword [edi], ecx
call fcn.1016d7a5
add esp, 4
test eax, eax
je 0x1013c423
mov dword [eax], 0
jmp 0x1013c425
xor eax, eax
lea edx, [esp + 0x24]
push edx
mov ecx, eax
call fcn.1013c910
lea edi, [esi + 0x68]
mov dword [esp + 0x48], 3
call fcn.1013b890
mov dword [esp + 0x48], 0xffffffff
mov eax, dword [esp + 0x28]
test eax, eax
je 0x1013c47f
mov ebp, eax
add eax, 4
or ecx, 0xffffffff
lock xadd dword [eax], ecx
jne 0x1013c47f
mov edx, dword [ebp]
mov eax, dword [edx + 4]
mov ecx, ebp
call eax
lea ecx, [ebp + 8]
or edx, 0xffffffff
lock xadd dword [ecx], edx
jne 0x1013c47f
mov eax, dword [ebp]
mov edx, dword [eax + 8]
mov ecx, ebp
call edx
mov edi, dword [edi]
push 0
push 0x40
push 0
push 0
call ebx
xor ecx, ecx
test eax, eax
setne cl
mov dword [edi + 4], eax
mov dword [edi], ecx
mov edx, dword [esi + 0x3c]
mov eax, dword [esi + 0x38]
push edx
push eax
push 0
push 0x400000
call fcn.10176970
mov ecx, dword [esi + 0x38]
imul ecx, eax
lea eax, [ecx + ecx]
push eax
mov dword [esi + 0x40], ecx
mov dword [esi + 0x44], eax
call fcn.1016bba0
add esp, 4
mov byte [esp + 0x14], 0
mov ecx, dword [esp + 0x14]
push ecx
push eax
lea ecx, [esp + 0x30]
mov dword [esp + 0x2c], eax
call fcn.100ba8e0
lea edi, [esi + 0x48]
lea eax, [esp + 0x24]
mov dword [esp + 0x48], 4
call fcn.1013b890
mov dword [esp + 0x48], 0xffffffff
mov ebp, dword [esp + 0x28]
test ebp, ebp
je 0x1013c52b
lea edx, [ebp + 4]
or eax, 0xffffffff
lock xadd dword [edx], eax
jne 0x1013c52b
mov edx, dword [ebp]
mov eax, dword [edx + 4]
mov ecx, ebp
call eax
lea ecx, [ebp + 8]
or edx, 0xffffffff
lock xadd dword [ecx], edx
jne 0x1013c52b
mov eax, dword [ebp]
mov edx, dword [eax + 8]
mov ecx, ebp
call edx
mov edi, dword [edi]
test edi, edi
je 0x1013c22f
mov eax, dword [esi + 0x44]
push eax
push 0
push edi
call fcn.10173270
add esp, 0xc
push 0
push 0
push esi
push 0x1013bd10
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateThread]
test eax, eax
je 0x1013c22f
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [esp + 0x18]
mov edx, dword [ecx]
push 0
mov dword [esi], 1
mov dword [esi + 0x70], 1
mov eax, dword [edx + 4]
push 1
push eax
call dword [sym.imp.KERNEL32.dll_ReleaseSemaphore]
mov eax, 1
mov ecx, dword [esp + 0x40]
mov dword fs:[0], ecx
pop ecx
pop edi
pop ebp
pop ebx
add esp, 0x3c
ret