Function at 0x10021310
Capabilities:
Resolve function by parsing pe exports

Disassembly:
push 0xffffffffffffffff
push 0x1011e65f
mov eax, dword fs:[0]
push eax
sub esp, 0x4e4
mov eax, dword [0x10159df0]
xor eax, esp
mov dword [esp + 0x4e0], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x10159df0]
xor eax, esp
push eax
lea eax, [esp + 0x4f8]
mov dword fs:[0], eax
mov eax, dword [esp + 0x508]
sub esp, 0x1c
mov dword [esp + 0x60], esp
mov dword [esp + 0x3c], eax
mov eax, esp
push 0x1012d9f4
push 0x1012e5bc
push str.__line:
sub esp, 0x1c
mov dword [esp + 0x5c], esp
mov dword [esp + 0x60], ecx
mov ecx, esp
xor ebx, ebx
push 0x1c
mov ebp, 0xf
mov dword [ecx + 0x18], ebp
mov dword [ecx + 0x14], ebx
push str.._adaptor_cflashtool_api.cpp
mov dword [esp + 0x70], edx
mov edi, 1
mov byte [ecx + 4], bl
mov dword [esp + 0x60], eax
call fcn.10007180
lea esi, [esp + 0xa8]
call fcn.1001a820
add esp, 0x1c
mov esi, eax
mov dword [esp + 0x528], ebx
push 3
push 0x1012da1c
lea ecx, [esp + 0x58]
mov dword [esp + 0x70], ebp
mov dword [esp + 0x6c], ebx
mov byte [esp + 0x5c], bl
call fcn.10007180
push esi
lea eax, [esp + 0x54]
push eax
lea ecx, [esp + 0x78]
push ecx
mov byte [esp + 0x534], 1
call fcn.1000a2e0
add esp, 0xc
push eax
lea edx, [esp + 0xc8]
push edx
mov byte [esp + 0x530], 2
call fcn.1000a390
add esp, 0xc
push eax
lea eax, [esp + 0xa8]
push eax
mov byte [esp + 0x52c], 3
call fcn.1000a390
add esp, 0xc
push eax
mov eax, dword [esp + 0x38]
push eax
mov byte [esp + 0x528], 4
call fcn.1000a390
sub esp, 0x10
mov ecx, esp
mov dword [esp + 0x4c], esp
mov byte [esp + 0x538], 5
push 0x25
mov dword [ecx + 0x18], ebp
mov dword [ecx + 0x14], ebx
push str.cflashtool_api::FlashTool_RomGetCount
mov byte [ecx + 4], bl
call fcn.10007180
mov ecx, edi
lea ebx, [esp + 0xf0]
mov byte [esp + 0x538], 4
call fcn.10055fb0
mov esi, 0x10
cmp dword [esp + 0x98], esi
jb 0x10021492
mov ecx, dword [esp + 0x84]
push ecx
call fcn.100d574a
add esp, 4
xor ebx, ebx
mov dword [esp + 0x98], ebp
mov dword [esp + 0x94], ebx
mov byte [esp + 0x84], bl
cmp dword [esp + 0xb4], esi
jb 0x100214c2
mov edx, dword [esp + 0xa0]
push edx
call fcn.100d574a
add esp, 4
mov dword [esp + 0xb4], ebp
mov dword [esp + 0xb0], ebx
mov byte [esp + 0xa0], bl
cmp dword [esp + 0x60], esi
jb 0x100214ea
mov eax, dword [esp + 0x4c]
push eax
call fcn.100d574a
add esp, 4
mov dword [esp + 0x60], ebp
mov dword [esp + 0x5c], ebx
mov byte [esp + 0x4c], bl
cmp dword [esp + 0x40], esi
jb 0x10021509
mov ecx, dword [esp + 0x2c]
push ecx
call fcn.100d574a
add esp, 4
mov dword [esp + 0x40], ebp
mov dword [esp + 0x3c], ebx
mov byte [esp + 0x2c], bl
mov byte [esp + 0x500], 0xb
cmp dword [esp + 0x7c], esi
jb 0x10021530
mov edx, dword [esp + 0x68]
push edx
call fcn.100d574a
add esp, 4
push 0x1ff
lea eax, [esp + 0x2f9]
push ebx
push eax
mov dword [esp + 0x88], ebp
mov dword [esp + 0x84], ebx
mov byte [esp + 0x74], bl
mov byte [esp + 0x300], bl
call fcn.100db1d0
mov eax, dword [0x1015f9ec]
add esp, 0xc
cmp eax, ebx
je 0x10021587
push 0x10132284
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
cmp eax, ebx
je 0x10021587
mov edx, dword [esp + 0x1c]
lea ecx, [esp + 0x2f4]
push ecx
push edx
call eax
mov edi, dword [esp + 0x1c]
call fcn.1001c660
mov esi, eax
mov ebp, edx
mov dword [esp + 0xdc], ebx
xor eax, eax
lea ecx, [ecx]
mov cl, byte [esp + eax + 0x2f4]
mov byte [esp + eax + 0xe0], cl
inc eax
cmp cl, bl
jne 0x100215a0
lea edi, [esp + 0x2f4]
call fcn.10056ea0
test al, al
je 0x100215dc
mov dword [esp + 0xdc], 2
mov dword [esp + 0x2e0], esi
mov dword [esp + 0x2e4], ebp
cmp dword [esp + 0x50c], ebx
lea edx, [esp + 0x18]
setne al
movzx ecx, al
push ecx
mov ecx, dword [esp + 0x24]
push edx
push ebx
lea eax, [esp + 0xe8]
push eax
push ecx
call dword [sym.imp.FlashtoollibEx.dll_get_revised_scatter_partitions]
mov edx, dword [esp + 0x18]
mov esi, eax
mov eax, dword [esp + 0x24]
lea ecx, [esp + 0xb8]
push ecx
mov dword [eax], edx
mov dword [esp + 0x504], 0xffffffff
call fcn.10056250
mov eax, esi
mov ecx, dword [esp + 0x4f8]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x4e0]
xor ecx, esp
call fcn.100d4871
add esp, 0x4f0
ret 8